From 544b60f88104233496e7ffcee01c0cbf7a313449 Mon Sep 17 00:00:00 2001 From: Arunavo Ray Date: Thu, 12 Jun 2025 15:29:47 +0530 Subject: [PATCH] refactor: update Card components to use self-start class for consistent alignment --- src/components/config/AdvancedOptionsForm.tsx | 2 +- src/components/config/ConfigTabs.tsx | 246 +++++++++--------- .../config/DatabaseCleanupConfigForm.tsx | 2 +- src/components/config/GitHubConfigForm.tsx | 2 +- src/components/config/GiteaConfigForm.tsx | 2 +- src/components/config/MirrorOptionsForm.tsx | 2 +- src/components/config/ScheduleConfigForm.tsx | 2 +- 7 files changed, 131 insertions(+), 127 deletions(-) diff --git a/src/components/config/AdvancedOptionsForm.tsx b/src/components/config/AdvancedOptionsForm.tsx index 76abfc8..0d63eba 100644 --- a/src/components/config/AdvancedOptionsForm.tsx +++ b/src/components/config/AdvancedOptionsForm.tsx @@ -32,7 +32,7 @@ export function AdvancedOptionsForm({ }; return ( - + Advanced Options diff --git a/src/components/config/ConfigTabs.tsx b/src/components/config/ConfigTabs.tsx index 5929c60..251dce5 100644 --- a/src/components/config/ConfigTabs.tsx +++ b/src/components/config/ConfigTabs.tsx @@ -5,7 +5,7 @@ import { ScheduleConfigForm } from './ScheduleConfigForm'; import { DatabaseCleanupConfigForm } from './DatabaseCleanupConfigForm'; import { MirrorOptionsForm } from './MirrorOptionsForm'; import { AdvancedOptionsForm } from './AdvancedOptionsForm'; -import { Tabs, TabsContent, TabsList, TabsTrigger } from '../ui/tabs'; +// Removed Tabs import as we're switching to grid layout import type { ConfigApiResponse, GiteaConfig, @@ -537,51 +537,66 @@ export function ConfigTabs() {
-
- {/* Content section */} -
-
-
-
- - -
-
- - - -
+ {/* Content section - Grid layout */} +
+ {/* GitHub & Gitea connections */} +
+
+ +
-
-
- - -
-
- - - - -
+
+ + +
-
-
-
- - - -
+
+
+ +
-
-
- - - -
+
+ + + + +
+
+ + {/* Schedule & Database Cleanup */} +
+
+ + + +
+
+
+
+ + + +
+
+
+ + {/* Mirror Options & Advanced - Full width sections */} +
+
+ +
+ + +
+
+
+ +
+
@@ -633,49 +648,42 @@ export function ConfigTabs() {
- {/* Content section */} - - - Connections - Mirror Options - Schedule & Cleanup - Advanced - + {/* Content section - Grid layout */} +
+ {/* GitHub & Gitea connections - Side by side */} +
+ + setConfig(prev => ({ + ...prev, + githubConfig: + typeof update === 'function' + ? update(prev.githubConfig) + : update, + })) + } + onAutoSave={autoSaveGitHubConfig} + isAutoSaving={isAutoSavingGitHub} + /> + + setConfig(prev => ({ + ...prev, + giteaConfig: + typeof update === 'function' + ? update(prev.giteaConfig) + : update, + })) + } + onAutoSave={autoSaveGiteaConfig} + isAutoSaving={isAutoSavingGitea} + /> +
- -
- - setConfig(prev => ({ - ...prev, - githubConfig: - typeof update === 'function' - ? update(prev.githubConfig) - : update, - })) - } - onAutoSave={autoSaveGitHubConfig} - isAutoSaving={isAutoSavingGitHub} - /> - - setConfig(prev => ({ - ...prev, - giteaConfig: - typeof update === 'function' - ? update(prev.giteaConfig) - : update, - })) - } - onAutoSave={autoSaveGiteaConfig} - isAutoSaving={isAutoSavingGitea} - /> -
-
- - + {/* Mirror Options - Full width */} +
@@ -690,46 +698,42 @@ export function ConfigTabs() { onAutoSave={autoSaveMirrorOptions} isAutoSaving={isAutoSavingMirrorOptions} /> - +
- -
-
- - setConfig(prev => ({ - ...prev, - scheduleConfig: - typeof update === 'function' - ? update(prev.scheduleConfig) - : update, - })) - } - onAutoSave={autoSaveScheduleConfig} - isAutoSaving={isAutoSavingSchedule} - /> -
-
- - setConfig(prev => ({ - ...prev, - cleanupConfig: - typeof update === 'function' - ? update(prev.cleanupConfig) - : update, - })) - } - onAutoSave={autoSaveCleanupConfig} - isAutoSaving={isAutoSavingCleanup} - /> -
-
-
+ {/* Schedule & Database Cleanup - Side by side */} +
+ + setConfig(prev => ({ + ...prev, + scheduleConfig: + typeof update === 'function' + ? update(prev.scheduleConfig) + : update, + })) + } + onAutoSave={autoSaveScheduleConfig} + isAutoSaving={isAutoSavingSchedule} + /> + + setConfig(prev => ({ + ...prev, + cleanupConfig: + typeof update === 'function' + ? update(prev.cleanupConfig) + : update, + })) + } + onAutoSave={autoSaveCleanupConfig} + isAutoSaving={isAutoSavingCleanup} + /> +
- + {/* Advanced options - Full width */} +
@@ -744,8 +748,8 @@ export function ConfigTabs() { onAutoSave={autoSaveAdvancedOptions} isAutoSaving={isAutoSavingAdvancedOptions} /> - - +
+
); } diff --git a/src/components/config/DatabaseCleanupConfigForm.tsx b/src/components/config/DatabaseCleanupConfigForm.tsx index c77382f..ab2d113 100644 --- a/src/components/config/DatabaseCleanupConfigForm.tsx +++ b/src/components/config/DatabaseCleanupConfigForm.tsx @@ -94,7 +94,7 @@ export function DatabaseCleanupConfigForm({ ]; return ( - + {isAutoSaving && (
diff --git a/src/components/config/GitHubConfigForm.tsx b/src/components/config/GitHubConfigForm.tsx index 7c820a4..3671d74 100644 --- a/src/components/config/GitHubConfigForm.tsx +++ b/src/components/config/GitHubConfigForm.tsx @@ -68,7 +68,7 @@ export function GitHubConfigForm({ config, setConfig, onAutoSave, isAutoSaving } }; return ( - + GitHub Configuration diff --git a/src/components/config/GiteaConfigForm.tsx b/src/components/config/GiteaConfigForm.tsx index 0f85fa7..a5b0be5 100644 --- a/src/components/config/GiteaConfigForm.tsx +++ b/src/components/config/GiteaConfigForm.tsx @@ -91,7 +91,7 @@ export function GiteaConfigForm({ config, setConfig, onAutoSave, isAutoSaving }: }; return ( - + Gitea Configuration diff --git a/src/components/config/MirrorOptionsForm.tsx b/src/components/config/MirrorOptionsForm.tsx index ed0cd8c..8fb01b2 100644 --- a/src/components/config/MirrorOptionsForm.tsx +++ b/src/components/config/MirrorOptionsForm.tsx @@ -55,7 +55,7 @@ export function MirrorOptionsForm({ }; return ( - + Mirror Options diff --git a/src/components/config/ScheduleConfigForm.tsx b/src/components/config/ScheduleConfigForm.tsx index dd8da0e..862c18e 100644 --- a/src/components/config/ScheduleConfigForm.tsx +++ b/src/components/config/ScheduleConfigForm.tsx @@ -54,7 +54,7 @@ export function ScheduleConfigForm({ ]; return ( - + {isAutoSaving && (