@@ -3,31 +3,20 @@ import { BsFillBookmarksFill, BsFillGearFill, BsMoonFill } from 'react-icons/bs'
33import { CgTab } from 'react-icons/cg'
44import { IoMdSunny } from 'react-icons/io'
55import { MdDoDisturbOff } from 'react-icons/md'
6+ import { Link , useNavigate } from 'react-router-dom'
67import { ReactComponent as HackertabLogo } from 'src/assets/logo.svg'
78import { SearchBar } from 'src/components/Elements/SearchBar'
89import { UserTags } from 'src/components/Elements/UserTags'
910import { Changelog } from 'src/features/changelog'
10- import { SettingsModal } from 'src/features/settings'
1111import { identifyUserTheme , trackDNDDisable , trackThemeSelect } from 'src/lib/analytics'
1212import { useBookmarks } from 'src/stores/bookmarks'
1313import { useUserPreferences } from 'src/stores/preferences'
1414
15- type HeaderProps = {
16- showSideBar : boolean
17- setShowSideBar : ( show : boolean ) => void
18- showSettings : boolean
19- setShowSettings : ( show : boolean ) => void
20- }
21-
22- export const Header = ( {
23- showSideBar,
24- setShowSideBar,
25- showSettings,
26- setShowSettings,
27- } : HeaderProps ) => {
15+ export const Header = ( ) => {
2816 const [ themeIcon , setThemeIcon ] = useState ( < BsMoonFill /> )
2917 const { theme, setTheme, setDNDDuration, isDNDModeActive } = useUserPreferences ( )
3018 const { userBookmarks } = useBookmarks ( )
19+ const navigate = useNavigate ( )
3120
3221 useEffect ( ( ) => {
3322 document . documentElement . classList . add ( theme )
@@ -52,7 +41,7 @@ export const Header = ({
5241 }
5342
5443 const onSettingsClick = ( ) => {
55- setShowSettings ( true )
44+ navigate ( '/settings/general' )
5645 }
5746
5847 const BookmarksBadgeCount = ( ) => {
@@ -72,14 +61,14 @@ export const Header = ({
7261
7362 return (
7463 < >
75- < SettingsModal showSettings = { showSettings } setShowSettings = { setShowSettings } />
76-
7764 < header className = "AppHeader" >
7865 < span className = "AppName" >
7966 < i className = "logo" >
8067 < CgTab />
8168 </ i > { ' ' }
82- < HackertabLogo aria-label = "hackertab.dev" className = "logoText" />
69+ < Link to = "/" >
70+ < HackertabLogo aria-label = "hackertab.dev" className = "logoText" />
71+ </ Link >
8372 < Changelog />
8473 </ span >
8574 < SearchBar />
@@ -99,15 +88,14 @@ export const Header = ({
9988 onClick = { onThemeChange } >
10089 { themeIcon }
10190 </ button >
102- < button
103- aria-label = "Open bookmarks"
104- className = "extraBtn"
105- onClick = { ( ) => setShowSideBar ( ! showSideBar ) } >
106- < BsFillBookmarksFill />
107- < BookmarksBadgeCount />
108- </ button >
91+ < Link to = "/settings/bookmarks" className = "extraBtn" aria-label = "Open bookmarks" >
92+ < >
93+ < BsFillBookmarksFill />
94+ < BookmarksBadgeCount />
95+ </ >
96+ </ Link >
10997 </ div >
110- < UserTags onAddClicked = { onSettingsClick } />
98+ < UserTags />
11199 </ header >
112100 </ >
113101 )
0 commit comments