diff --git a/components/SideNavbar/SideNavbarCategoryList.tsx b/components/SideNavbar/SideNavbarCategoryList.tsx index c97dbf137..07bf8413d 100644 --- a/components/SideNavbar/SideNavbarCategoryList.tsx +++ b/components/SideNavbar/SideNavbarCategoryList.tsx @@ -64,7 +64,7 @@ const getFilteredCategoryList = (query: string) => { const matchSearch = (item: SubCategories, query: string) => { const itemName = item.name.toLowerCase() - const matchingResources = item.resources.filter( + const matchingResources = item.resources?.filter( (resource: { name: string }) => resource.name.toLowerCase().includes(query.toLowerCase()) ) diff --git a/components/TopBar/TopBar.tsx b/components/TopBar/TopBar.tsx index 3fc7a712f..80c9553ee 100644 --- a/components/TopBar/TopBar.tsx +++ b/components/TopBar/TopBar.tsx @@ -18,6 +18,7 @@ export const TopBar: FC = ({}) => { const { theme } = useTheme() const category = router.asPath + const categoryKeyName = category?.split('/')[1]; const categoryName = category?.split('/')[1]?.split('-').join(' ') const subCategoryKeyName = category?.split('/')[2] const subcategoryName = subCategoryKeyName?.split('-').join(' ') @@ -54,7 +55,7 @@ export const TopBar: FC = ({}) => {

{capitalizeEachWord(categoryName)}

@@ -63,6 +64,7 @@ export const TopBar: FC = ({}) => { +

{capitalizeEachWord(cleanedCategory)}