Merge branch 'master' of https://github.com/vercel/commerce into custom-checkout

This commit is contained in:
Bel Curcio
2021-06-14 17:43:09 -03:00
167 changed files with 33899 additions and 1165 deletions

View File

@@ -33,6 +33,7 @@ export async function getStaticProps({
config,
preview,
}))
const page = data?.page
if (!page) {
@@ -63,16 +64,18 @@ export async function getStaticPaths({ locales }: GetStaticPathsContext) {
return {
paths,
// Fallback shouldn't be enabled here or otherwise this route
// will catch every page, even 404s, and we don't want that
fallback: false,
fallback: 'blocking',
}
}
export default function Pages({
page,
}: InferGetStaticPropsType<typeof getStaticProps>) {
return (
const router = useRouter()
return router.isFallback ? (
<h1>Loading...</h1> // TODO (BC) Add Skeleton Views
) : (
<div className="max-w-2xl mx-8 sm:mx-auto py-20">
{page?.body && <Text html={page.body} />}
</div>

View File

@@ -15,6 +15,8 @@ export async function getStaticProps({
variables: { first: 6 },
config,
preview,
// Saleor provider only
...({ featured: true } as any),
})
const pagesPromise = commerce.getAllPages({ config, preview })
const siteInfoPromise = commerce.getSiteInfo({ config, preview })