From c133b18b491c3b81019a7d46fd0837ff851e9372 Mon Sep 17 00:00:00 2001 From: Subhamoy Biswas Date: Wed, 9 Jul 2025 21:51:51 +0530 Subject: [PATCH] (refactor): improved settings categorization and layout --- src/pages/settings.tsx | 434 +++++++++++++++++++++++------------------ 1 file changed, 242 insertions(+), 192 deletions(-) diff --git a/src/pages/settings.tsx b/src/pages/settings.tsx index 64c9147..5c3ed7f 100644 --- a/src/pages/settings.tsx +++ b/src/pages/settings.tsx @@ -7,7 +7,7 @@ import { Switch } from "@/components/ui/switch"; import { Label } from "@/components/ui/label"; import { Button } from "@/components/ui/button"; import { useToast } from "@/hooks/use-toast"; -import { ExternalLink, FolderOpen, Loader2, LucideIcon, Monitor, Moon, Radio, RotateCcw, RotateCw, Sun, Terminal } from "lucide-react"; +import { ExternalLink, Folder, FolderOpen, Loader2, LucideIcon, Monitor, Moon, Radio, RotateCcw, RotateCw, Sun, Terminal, WandSparkles, Wifi, Wrench } from "lucide-react"; import { cn } from "@/lib/utils"; import { useEffect } from "react"; import { useTheme } from "@/providers/themeProvider"; @@ -157,11 +157,40 @@ export default function SettingsPage() {
- - General - Extension - - +
+ + Application + Extension + + + + + + + + Reset settings to default? + + Are you sure you want to reset all settings to their default values? This action cannot be undone! + + + + Cancel + resetSettings() + }>Reset + + + +
+
@@ -220,124 +249,160 @@ export default function SettingsPage() {
-
-
-

Theme

-

Choose app interface theme

-
- {themeOptions.map(({ value, icon: Icon, label }) => ( - - ))} -
-
-
-

Download Directory

-

Set default download directory

-
- - -
-
-
-

Max Parallel Downloads

-

Set maximum number of allowed parallel downloads

- saveSettingsKey('max_parallel_downloads', value[0])} - /> - -
-
-

Prefer Video Over Playlist

-

Prefer only the video, if the URL refers to a video and a playlist

- saveSettingsKey('prefer_video_over_playlist', checked)} - /> -
-
-

Proxy

-

Use proxy for downloads, Unblocks blocked sites in your region (Download speed may affect, Some sites may not work)

-
- saveSettingsKey('use_proxy', checked)} - /> - -
-
-
- - ( - - - - - - - - )} - /> + + + General + Appearance + Folders + Network + +
+ +
+

Max Parallel Downloads

+

Set maximum number of allowed parallel downloads

+ saveSettingsKey('max_parallel_downloads', value[0])} + /> + +
+
+

Prefer Video Over Playlist

+

Prefer only the video, if the URL refers to a video and a playlist

+ saveSettingsKey('prefer_video_over_playlist', checked)} + /> +
+
+ +
+

Theme

+

Choose app interface theme

+
+ {themeOptions.map(({ value, icon: Icon, label }) => ( + + ))} +
+
+
+ +
+

Download Folder

+

Set default download folder (directory)

+
+ - - -
+
+
+ + +
+

Proxy

+

Use proxy for downloads, Unblocks blocked sites in your region (Download speed may affect, Some sites may not work)

+
+ saveSettingsKey('use_proxy', checked)} + /> + +
+
+
+ + ( + + + + + + + + )} + /> + + + +
+
+
-
+ @@ -389,81 +454,66 @@ export default function SettingsPage() {
-
-
-

Websocket Port

-

Change extension websocket server port

-
-
- - ( - - - - - - - - )} - /> - - - -
+ + + General + +
+ +
+

Websocket Port

+

Change extension websocket server port

+
+
+ + ( + + + + + + + + )} + /> + + + +
+
+
-
+ -
-

Reset Settings

-

Reset all setting to default

- - - - - - - Are you absolutely sure? - - This action cannot be undone! it will permanently reset all settings to default. - - - - Cancel - resetSettings() - }>Reset - - - -
) }