@@ -5,15 +5,14 @@ import { useEffect, useState } from "react";
55import { addBodyNoScroll , getTheme , isMobileDevice , removeBodyNoScroll } from "../../utils/utils" ;
66import NavSidebar from './NavSideBar' ;
77import Search from "../Search" ;
8+ import { PRIMARY_NAV } from "../../../pages/_BLOG_SETUP"
89
910interface iNavbar {
10- type ?: NavbarLayouts ;
11- showSocialMedia ?: boolean
12- container ?: ContainerWidths ;
13- // setShowSearch?: any
11+ showSocialMedia ?: boolean ;
12+ container ?:ContainerWidths ;
1413}
1514
16- const Navbar = ( { type = NavbarLayouts . DEFAULT , showSocialMedia = true , container = ContainerWidths . DEFAULT } : iNavbar ) => {
15+ const Navbar = ( { showSocialMedia = true , container = ContainerWidths . DEFAULT } : iNavbar ) => {
1716 const [ theme , setTheme ] = useState ( THEMES . LIGHT ) ;
1817 const [ isMobile , setIsMobile ] = useState ( false ) ;
1918 const [ openSidebar , setOpenSidebar ] = useState ( false ) ;
@@ -72,7 +71,7 @@ const Navbar = ({ type = NavbarLayouts.DEFAULT, showSocialMedia = true, containe
7271 < >
7372 {
7473 isMobile ? < SimpleNavbar
75- container = { container }
74+ container = { ContainerWidths . DEFAULT }
7675 showSocial = { showSocialMedia }
7776 openSearch = { openSearch }
7877 scrolled = { scrolled }
@@ -82,11 +81,11 @@ const Navbar = ({ type = NavbarLayouts.DEFAULT, showSocialMedia = true, containe
8281 openSidebar = { openSidebar }
8382 /> :
8483 ( ( ) => {
85- switch ( type ) {
84+ switch ( PRIMARY_NAV . type ) {
8685 case NavbarLayouts . DEFAULT :
8786 return (
8887 < SimpleNavbar
89- container = { container }
88+ container = { container || PRIMARY_NAV . width }
9089 showSocial = { showSocialMedia }
9190 openSearch = { openSearch }
9291 scrolled = { scrolled }
@@ -98,7 +97,7 @@ const Navbar = ({ type = NavbarLayouts.DEFAULT, showSocialMedia = true, containe
9897 case NavbarLayouts . CENTERED :
9998 return (
10099 < CenteredNavbar
101- container = { container }
100+ container = { container || PRIMARY_NAV . width }
102101 showSocial = { showSocialMedia }
103102 openSearch = { openSearch }
104103 scrolled = { scrolled }
@@ -110,7 +109,7 @@ const Navbar = ({ type = NavbarLayouts.DEFAULT, showSocialMedia = true, containe
110109 default :
111110 return (
112111 < SimpleNavbar
113- container = { container }
112+ container = { container || PRIMARY_NAV . width }
114113 showSocial = { showSocialMedia }
115114 openSearch = { openSearch }
116115 scrolled = { scrolled }
@@ -124,7 +123,7 @@ const Navbar = ({ type = NavbarLayouts.DEFAULT, showSocialMedia = true, containe
124123 } ) ( )
125124 }
126125
127- < NavSidebar openSidebar = { openSidebar } theme = { theme } closeNavSidebar = { ( ) => setOpenSidebar ( false ) } />
126+ < NavSidebar openSidebar = { openSidebar } theme = { theme } closeNavSidebar = { ( ) => setOpenSidebar ( false ) } navSetup = { PRIMARY_NAV } />
128127 { showSearch && < Search setShowSearch = { setShowSearch } /> }
129128 </ >
130129 )
0 commit comments