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>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ import { useRouter } from 'next/navigation';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import ButtonsGroup from '@/components/ui/buttons-group';
|
||||
import useShowState, { useMutateShowState } from '@/hooks/useShowState';
|
||||
import useTheme from '@/hooks/useTheme';
|
||||
import { cn } from '@/lib/utils';
|
||||
|
||||
interface Props {
|
||||
@@ -18,8 +17,6 @@ interface Props {
|
||||
const Actions = ({ onClose, show, className }: Props) => {
|
||||
const router = useRouter();
|
||||
|
||||
const [theme] = useTheme();
|
||||
|
||||
const state = useShowState({ showId: show.id, showType: show.type });
|
||||
const toggle = useMutateShowState(show);
|
||||
|
||||
@@ -63,10 +60,7 @@ const Actions = ({ onClose, show, className }: Props) => {
|
||||
</Button>
|
||||
<Button
|
||||
aria-label='Watch'
|
||||
className={cn('hover:shadow-lg hover:shadow-red-600/60 duration-200 transition-all hover:bg-red-600', {
|
||||
'bg-red-600': theme === 'light',
|
||||
'bg-red-700': theme === 'dark'
|
||||
})}
|
||||
className='bg-red-600 transition-all duration-200 hover:bg-red-600 hover:shadow-lg hover:shadow-red-600/60 dark:bg-red-700'
|
||||
variant='destructive'
|
||||
onClick={async () => {
|
||||
const showTorrentsModal = (await import('../Torrents')).default;
|
||||
|
||||
Reference in new issue
Block a user