diff --git a/src/components/navbar/Navbar.tsx b/src/components/navbar/Navbar.tsx index b82a501..210c122 100644 --- a/src/components/navbar/Navbar.tsx +++ b/src/components/navbar/Navbar.tsx @@ -1,6 +1,10 @@ import Link from 'next/link' +import dynamic from 'next/dynamic' import SkipLink from '../common/SkipLink' -import DarkModeToggle from '../theme/DarkModeToggle' + +const DarkModeToggle = dynamic(() => import('../theme/DarkModeToggle'), { + ssr: false, +}) const Navbar = () => { // This is for further possible development diff --git a/src/components/theme/DarkModeProvider.tsx b/src/components/theme/DarkModeProvider.tsx index a71ab8a..70a98ee 100644 --- a/src/components/theme/DarkModeProvider.tsx +++ b/src/components/theme/DarkModeProvider.tsx @@ -8,7 +8,7 @@ type ProviderProps = { } const DarkModeProvider = ({ children }: ProviderProps) => ( - + {children} ) diff --git a/src/components/theme/DarkModeToggle.tsx b/src/components/theme/DarkModeToggle.tsx index 4ee2677..a4600ed 100644 --- a/src/components/theme/DarkModeToggle.tsx +++ b/src/components/theme/DarkModeToggle.tsx @@ -3,39 +3,24 @@ import React from 'react' import { useTheme } from 'next-themes' +import SunIcon from './SunIcon' +import MoonIcon from './MoonIcon' + const DarkModeToggle = () => { const { theme, setTheme } = useTheme() - + return ( ) } diff --git a/src/components/theme/MoonIcon.tsx b/src/components/theme/MoonIcon.tsx new file mode 100644 index 0000000..1630802 --- /dev/null +++ b/src/components/theme/MoonIcon.tsx @@ -0,0 +1,16 @@ +import React from "react" + +const MoonIcon = () => ( + +) + +export default MoonIcon \ No newline at end of file diff --git a/src/components/theme/SunIcon.tsx b/src/components/theme/SunIcon.tsx new file mode 100644 index 0000000..fa1f2ee --- /dev/null +++ b/src/components/theme/SunIcon.tsx @@ -0,0 +1,16 @@ +import React from "react"; + +const SunIcon = () => ( + +) + +export default SunIcon \ No newline at end of file