Added locale to all pages

This commit is contained in:
Luis Alvarez
2020-10-27 04:00:42 -05:00
parent f54f830464
commit c1d0395c4e
7 changed files with 52 additions and 19 deletions

View File

@@ -1,11 +1,16 @@
import type { GetStaticPropsContext } from 'next'
import { getConfig } from '@lib/bigcommerce/api'
import getAllPages from '@lib/bigcommerce/api/operations/get-all-pages'
import { Layout } from '@components/core'
import { Container, Text } from '@components/ui'
import { Bag } from '@components/icons'
export async function getStaticProps({ preview }: GetStaticPropsContext) {
const { pages } = await getAllPages({ preview })
export async function getStaticProps({
preview,
locale,
}: GetStaticPropsContext) {
const config = getConfig({ locale })
const { pages } = await getAllPages({ config, preview })
return {
props: { pages },
}