- {isMobile && (
-
-
-
-
-
- {t('deploySettings')}
-
-
- {t('deploySettingsDescription')}
-
-
-
- )}
-
- {!isMobile && (
-
-
-
- {t('deploySettings')}
-
-
- {t('deploySettingsDescription')}
-
-
- )}
-
+
{!isInitialized ? (
-
+ <>
{/* Loading skeleton for configured providers */}
@@ -730,9 +697,9 @@ export function DeploySettings() {
-
+ >
) : (
-
+ <>
{/* Configured Providers */}
{settings.providers.length > 0 && (
@@ -1180,9 +1147,9 @@ export function DeploySettings() {
-
+ >
)}
-
+
);
}
diff --git a/src/pages/GitSettings.tsx b/src/pages/GitSettings.tsx
index a83813cd..9e1bb4fe 100644
--- a/src/pages/GitSettings.tsx
+++ b/src/pages/GitSettings.tsx
@@ -1,6 +1,6 @@
import { useState } from 'react';
import { useTranslation } from 'react-i18next';
-import { Check, GitBranch, ArrowLeft, Trash2, ChevronDown, Plus, User, GripVertical } from 'lucide-react';
+import { Check, GitBranch, Trash2, ChevronDown, Plus, User, GripVertical } from 'lucide-react';
import {
DndContext,
closestCenter,
@@ -36,8 +36,7 @@ import {
} from '@/components/ui/dropdown-menu';
import { useGitSettings } from '@/hooks/useGitSettings';
import { useGitHubOAuth } from '@/hooks/useGitHubOAuth';
-import { useIsMobile } from '@/hooks/useIsMobile';
-import { useNavigate } from 'react-router-dom';
+import { SettingsPageLayout } from '@/components/SettingsPageLayout';
import type { GitCredential } from '@/contexts/GitSettingsContext';
import { PasswordInput } from '@/components/ui/password-input';
import { ExternalInput } from '@/components/ui/external-input';
@@ -192,8 +191,6 @@ export function GitSettings() {
const { t } = useTranslation();
const { settings, addCredential, removeCredential, setCredentials, updateSettings, isInitialized } = useGitSettings();
const { initiateOAuth, isLoading: isOAuthLoading, error: oauthError, isOAuthConfigured } = useGitHubOAuth();
- const isMobile = useIsMobile();
- const navigate = useNavigate();
const [customName, setCustomName] = useState('');
const [customOrigin, setCustomOrigin] = useState('');
const [customUsername, setCustomUsername] = useState('');
@@ -283,44 +280,13 @@ export function GitSettings() {
const availablePresets = PRESET_PROVIDERS.filter(preset => !configuredOrigins.includes(preset.origin));
return (
-
- {isMobile && (
-
-
-
-
-
- {t('gitSettings')}
-
-
- {t('gitSettingsDescription')}
-
-
-
- )}
-
- {!isMobile && (
-
-
-
- {t('gitSettings')}
-
-
- {t('gitSettingsDescription')}
-
-
- )}
-
+
{!isInitialized ? (
-
+ <>
{/* Loading skeleton for configured credentials */}
@@ -348,9 +314,9 @@ export function GitSettings() {
-
+ >
) : (
-
+ <>
{/* Configured Credentials */}
{settings.credentials.length > 0 && (
@@ -645,9 +611,9 @@ export function GitSettings() {
-
+ >
)}
-
+
);
}
diff --git a/src/pages/NostrSettings.tsx b/src/pages/NostrSettings.tsx
index 8950793b..c038a76c 100644
--- a/src/pages/NostrSettings.tsx
+++ b/src/pages/NostrSettings.tsx
@@ -1,6 +1,7 @@
-import { ArrowLeft, Wifi, Users, UserPlus, LogOut, Trash2, User, Plus, Server, Key } from 'lucide-react';
+import { Wifi, Users, UserPlus, LogOut, Trash2, User, Plus, Server, Key } from 'lucide-react';
import { useTranslation } from 'react-i18next';
import { Button } from '@/components/ui/button';
+import { SettingsPageLayout } from '@/components/SettingsPageLayout';
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';
import { Skeleton } from '@/components/ui/skeleton';
import { Separator } from '@/components/ui/separator';
@@ -8,8 +9,6 @@ import { RelayListManager } from '@/components/RelayListManager';
import { GraspListManager } from '@/components/GraspListManager';
import SimpleLoginDialog from '@/components/auth/SimpleLoginDialog';
import SimpleSignupDialog from '@/components/auth/SimpleSignupDialog';
-import { useIsMobile } from '@/hooks/useIsMobile';
-import { useNavigate } from 'react-router-dom';
import { useLoggedInAccounts, type Account } from '@/hooks/useLoggedInAccounts';
import { genUserName } from '@/lib/genUserName';
import { useState } from 'react';
@@ -22,8 +21,6 @@ const sanitizeFilename = (filename: string) => {
export function NostrSettings() {
const { t } = useTranslation();
- const isMobile = useIsMobile();
- const navigate = useNavigate();
const { authors, currentUser, setLogin, removeLogin, isLoading } = useLoggedInAccounts();
const [showLoginDialog, setShowLoginDialog] = useState(false);
const [showSignupDialog, setShowSignupDialog] = useState(false);
@@ -104,43 +101,13 @@ export function NostrSettings() {
};
return (
-
- {isMobile && (
-
-
-
-
-
- {t('nostrSettings')}
-
-
- {t('nostrSettingsDescription')}
-
-
-
- )}
-
- {!isMobile && (
-
-
-
- {t('nostrSettings')}
-
-
- {t('nostrSettingsDescription')}
-
-
- )}
-
-
+ <>
+
{/* Account Management */}
@@ -281,7 +248,7 @@ export function NostrSettings() {
-
+
{/* Login Dialog */}
-
+ >
);
}
diff --git a/src/pages/Preferences.tsx b/src/pages/Preferences.tsx
index 7e4935fb..c18d6107 100644
--- a/src/pages/Preferences.tsx
+++ b/src/pages/Preferences.tsx
@@ -1,57 +1,23 @@
-import { Settings2, ArrowLeft } from "lucide-react";
+import { Settings2 } from "lucide-react";
import { useTranslation } from 'react-i18next';
-import { Button } from "@/components/ui/button";
+import { SettingsPageLayout } from '@/components/SettingsPageLayout';
import { Card, CardContent } from "@/components/ui/card";
import { ThemePicker } from "@/components/ThemePicker";
import { LanguagePicker } from "@/components/LanguagePicker";
import { Switch } from "@/components/ui/switch";
import { Label } from "@/components/ui/label";
-import { useIsMobile } from "@/hooks/useIsMobile";
-import { useNavigate } from "react-router-dom";
import { useAppContext } from "@/hooks/useAppContext";
export function Preferences() {
const { t } = useTranslation();
- const isMobile = useIsMobile();
- const navigate = useNavigate();
const { config, updateConfig } = useAppContext();
return (
-
- {isMobile && (
-
-
-
-
-
- {t('preferences')}
-
-
- {t('preferencesDescription')}
-
-
-
- )}
-
- {!isMobile && (
-
-
-
- {t('preferences')}
-
-
- {t('preferencesDescription')}
-
-
- )}
+
@@ -101,7 +67,7 @@ export function Preferences() {
-
+
);
}
diff --git a/src/pages/StorageSettings.tsx b/src/pages/StorageSettings.tsx
index 2e94c6a6..d2be2b2e 100644
--- a/src/pages/StorageSettings.tsx
+++ b/src/pages/StorageSettings.tsx
@@ -1,15 +1,15 @@
import { useState, useEffect } from 'react';
import { useNavigate } from 'react-router-dom';
import { useTranslation } from 'react-i18next';
-import { Download, Trash2, AlertTriangle, Loader2, Database, Info, ArrowLeft, Shield } from 'lucide-react';
+import { Download, Trash2, AlertTriangle, Loader2, Database, Info, Shield } from 'lucide-react';
import { Button } from '@/components/ui/button';
+import { SettingsPageLayout } from '@/components/SettingsPageLayout';
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger } from '@/components/ui/alert-dialog';
import { Progress } from '@/components/ui/progress';
import { Switch } from '@/components/ui/switch';
import { useToast } from '@/hooks/useToast';
import { useFS } from '@/hooks/useFS';
-import { useIsMobile } from '@/hooks/useIsMobile';
import { useOffline } from '@/hooks/useOffline';
import {
isPersistentStorageSupported,
@@ -42,9 +42,8 @@ export function StorageSettings() {
const [isPersistent, setIsPersistent] = useState
(null);
const { toast } = useToast();
const { fs } = useFS();
- const navigate = useNavigate();
- const isMobile = useIsMobile();
const { clearCache } = useOffline();
+ const navigate = useNavigate();
// Format bytes to human readable format
const formatBytes = (bytes: number): string => {
@@ -270,201 +269,169 @@ export function StorageSettings() {
};
return (
-
- {isMobile && (
-
-
+
+ {/* Storage Information */}
+ {storageError ? (
+
+
+ {storageError}
+
+ ) : storageInfo ? (
+
+ {/* Usage Progress */}
-
-
- {t('storageSettings')}
-
-
- {t('storageSettingsDescription')}
-
+
+ {t('used')}: {formatBytes(storageInfo.usage)}
+ {t('available')}: {formatBytes(storageInfo.quota)}
+
+
+
+
+ ) : (
+
+
+ {t('loadingStorageInfo')}
)}
- {!isMobile && (
-
-
-
- {t('storageSettings')}
-
-
- {t('storageSettingsDescription')}
-
-
- )}
-
-
- {/* Storage Information */}
- {storageError ? (
-
-
-
{storageError}
+ {/* Persist Data */}
+
+
+
+
+ {t('persistData')}
+
+
+ {t('persistDataDescription')}
+
+
+
+
+
- ) : storageInfo ? (
-
- {/* Usage Progress */}
-
-
- {t('used')}: {formatBytes(storageInfo.usage)}
- {t('available')}: {formatBytes(storageInfo.quota)}
-
-
+
+
-
- ) : (
-
-
- {t('loadingStorageInfo')}
-
- )}
+ {/* Export Files */}
+
+
+
+
+ {t('exportFiles')}
+
+
+ {t('exportFilesDescription')}
+
+
+
+
+
+
- {/* Persist Data */}
-
-
-
-
- {t('persistData')}
-
-
- {t('persistDataDescription')}
-
-
-
-
-
-
-
-
-
- {/* Export Files */}
-
-
-
-
- {t('exportFiles')}
-
-
- {t('exportFilesDescription')}
-
-
-
-
-
-
-
- {/* Clear All Data */}
-
-
-
-
- {t('clearAllData')}
-
-
- {t('clearAllDataDescription')}
-
-
-
-
-
-
-
-
-
-
-
- {t('areYouSure')}
-
-
-
- {t('clearDataWarning')}
-
-
- - {t('allProjects')}
- - {t('aiSettingsAndKeys')}
- - {t('gitCredentialsSettings')}
- - {t('userPreferences')}
- - {t('cachedData')}
-
-
- {t('actionCannotBeUndone')}
-
-
-
-
- {t('cancel')}
-
- {t('yesClearAllData')}
-
-
-
-
-
-
-
-
+ {t('yesClearAllData')}
+
+
+
+
+
+
+
);
}
diff --git a/src/pages/SystemSettings.tsx b/src/pages/SystemSettings.tsx
index d14e7439..b064c9dd 100644
--- a/src/pages/SystemSettings.tsx
+++ b/src/pages/SystemSettings.tsx
@@ -1,13 +1,12 @@
-import { Settings, ArrowLeft, RefreshCw, Trash2, XCircle, Loader2, RotateCcw, Cog, Globe, Image, Code, Monitor, Award, Bug, FolderTree, Terminal as TerminalIcon, GitBranch } from "lucide-react";
+import { Settings, RefreshCw, Trash2, XCircle, Loader2, RotateCcw, Cog, Globe, Image, Code, Monitor, Award, Bug, FolderTree, Terminal as TerminalIcon, GitBranch } from "lucide-react";
import { useTranslation } from 'react-i18next';
import { useState, useEffect, useMemo } from "react";
import { Button } from "@/components/ui/button";
+import { SettingsPageLayout } from '@/components/SettingsPageLayout';
import { Input } from "@/components/ui/input";
import { Switch } from "@/components/ui/switch";
import { Label } from "@/components/ui/label";
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '@/components/ui/accordion';
-import { useIsMobile } from "@/hooks/useIsMobile";
-import { useNavigate } from "react-router-dom";
import { useAppContext } from "@/hooks/useAppContext";
import { useOffline } from "@/hooks/useOffline";
import { useToast } from "@/hooks/useToast";
@@ -15,8 +14,6 @@ import { Terminal } from "@/components/Terminal";
export function SystemSettings() {
const { t } = useTranslation();
- const isMobile = useIsMobile();
- const navigate = useNavigate();
const { config, defaultConfig, updateConfig } = useAppContext();
const { toast } = useToast();
const { serviceWorkerRegistration, updateServiceWorker, clearCache } = useOffline();
@@ -256,41 +253,11 @@ export function SystemSettings() {
};
return (
-
- {isMobile && (
-
-
navigate('/settings')}
- className="h-8 w-auto px-2 -ml-2"
- >
-
- {t('backToSettings')}
-
-
-
-
- {t('systemSettings')}
-
-
- {t('systemSettingsDescription')}
-
-
-
- )}
-
- {!isMobile && (
-
-
-
- {t('systemSettings')}
-
-
- {t('systemSettingsDescription')}
-
-
- )}
+
{/* Service Worker Configuration */}
@@ -1029,7 +996,7 @@ export function SystemSettings() {
-
+
);
}