feat: static generation
This commit is contained in:
1 parent
99255f4f13
commit
25866b9eb9
12 files changed
+56
-72
No files matched your search
@@ -1,23 +1,36 @@
|
||||
'use client';
|
||||
|
||||
import { Moon, Sun } from 'lucide-react';
|
||||
import { useTheme } from 'next-themes';
|
||||
|
||||
import { Button } from '@/components/ui/button';
|
||||
import useTheme from '@/hooks/useTheme';
|
||||
|
||||
const ThemeToggle = () => {
|
||||
const [theme, setTheme] = useTheme();
|
||||
const { setTheme } = useTheme();
|
||||
|
||||
return (
|
||||
<Button
|
||||
aria-label='Toggle theme'
|
||||
variant='ghost'
|
||||
size='icon'
|
||||
onClick={() => setTheme(theme === 'dark' ? 'light' : 'dark')}
|
||||
title={`Set ${theme === 'dark' ? 'light' : 'dark'} theme`}
|
||||
>
|
||||
{theme === 'light' ? <Moon size={19} /> : <Sun size={19} />}
|
||||
</Button>
|
||||
<>
|
||||
<Button
|
||||
aria-label='Toggle theme'
|
||||
variant='ghost'
|
||||
size='icon'
|
||||
onClick={() => setTheme('light')}
|
||||
className='hidden dark:flex'
|
||||
title='Set light theme'
|
||||
>
|
||||
<Sun size={19} />
|
||||
</Button>
|
||||
<Button
|
||||
aria-label='Toggle theme'
|
||||
variant='ghost'
|
||||
size='icon'
|
||||
onClick={() => setTheme('dark')}
|
||||
className='flex dark:hidden'
|
||||
title='Set dark theme'
|
||||
>
|
||||
<Moon size={19} />
|
||||
</Button>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user