import { useQuery } from '@apollo/client' import { PageOptions } from '@graphcommerce/framer-next-pages' import { ApolloCustomerErrorFullPage, ChangePasswordForm, CustomerDocument, } from '@graphcommerce/magento-customer' import { PageMeta, StoreConfigDocument } from '@graphcommerce/magento-store' import { GetStaticProps, SectionContainer, iconLock, AppShellTitle, SheetShellHeader, Title, } from '@graphcommerce/next-ui' import { Container, NoSsr } from '@material-ui/core' import React from 'react' import SheetShell, { SheetShellProps } from '../../../components/AppShell/SheetShell' import apolloClient from '../../../lib/apolloClient' type GetPageStaticProps = GetStaticProps function AccountAuthenticationPage() { const { loading, data, error } = useQuery(CustomerDocument, { ssr: false, }) const customer = data?.customer if (loading) return
if (error) return ( ) return ( <> Orders Authentication {customer && } ) } const pageOptions: PageOptions = { overlayGroup: 'account', SharedComponent: SheetShell, } AccountAuthenticationPage.pageOptions = pageOptions export default AccountAuthenticationPage export const getStaticProps: GetPageStaticProps = async ({ locale }) => { const client = apolloClient(locale, true) const conf = client.query({ query: StoreConfigDocument }) return { props: { apolloState: await conf.then(() => client.cache.extract()), variant: 'bottom', size: 'max', backFallbackHref: '/account', backFallbackTitle: 'Account', }, } }