import { PageOptions } from '@graphcommerce/framer-next-pages' import { CartSummary, CartTotals } from '@graphcommerce/magento-cart' import { PaymentAgreementsForm } from '@graphcommerce/magento-cart-checkout' import { CouponAccordion } from '@graphcommerce/magento-cart-coupon' import { PaymentMethodButton, PaymentMethodContextProvider, PaymentMethodOptions, PaymentMethodPlaceOrder, PaymentMethodToggle, } from '@graphcommerce/magento-cart-payment-method' import { braintree, braintree_local_payment } from '@graphcommerce/magento-payment-braintree' import { included_methods } from '@graphcommerce/magento-payment-included' import { mollie_methods } from '@graphcommerce/magento-payment-mollie' import { PageMeta, StoreConfigDocument } from '@graphcommerce/magento-store' import { AppShellTitle, FormDiv, GetStaticProps, iconChevronRight, iconId, PageShellHeader, Stepper, SvgImage, Title, } from '@graphcommerce/next-ui' import { ComposedForm } from '@graphcommerce/react-hook-form' import { Container, Divider, NoSsr } from '@material-ui/core' import { AnimatePresence } from 'framer-motion' import React from 'react' import { FullPageShellProps } from '../../components/AppShell/FullPageShell' import MinimalPageShell from '../../components/AppShell/MinimalPageShell' import { SheetShellProps } from '../../components/AppShell/SheetShell' import { DefaultPageDocument } from '../../components/GraphQL/DefaultPage.gql' import apolloClient from '../../lib/apolloClient' type Props = Record type GetPageStaticProps = GetStaticProps function PaymentPage() { return ( } > Pay } divider={ } backFallbackHref='/cart' backFallbackTitle='Cart' > Payment Payment ( {children} )} /> } > Place order ) } const pageOptions: PageOptions = { SharedComponent: MinimalPageShell, sharedKey: () => 'checkout', } PaymentPage.pageOptions = pageOptions export default PaymentPage export const getStaticProps: GetPageStaticProps = async ({ locale }) => { const client = apolloClient(locale, true) const staticClient = apolloClient(locale) const conf = client.query({ query: StoreConfigDocument }) const page = staticClient.query({ query: DefaultPageDocument, variables: { url: `checkout/payment`, rootCategory: (await conf).data.storeConfig?.root_category_uid ?? '', }, }) return { props: { ...(await page).data, apolloState: await conf.then(() => client.cache.extract()), backFallbackHref: '/checkout', backFallbackTitle: 'Shipping', }, } }