forked from crowetic/commerce
Added i18n configs
This commit is contained in:
parent
dae1477063
commit
f3f0ba0935
@ -21,6 +21,7 @@ const Layout: FC<Props> = ({ children, pageProps }) => {
|
|||||||
const [hasScrolled, setHasScrolled] = useState(false)
|
const [hasScrolled, setHasScrolled] = useState(false)
|
||||||
|
|
||||||
// TODO: Update code, add throttle and more.
|
// TODO: Update code, add throttle and more.
|
||||||
|
// TODO: Make sure to not do any unnecessary updates as it's doing right now
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const offset = 0
|
const offset = 0
|
||||||
function handleScroll() {
|
function handleScroll() {
|
||||||
|
@ -3,9 +3,11 @@ module.exports = {
|
|||||||
sizes: [320, 480, 820, 1200, 1600],
|
sizes: [320, 480, 820, 1200, 1600],
|
||||||
domains: ['cdn11.bigcommerce.com'],
|
domains: ['cdn11.bigcommerce.com'],
|
||||||
},
|
},
|
||||||
i18n: {
|
experimental: {
|
||||||
locales: ['en', 'es'],
|
i18n: {
|
||||||
defaultLocale: 'en',
|
locales: ['en-US', 'es'],
|
||||||
|
defaultLocale: 'en-US',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
rewrites() {
|
rewrites() {
|
||||||
return [
|
return [
|
||||||
|
@ -8,7 +8,12 @@ import { Layout } from '@components/core'
|
|||||||
import { Grid, Marquee, Hero } from '@components/ui'
|
import { Grid, Marquee, Hero } from '@components/ui'
|
||||||
import { ProductCard } from '@components/product'
|
import { ProductCard } from '@components/product'
|
||||||
|
|
||||||
export async function getStaticProps({ preview }: GetStaticPropsContext) {
|
export async function getStaticProps({
|
||||||
|
preview,
|
||||||
|
locale,
|
||||||
|
}: GetStaticPropsContext) {
|
||||||
|
console.log('LOCALE', locale)
|
||||||
|
|
||||||
const { products: featuredProducts } = await getAllProducts({
|
const { products: featuredProducts } = await getAllProducts({
|
||||||
variables: { field: 'featuredProducts', first: 6 },
|
variables: { field: 'featuredProducts', first: 6 },
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user