Skip to content

Commit

Permalink
updates for seo / accessibility
Browse files Browse the repository at this point in the history
  • Loading branch information
dabit3 committed Jan 6, 2021
1 parent 293f1fd commit 512bbe8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion components/CartLink.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState, useEffect } from 'react'
import { useState, useEffect } from 'react'
import { SiteContext } from '../context/mainContext'
import { FaShoppingCart, FaCircle } from 'react-icons/fa';
import Link from "next/link"
Expand Down
6 changes: 6 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
i18n: {
locales: ['en-US'],
defaultLocale: 'en-US'
}
}
7 changes: 7 additions & 0 deletions pages/cart.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Link from 'next/link'
import { useState, useEffect } from 'react'
import { FaTimes, FaLongArrowAltRight } from 'react-icons/fa'
import { SiteContext, ContextProviderComponent } from '../context/mainContext'
import DENOMINATION from '../utils/currencyProvider'
Expand All @@ -8,6 +9,10 @@ import Image from '../components/Image'
import Head from 'next/head'

const Cart = ({ context }) => {
const [renderClientSideComponent, setRenderClientSideComponent] = useState(false)
useEffect(() => {
setRenderClientSideComponent(true)
}, [])
const {
numberOfItemsInCart, cart, removeFromCart, total, setItemQuantity
} = context
Expand All @@ -24,6 +29,8 @@ const Cart = ({ context }) => {
setItemQuantity(item)
}

if (!renderClientSideComponent) return null

return (
<>
<div className="flex flex-col items-center pb-10">
Expand Down

0 comments on commit 512bbe8

Please sign in to comment.