mirror of
https://github.com/neosubhamoy/neodlp.git
synced 2026-03-22 22:55:48 +05:30
refactor: migrated to react-resizable-panels v4
This commit is contained in:
@@ -10,6 +10,7 @@ import { PlaylistToggleGroup, PlaylistToggleGroupItem } from "@/components/custo
|
||||
import { getMergedBestFormat } from "@/utils";
|
||||
import { Switch } from "@/components/ui/switch";
|
||||
import { FormatToggleGroup, FormatToggleGroupItem } from "@/components/custom/formatToggleGroup";
|
||||
import { Layout } from "react-resizable-panels";
|
||||
|
||||
interface PlaylistPreviewSelectionProps {
|
||||
videoMetadata: RawVideoInfo;
|
||||
@@ -348,18 +349,22 @@ export function PlaylistDownloader({ videoMetadata, audioOnlyFormats, videoOnlyF
|
||||
return (
|
||||
<div className="flex">
|
||||
<ResizablePanelGroup
|
||||
direction="horizontal"
|
||||
orientation="horizontal"
|
||||
className="w-full"
|
||||
onLayout={(sizes) => setPlaylistPanelSizes(sizes)}
|
||||
onLayoutChanged={(layout: Layout) => {
|
||||
const firstPanelSize = layout[Object.keys(layout)[0]];
|
||||
const secondPanelSize = layout[Object.keys(layout)[1]];
|
||||
setPlaylistPanelSizes([firstPanelSize, secondPanelSize]);
|
||||
}}
|
||||
>
|
||||
<ResizablePanel
|
||||
defaultSize={playlistPanelSizes[0]}
|
||||
defaultSize={`${playlistPanelSizes[0]}%`}
|
||||
>
|
||||
<PlaylistPreviewSelection videoMetadata={videoMetadata} />
|
||||
</ResizablePanel>
|
||||
<ResizableHandle />
|
||||
<ResizableHandle withHandle />
|
||||
<ResizablePanel
|
||||
defaultSize={playlistPanelSizes[1]}
|
||||
defaultSize={`${playlistPanelSizes[1]}%`}
|
||||
>
|
||||
<div className="flex flex-col w-full pl-4">
|
||||
<Tabs
|
||||
|
||||
@@ -12,6 +12,7 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
|
||||
import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from "@/components/ui/resizable";
|
||||
import { FormatToggleGroup, FormatToggleGroupItem } from "@/components/custom/formatToggleGroup";
|
||||
import { Layout } from "react-resizable-panels";
|
||||
|
||||
interface VideoPreviewProps {
|
||||
videoMetadata: RawVideoInfo;
|
||||
@@ -325,18 +326,22 @@ export function VideoDownloader({ videoMetadata, audioOnlyFormats, videoOnlyForm
|
||||
return (
|
||||
<div className="flex">
|
||||
<ResizablePanelGroup
|
||||
direction="horizontal"
|
||||
orientation="horizontal"
|
||||
className="w-full"
|
||||
onLayout={(sizes) => setVideoPanelSizes(sizes)}
|
||||
onLayoutChanged={(layout: Layout) => {
|
||||
const firstPanelSize = layout[Object.keys(layout)[0]];
|
||||
const secondPanelSize = layout[Object.keys(layout)[1]];
|
||||
setVideoPanelSizes([firstPanelSize, secondPanelSize]);
|
||||
}}
|
||||
>
|
||||
<ResizablePanel
|
||||
defaultSize={videoPanelSizes[0]}
|
||||
defaultSize={`${videoPanelSizes[0]}%`}
|
||||
>
|
||||
<VideoPreview videoMetadata={videoMetadata} />
|
||||
</ResizablePanel>
|
||||
<ResizableHandle />
|
||||
<ResizableHandle withHandle />
|
||||
<ResizablePanel
|
||||
defaultSize={videoPanelSizes[1]}
|
||||
defaultSize={`${videoPanelSizes[1]}%`}
|
||||
>
|
||||
<div className="flex flex-col w-full pl-4">
|
||||
<Tabs
|
||||
|
||||
Reference in New Issue
Block a user