diff --git a/components/Aside/Aside.tsx b/components/Aside/Aside.tsx
index ef0d30a87..5973717af 100644
--- a/components/Aside/Aside.tsx
+++ b/components/Aside/Aside.tsx
@@ -1,5 +1,5 @@
import { FC } from 'react'
-import { SideNavbarBody } from 'components/SideNavbar/SideNavbarBody'
+import SideNavbarBody from 'components/SideNavbar/SideNavbarBody'
export const Aside: FC = () => {
return (
diff --git a/components/MobileBottomNav/MobileBottomNav.tsx b/components/MobileBottomNav/MobileBottomNav.tsx
index 9258518f3..6179bf6d4 100644
--- a/components/MobileBottomNav/MobileBottomNav.tsx
+++ b/components/MobileBottomNav/MobileBottomNav.tsx
@@ -1,4 +1,4 @@
-import React, { FC } from 'react'
+import React, { FC, useContext } from 'react'
import { useRouter } from 'next/router'
import Link from 'next/link'
@@ -10,16 +10,17 @@ import TeamInActiveIcon from 'assets/icons/svg/nav/team-inactive.svg'
import TeamActiveIcon from 'assets/icons/svg/nav/team-active.svg'
import SearchAciveIcon from 'assets/icons/svg/nav/search-active.svg'
import SearchInAciveIcon from 'assets/icons/svg/nav/search-inactive.svg'
+import { GlobalContext } from 'context/GlobalContext'
const MobileBottomNav: FC = () => {
const router = useRouter()
+ const { toggleNav } = useContext(GlobalContext)
const inActiveIconCls = 'stroke-gray-400'
const activeIconCls = 'fill-primary dark:fill-white'
const toggleSearch = () => {
- // write the code here
- console.log('hello')
+ toggleNav?.()
}
const navLinks = [
@@ -58,9 +59,8 @@ const MobileBottomNav: FC = () => {
const isUrlMatched = href && checkRoute(href)
const isActive = label === 'Home' ? isHomeActive : isUrlMatched
- const commonCls = `w-full flex items-center flex-col px-4 p-3 gap-2 font-medium rounded-xl hover:bg-slate-100 hover:bg-opacity-50 dark:hover:bg-zinc-400 dark:hover:bg-opacity-10 ${
- isActive ? 'text-primary dark:text-white' : 'text-gray-400'
- }`
+ const commonCls = `w-full flex items-center flex-col px-4 p-3 gap-2 font-medium rounded-xl hover:bg-slate-100 hover:bg-opacity-50 dark:hover:bg-zinc-400 dark:hover:bg-opacity-10 ${isActive ? 'text-primary dark:text-white' : 'text-gray-400'
+ }`
return (
diff --git a/components/Searchbar/ShortcutKey.tsx b/components/Searchbar/ShortcutKey.tsx
index 2a803721e..de352e0de 100644
--- a/components/Searchbar/ShortcutKey.tsx
+++ b/components/Searchbar/ShortcutKey.tsx
@@ -26,7 +26,7 @@ const ShortcutKey: FC = () => {
return (
diff --git a/components/SideNavbar/SideNavbar.tsx b/components/SideNavbar/SideNavbar.tsx
index 8339e0e37..34402fa08 100644
--- a/components/SideNavbar/SideNavbar.tsx
+++ b/components/SideNavbar/SideNavbar.tsx
@@ -2,12 +2,10 @@ import { FC } from 'react'
import { useContext } from 'react'
import { GlobalContext } from 'context/GlobalContext'
import { Backdrop } from 'components/Backdrop/Backdrop'
-import { SideNavbarHeader } from './SideNavbarHeader'
-import { SideNavbarBody } from './SideNavbarBody'
import { createPortal } from 'react-dom'
-import { SocialMediaIconsList } from 'components/SocialMedia/SocialMediaIconsList'
import useDelayUnmount from 'hooks/useDelayUnmount'
import { IContext } from 'types'
+import SideNavbarBody from './SideNavbarBody'
export const SideNavbar: FC = () => {
const { sidebar, closeNav } = useContext(GlobalContext)
@@ -31,16 +29,10 @@ export const SideNavbar: FC = () => {
/>
{createPortal(
-
-
,
overlayRoot
diff --git a/components/SideNavbar/SideNavbarBody.tsx b/components/SideNavbar/SideNavbarBody.tsx
index 4dc2a9e94..8d6215e3e 100644
--- a/components/SideNavbar/SideNavbarBody.tsx
+++ b/components/SideNavbar/SideNavbarBody.tsx
@@ -1,32 +1,33 @@
-import { FC, memo, useRef } from 'react'
+import { memo, useRef, FC } from 'react'
+
import { Searchbar } from 'components/Searchbar/Searchbar'
-import classNames from 'classnames'
-import { useTheme } from 'next-themes'
-import { SideNavbarCategoryList } from './SideNavbarCategoryList'
+import { SideNavbarCategoryList } from 'components/SideNavbar/SideNavbarCategoryList'
+const MemoizedSideNavbarCategoryList = memo(SideNavbarCategoryList)
+
import { useSearchReducer } from 'hooks/useSearchReducer'
import useSearchShortcut from 'hooks/useSearchShortcut'
-const MemoizedSideNavbarCategoryList = memo(SideNavbarCategoryList)
-export const SideNavbarBody: FC = () => {
- const { theme } = useTheme()
- const [searchState, dispatchSearch] = useSearchReducer()
+const SideNavbarBody: FC = () => {
const inputRef: React.RefObject = useRef(null)
useSearchShortcut({ inputRef })
+
+ const [searchState, dispatchSearch] = useSearchReducer()
+
return (
-
-
+
)
}
+
+export default SideNavbarBody
diff --git a/components/SideNavbar/SideNavbarCategoryList.tsx b/components/SideNavbar/SideNavbarCategoryList.tsx
index eba0a061a..c97dbf137 100644
--- a/components/SideNavbar/SideNavbarCategoryList.tsx
+++ b/components/SideNavbar/SideNavbarCategoryList.tsx
@@ -32,7 +32,7 @@ export const SideNavbarCategoryList: FC<{
{categoriesList.map((categoryData) => (