fix to category search

This commit is contained in:
Joel Varty
2021-06-22 17:12:31 -04:00
parent 3114388069
commit 00227d8bf0
11 changed files with 50 additions and 12 deletions

View File

@@ -95,13 +95,16 @@ const Layout: FC<Props> = (props) => {
const {
children,
pageProps: { agilityProps, categories = [], ...pageProps },
pageProps: { agilityProps, ...pageProps },
} = props
const { acceptedCookies, onAcceptCookies } = useAcceptCookies()
const { locale = 'en-US' } = useRouter()
const navBarlinks = categories.slice(0, 2).map((c) => ({
const categories = agilityProps?.globalData?.sitedata?.categoryLinks || []
const navBarlinks = categories.slice(0, 2).map((c:any) => ({
label: c.name,
href: `/search/${c.slug}`,
}))