@@ -3,7 +3,8 @@ 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'
6+ import { RxArrowLeft } from 'react-icons/rx'
7+ import { Link , useLocation , useNavigate } from 'react-router-dom'
78import { ReactComponent as HackertabLogo } from 'src/assets/logo.svg'
89import { SearchBar } from 'src/components/Elements/SearchBar'
910import { UserTags } from 'src/components/Elements/UserTags'
@@ -17,6 +18,7 @@ export const Header = () => {
1718 const { theme, setTheme, setDNDDuration, isDNDModeActive } = useUserPreferences ( )
1819 const { userBookmarks } = useBookmarks ( )
1920 const navigate = useNavigate ( )
21+ const location = useLocation ( )
2022
2123 useEffect ( ( ) => {
2224 document . documentElement . classList . add ( theme )
@@ -59,6 +61,8 @@ export const Header = () => {
5961 setDNDDuration ( 'never' )
6062 }
6163
64+ console . log ( 'location' , location )
65+
6266 return (
6367 < >
6468 < header className = "AppHeader" >
@@ -95,7 +99,15 @@ export const Header = () => {
9599 </ >
96100 </ Link >
97101 </ div >
98- < UserTags />
102+ { location . pathname === '/' ? (
103+ < UserTags />
104+ ) : (
105+ < div className = "backToHome" >
106+ < Link to = "/" >
107+ < RxArrowLeft size = { 20 } /> Back
108+ </ Link >
109+ </ div >
110+ ) }
99111 </ header >
100112 </ >
101113 )
0 commit comments