From a1da82a7188f172a7b4fe5ca56744f7530656108 Mon Sep 17 00:00:00 2001 From: Arunavo Ray Date: Sat, 24 May 2025 10:53:33 +0530 Subject: [PATCH] refactor: simplify ConfigCardSkeleton structure and enhance layout in ConfigTabs component --- src/components/config/ConfigTabs.tsx | 261 +++++++++++++-------------- 1 file changed, 128 insertions(+), 133 deletions(-) diff --git a/src/components/config/ConfigTabs.tsx b/src/components/config/ConfigTabs.tsx index 15c7584..3ec3094 100644 --- a/src/components/config/ConfigTabs.tsx +++ b/src/components/config/ConfigTabs.tsx @@ -1,11 +1,4 @@ import { useEffect, useState } from 'react'; -import { - Card, - CardContent, - CardDescription, - CardHeader, - CardTitle, -} from '@/components/ui/card'; import { GitHubConfigForm } from './GitHubConfigForm'; import { GiteaConfigForm } from './GiteaConfigForm'; import { ScheduleConfigForm } from './ScheduleConfigForm'; @@ -192,152 +185,154 @@ export function ConfigTabs() { function ConfigCardSkeleton() { return ( - - -
- +
+ {/* Header section */} +
+
+
- - -
-
-
-
- - -
-
- - - -
+
+ + {/* Content section */} +
+
+
+
+ +
-
-
- - -
-
- - - - -
+
+ + +
-
+
+
+ + +
- - - + + + +
- - +
+
+ + + +
+
+
+
); } return isLoading ? ( -
+
) : ( -
- - -
- Configuration Settings - - Configure your GitHub and Gitea connections, and set up automatic - mirroring. - -
-
- - -
-
- -
-
- - setConfig(prev => ({ - ...prev, - githubConfig: - typeof update === 'function' - ? update(prev.githubConfig) - : update, - })) - } - /> - - setConfig(prev => ({ - ...prev, - giteaConfig: - typeof update === 'function' - ? update(prev.giteaConfig) - : update, - })) - } - /> -
- - setConfig(prev => ({ - ...prev, - scheduleConfig: - typeof update === 'function' - ? update(prev.scheduleConfig) - : update, - })) - } - /> -
-
-
+
+ {/* Header section */} +
+
+

+ Configuration Settings +

+

+ Configure your GitHub and Gitea connections, and set up automatic + mirroring. +

+
+
+ + +
+
+ + {/* Content section */} +
+
+ + setConfig(prev => ({ + ...prev, + githubConfig: + typeof update === 'function' + ? update(prev.githubConfig) + : update, + })) + } + /> + + setConfig(prev => ({ + ...prev, + giteaConfig: + typeof update === 'function' + ? update(prev.giteaConfig) + : update, + })) + } + /> +
+ + setConfig(prev => ({ + ...prev, + scheduleConfig: + typeof update === 'function' + ? update(prev.scheduleConfig) + : update, + })) + } + /> +
); }