diff --git a/components/navbar/Navbar.js b/components/navbar/Navbar.js index 2373fe1ca19..46786b443ec 100644 --- a/components/navbar/Navbar.js +++ b/components/navbar/Navbar.js @@ -14,20 +14,19 @@ const FaRegMoon = getIcon("FaRegMoon"); const FaSun = getIcon("FaSun"); export default function Navbar() { - const { systemTheme, theme, setTheme } = useTheme(); + const [isOpen, setIsOpen] = useState(false); const [mounted, setMounted] = useState(false); + const router = useRouter(); + const navConRef = useRef(); + const { data: session } = useSession(); + const { systemTheme, theme, setTheme } = useTheme(); + const getLink = (path) => `${router.basePath}${path}`; + useEffect(() => { setMounted(true); }, []); - const { data: session } = useSession(); - const [isOpen, setIsOpen] = useState(false); - - const router = useRouter(); - const getLink = (path) => `${router.basePath}${path}`; - const navConRef = useRef(); - const renderThemeChanger = () => { if (!mounted) { return null; @@ -38,7 +37,7 @@ export default function Navbar() { if (currentTheme === "dark") { return (