fix: reduced bundle size
This commit is contained in:
1 parent
4e11c5228a
commit
053283564c
4 files changed
+33
-15
No files matched your search
@@ -3,7 +3,6 @@
|
||||
import { Bookmark, Copy, Heart, Play, Star } from 'lucide-react';
|
||||
import { useRouter } from 'next/navigation';
|
||||
|
||||
import showTorrentsModal from '@/components/Preview/components/Torrents';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import ButtonsGroup from '@/components/ui/buttons-group';
|
||||
import useShowState, { useMutateShowState } from '@/hooks/useShowState';
|
||||
@@ -69,14 +68,16 @@ const Actions = ({ onClose, show, className }: Props) => {
|
||||
'bg-red-700': theme === 'dark'
|
||||
})}
|
||||
variant='destructive'
|
||||
onClick={() =>
|
||||
onClick={async () => {
|
||||
const showTorrentsModal = (await import('../Torrents')).default;
|
||||
|
||||
showTorrentsModal({
|
||||
imdbID: show.imdb_id!,
|
||||
title: show.title,
|
||||
backdrop: show.backdrop,
|
||||
year: new Date(show.release).getFullYear()
|
||||
})
|
||||
}
|
||||
});
|
||||
}}
|
||||
>
|
||||
<Play size={15} />
|
||||
Watch
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import { create, InstanceProps } from 'react-modal-promise';
|
||||
import { Check } from 'lucide-react';
|
||||
|
||||
import { Button } from '@/components/ui/button';
|
||||
import ButtonsGroup from '@/components/ui/buttons-group';
|
||||
import { Modal } from '@/components/ui/dialog';
|
||||
import { Input } from '@/components/ui/input';
|
||||
|
||||
@@ -10,15 +13,29 @@ const showHostManagerModal = create<InstanceProps<string>>(({ onResolve, onRejec
|
||||
const setPrefix = useSetPrefix();
|
||||
|
||||
return (
|
||||
<Modal className='m-auto max-w-[200px] p-2' onClose={onReject}>
|
||||
<Input
|
||||
autoFocus
|
||||
placeholder='Enter address of your torrents streamer'
|
||||
value={prefix}
|
||||
className='focus-visible:ring-0'
|
||||
onChange={({ target: { value } }) => setPrefix(value)}
|
||||
onKeyDown={({ key }) => key === 'Enter' && onResolve(prefix)}
|
||||
/>
|
||||
<Modal className='m-auto p-2' onClose={onReject}>
|
||||
<form
|
||||
onSubmit={(event) => {
|
||||
event.preventDefault();
|
||||
onResolve(prefix);
|
||||
}}
|
||||
>
|
||||
<ButtonsGroup className='h-10'>
|
||||
<Input
|
||||
autoFocus
|
||||
placeholder='Enter address of your torrents streamer'
|
||||
value={prefix}
|
||||
className='h-full'
|
||||
onChange={({ target: { value } }) => setPrefix(value)}
|
||||
/>
|
||||
<Button
|
||||
type='submit'
|
||||
className='h-full !px-3 transition-all duration-200 hover:bg-secondary-foreground hover:shadow-lg hover:shadow-secondary-foreground/60'
|
||||
>
|
||||
<Check size={16} />
|
||||
</Button>
|
||||
</ButtonsGroup>
|
||||
</form>
|
||||
</Modal>
|
||||
);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user