Skip to content

Commit

Permalink
mv mobile dark mode
Browse files Browse the repository at this point in the history
  • Loading branch information
adnjoo committed Oct 6, 2023
1 parent e570361 commit e90b453
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/components/NavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export default function ResponsiveAppBar(): any {
const [anchorElNav, setAnchorElNav] = React.useState<any>(false);
const { theme, setTheme } = useTheme();
const pathname = usePathname();
console.log(pathname);

const handleOpenNavMenu = (event: any): any => {
setAnchorElNav(anchorElNav ? false : event.currentTarget);
Expand Down Expand Up @@ -81,7 +80,7 @@ export default function ResponsiveAppBar(): any {
</Box>
{theme === 'dark' ? (
<MenuItem
className='absolute right-0 my-2 text-sky-200 transition duration-200 ease-in-out hover:text-sky-400 md:relative md:flex'
className='my-2 hidden text-slate-200 transition duration-200 ease-in-out hover:text-slate-400 md:relative md:flex'
onClick={() => {
setTheme('light');
}}
Expand All @@ -90,7 +89,7 @@ export default function ResponsiveAppBar(): any {
</MenuItem>
) : (
<MenuItem
className='absolute right-0 my-2 text-sky-200 transition duration-200 ease-in-out hover:text-sky-400 md:relative md:flex'
className='my-2 hidden text-slate-200 transition duration-200 ease-in-out hover:text-slate-400 md:relative md:flex'
onClick={() => {
setTheme('dark');
}}
Expand Down Expand Up @@ -136,6 +135,19 @@ export default function ResponsiveAppBar(): any {
{page.name}
</MenuItem>
))}
<MenuItem
className='my-2 text-sky-600 transition duration-200 ease-in-out hover:text-sky-400'
onClick={() => {
setTheme(theme === 'dark' ? 'light' : 'dark');
}}
>
{theme === 'dark' ? 'Light Mode' : 'Dark Mode'}
{theme === 'dark' ? (
<BsFillSunFill className='ml-1' size={24} />
) : (
<BsMoonFill className='ml-1' size={24} />
)}
</MenuItem>
</Menu>
</Box>
{/* Mobile View Title Text */}
Expand Down

1 comment on commit e90b453

@vercel
Copy link

@vercel vercel bot commented on e90b453 Oct 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.