refactor: cleanup

This commit is contained in:
zhom
2026-03-13 10:19:34 +04:00
parent 756bd69a84
commit e9b5442340
53 changed files with 1930 additions and 2096 deletions
-5
View File
@@ -15,11 +15,6 @@ import {
*/
export function getBrowserDisplayName(browserType: string): string {
const browserNames: Record<string, string> = {
firefox: "Firefox",
"firefox-developer": "Firefox Developer Edition",
zen: "Zen Browser",
brave: "Brave",
chromium: "Chromium",
camoufox: "Camoufox",
wayfern: "Wayfern",
};
+48
View File
@@ -15,6 +15,10 @@ export interface ThemeColors extends Record<string, string> {
"--accent-foreground": string;
"--destructive": string;
"--destructive-foreground": string;
"--success": string;
"--success-foreground": string;
"--warning": string;
"--warning-foreground": string;
"--border": string;
"--chart-1": string;
"--chart-2": string;
@@ -50,6 +54,10 @@ export const THEMES: Theme[] = [
"--accent-foreground": "#1a1b26",
"--destructive": "#f7768e",
"--destructive-foreground": "#1a1b26",
"--success": "#9ece6a",
"--success-foreground": "#1a1b26",
"--warning": "#e0af68",
"--warning-foreground": "#1a1b26",
"--border": "#3b4261",
"--chart-1": "#7aa2f7",
"--chart-2": "#9ece6a",
@@ -78,6 +86,10 @@ export const THEMES: Theme[] = [
"--accent-foreground": "#282a36",
"--destructive": "#ff5555",
"--destructive-foreground": "#f8f8f2",
"--success": "#50fa7b",
"--success-foreground": "#282a36",
"--warning": "#ffb86c",
"--warning-foreground": "#282a36",
"--border": "#6272a4",
"--chart-1": "#bd93f9",
"--chart-2": "#50fa7b",
@@ -106,6 +118,10 @@ export const THEMES: Theme[] = [
"--accent-foreground": "#273136",
"--destructive": "#ff819f",
"--destructive-foreground": "#273136",
"--success": "#a8c97f",
"--success-foreground": "#273136",
"--warning": "#e6c07b",
"--warning-foreground": "#273136",
"--border": "#304e37",
"--chart-1": "#7eb08a",
"--chart-2": "#d2b48c",
@@ -134,6 +150,10 @@ export const THEMES: Theme[] = [
"--accent-foreground": "#f7f7f8",
"--destructive": "#ef4444",
"--destructive-foreground": "#f7f7f8",
"--success": "#22c55e",
"--success-foreground": "#17191e",
"--warning": "#f59e0b",
"--warning-foreground": "#17191e",
"--border": "#2a2e39",
"--chart-1": "#5755d9",
"--chart-2": "#0ea5e9",
@@ -162,6 +182,10 @@ export const THEMES: Theme[] = [
"--accent-foreground": "#0a0e14",
"--destructive": "#f07178",
"--destructive-foreground": "#b3b1ad",
"--success": "#c2d94c",
"--success-foreground": "#0a0e14",
"--warning": "#ffb454",
"--warning-foreground": "#0a0e14",
"--border": "#1f2430",
"--chart-1": "#39bae6",
"--chart-2": "#c2d94c",
@@ -190,6 +214,10 @@ export const THEMES: Theme[] = [
"--accent-foreground": "#fafafa",
"--destructive": "#f07178",
"--destructive-foreground": "#fafafa",
"--success": "#86b300",
"--success-foreground": "#fafafa",
"--warning": "#fa8d3e",
"--warning-foreground": "#fafafa",
"--border": "#e7eaed",
"--chart-1": "#399ee6",
"--chart-2": "#86b300",
@@ -218,6 +246,10 @@ export const THEMES: Theme[] = [
"--accent-foreground": "#eff1f5",
"--destructive": "#d20f39",
"--destructive-foreground": "#eff1f5",
"--success": "#40a02b",
"--success-foreground": "#eff1f5",
"--warning": "#df8e1d",
"--warning-foreground": "#eff1f5",
"--border": "#9ca0b0",
"--chart-1": "#1e66f5",
"--chart-2": "#40a02b",
@@ -246,6 +278,10 @@ export const THEMES: Theme[] = [
"--accent-foreground": "#303446",
"--destructive": "#e78284",
"--destructive-foreground": "#303446",
"--success": "#a6d189",
"--success-foreground": "#303446",
"--warning": "#e5c890",
"--warning-foreground": "#303446",
"--border": "#737994",
"--chart-1": "#8caaee",
"--chart-2": "#a6d189",
@@ -274,6 +310,10 @@ export const THEMES: Theme[] = [
"--accent-foreground": "#24273a",
"--destructive": "#ed8796",
"--destructive-foreground": "#24273a",
"--success": "#a6da95",
"--success-foreground": "#24273a",
"--warning": "#eed49f",
"--warning-foreground": "#24273a",
"--border": "#6e738d",
"--chart-1": "#8aadf4",
"--chart-2": "#a6da95",
@@ -302,6 +342,10 @@ export const THEMES: Theme[] = [
"--accent-foreground": "#1e1e2e",
"--destructive": "#f38ba8",
"--destructive-foreground": "#1e1e2e",
"--success": "#a6e3a1",
"--success-foreground": "#1e1e2e",
"--warning": "#f9e2af",
"--warning-foreground": "#1e1e2e",
"--border": "#585b70",
"--chart-1": "#89b4fa",
"--chart-2": "#a6e3a1",
@@ -330,6 +374,10 @@ export const THEME_VARIABLES: Array<{ key: keyof ThemeColors; label: string }> =
{ key: "--accent-foreground", label: "Accent FG" },
{ key: "--destructive", label: "Destructive" },
{ key: "--destructive-foreground", label: "Destructive FG" },
{ key: "--success", label: "Success" },
{ key: "--success-foreground", label: "Success FG" },
{ key: "--warning", label: "Warning" },
{ key: "--warning-foreground", label: "Warning FG" },
{ key: "--border", label: "Border" },
{ key: "--chart-1", label: "Chart 1" },
{ key: "--chart-2", label: "Chart 2" },
+2 -5
View File
@@ -82,13 +82,10 @@ export function showToast(props: ToastProps & { id?: string }) {
duration = 10000;
break;
case "download":
// Only keep infinite for active downloading, others get shorter durations
if ("stage" in props && props.stage === "downloading") {
duration = Number.POSITIVE_INFINITY;
} else if ("stage" in props && props.stage === "completed") {
if ("stage" in props && props.stage === "completed") {
duration = 3000;
} else {
duration = 20000;
duration = Number.POSITIVE_INFINITY;
}
break;
case "success":