diff --git a/src/components/SettingsPageLayout.tsx b/src/components/SettingsPageLayout.tsx index 8789b890..683a2be6 100644 --- a/src/components/SettingsPageLayout.tsx +++ b/src/components/SettingsPageLayout.tsx @@ -4,6 +4,7 @@ import { Button } from '@/components/ui/button'; import { useIsMobile } from '@/hooks/useIsMobile'; import { useNavigate } from 'react-router-dom'; import type { ReactNode } from 'react'; +import { cn } from '@/lib/utils'; interface SettingsPageLayoutProps { /** The icon component to display next to the title */ @@ -27,7 +28,7 @@ export function SettingsPageLayout({ titleKey, descriptionKey, children, - className = 'space-y-6', + className, }: SettingsPageLayoutProps) { const { t } = useTranslation(); const isMobile = useIsMobile(); @@ -70,7 +71,7 @@ export function SettingsPageLayout({ )} -
+
{children}
diff --git a/src/pages/AboutSettings.tsx b/src/pages/AboutSettings.tsx index f8f5efa3..08f1a3a3 100644 --- a/src/pages/AboutSettings.tsx +++ b/src/pages/AboutSettings.tsx @@ -46,114 +46,112 @@ export function AboutSettings() { descriptionKey="aboutShakespeareDescription" > -
- {/* Email Updates */} - + {/* Email Updates */} + -
- {/* Mirrors */} - - - -
- - {t('mirrors')} +
+ {/* Mirrors */} + + + +
+ + {t('mirrors')} +
+
+ +

{t('mirrorsDescription')}

+ +
+
+
+ + {/* Project Information */} + + + + + + + {/* License */} + + + +
+ + {t('license')} +
+
+ + {isLoading ? ( +
+ + {t('loadingLicense')}
- - -

{t('mirrorsDescription')}

- -
-
-
- - {/* Project Information */} - - - - - - - {/* License */} - - - -
- - {t('license')} -
-
- - {isLoading ? ( -
- - {t('loadingLicense')} -
- ) : error ? ( - - - - {t('failedToLoadLicense')}: {error} - - - ) : license ? ( -
- ) : null} - - - -
- - {import.meta.env.VERSION && ( -
- v{import.meta.env.VERSION} -
- )} + ) : error ? ( + + + + {t('failedToLoadLicense')}: {error} + + + ) : license ? ( +
+ ) : null} + + +
+ + {import.meta.env.VERSION && ( +
+ v{import.meta.env.VERSION} +
+ )} ); } diff --git a/src/pages/NostrSettings.tsx b/src/pages/NostrSettings.tsx index c038a76c..517ccc03 100644 --- a/src/pages/NostrSettings.tsx +++ b/src/pages/NostrSettings.tsx @@ -106,7 +106,6 @@ export function NostrSettings() { icon={Wifi} titleKey="nostrSettings" descriptionKey="nostrSettingsDescription" - className="space-y-6 max-w-xl" > {/* Account Management */}
diff --git a/src/pages/SystemSettings.tsx b/src/pages/SystemSettings.tsx index b064c9dd..11605b7c 100644 --- a/src/pages/SystemSettings.tsx +++ b/src/pages/SystemSettings.tsx @@ -258,346 +258,438 @@ export function SystemSettings() { titleKey="systemSettings" descriptionKey="systemSettingsDescription" > - -
- {/* Service Worker Configuration */} - - - -
- -

{t('serviceWorker')}

-
-
- -
- {serviceWorkerRegistration ? ( - <> - {/* Service Worker Status */} -
-
-
- {t('serviceWorkerStatus')} - {swState || 'Unknown'} -
-
- {t('serviceWorkerScope')} - {serviceWorkerRegistration.scope} -
- {serviceWorkerRegistration.active && ( -
- {t('serviceWorkerScriptUrl')} - - {serviceWorkerRegistration.active.scriptURL.split('/').pop()} - -
- )} + {/* Service Worker Configuration */} + + + +
+ +

{t('serviceWorker')}

+
+
+ +
+ {serviceWorkerRegistration ? ( + <> + {/* Service Worker Status */} +
+
+
+ {t('serviceWorkerStatus')} + {swState || 'Unknown'}
+
+ {t('serviceWorkerScope')} + {serviceWorkerRegistration.scope} +
+ {serviceWorkerRegistration.active && ( +
+ {t('serviceWorkerScriptUrl')} + + {serviceWorkerRegistration.active.scriptURL.split('/').pop()} + +
+ )}
- - {/* Service Worker Controls */} -
- - - -
- - ) : ( -
- {t('serviceWorkerNotRegistered')}
- )} -
- - - - {/* CORS Proxy Configuration */} - - - -
- -

{t('corsProxy')}

+ {/* Service Worker Controls */} +
+ + + +
+ + ) : ( +
+ {t('serviceWorkerNotRegistered')} +
+ )} +
+ +
+
+ + {/* CORS Proxy Configuration */} + + + +
+ +

{t('corsProxy')}

+ {isModified.corsProxy && ( +
+ )} +
+ + +
+
+ { + const value = e.target.value; + setCorsProxyInput(value); + updateConfig((current) => ({ + ...current, + corsProxy: value, + })); + }} + className="flex-1" + /> {isModified.corsProxy && ( -
+ )}
- - -
-
- { - const value = e.target.value; - setCorsProxyInput(value); - updateConfig((current) => ({ - ...current, - corsProxy: value, - })); - }} - className="flex-1" - /> - {isModified.corsProxy && ( - - )} -
-

- {t('corsProxyDescription')} -

-
-
- - +

+ {t('corsProxyDescription')} +

+
+ + + - {/* Favicon URL Configuration */} - - - -
- -

{t('faviconUrl')}

+ {/* Favicon URL Configuration */} + + + +
+ +

{t('faviconUrl')}

+ {isModified.faviconUrl && ( +
+ )} +
+ + +
+
+ { + const value = e.target.value; + setFaviconUrlInput(value); + updateConfig((current) => ({ + ...current, + faviconUrl: value, + })); + }} + className="flex-1" + /> {isModified.faviconUrl && ( -
+ )}
- - -
-
- { - const value = e.target.value; - setFaviconUrlInput(value); - updateConfig((current) => ({ - ...current, - faviconUrl: value, - })); - }} - className="flex-1" - /> - {isModified.faviconUrl && ( - - )} -
-

- {t('faviconUrlDescription')} -

-
-
- - +

+ {t('faviconUrlDescription')} +

+
+ + + - {/* Nostr Git Web URL Configuration */} - - - -
- -

{t('ngitWebUrl')}

+ {/* Nostr Git Web URL Configuration */} + + + +
+ +

{t('ngitWebUrl')}

+ {isModified.ngitWebUrl && ( +
+ )} +
+ + +
+
+ { + const value = e.target.value; + setNgitWebUrlInput(value); + updateConfig((current) => ({ + ...current, + ngitWebUrl: value, + })); + }} + className="flex-1" + /> {isModified.ngitWebUrl && ( -
+ )}
- - -
-
- { - const value = e.target.value; - setNgitWebUrlInput(value); - updateConfig((current) => ({ - ...current, - ngitWebUrl: value, - })); - }} - className="flex-1" - /> - {isModified.ngitWebUrl && ( - - )} -
-

- {t('ngitWebUrlDescription')} -

-
-
- - +

+ {t('ngitWebUrlDescription')} +

+
+ + + - {/* JavaScript CDN Configuration */} - - - -
- -

{t('esmUrl')}

+ {/* JavaScript CDN Configuration */} + + + +
+ +

{t('esmUrl')}

+ {isModified.esmUrl && ( +
+ )} +
+ + +
+
+ { + // Strip trailing slash on save. + const value = e.target.value; + setEsmUrlInput(value); + updateConfig((current) => ({ + ...current, + esmUrl: value.replace(/\/+$/, ''), + })); + }} + className="flex-1" + /> {isModified.esmUrl && ( -
+ )}
- - -
-
- { - // Strip trailing slash on save. - const value = e.target.value; - setEsmUrlInput(value); - updateConfig((current) => ({ - ...current, - esmUrl: value.replace(/\/+$/, ''), - })); - }} - className="flex-1" - /> - {isModified.esmUrl && ( - - )} -
-

- {t('esmUrlDescription')} -

-
-
- - +

+ {t('esmUrlDescription')} +

+
+ + + - {/* Preview Domain Configuration */} - - - -
- -

{t('previewDomain')}

+ {/* Preview Domain Configuration */} + + + +
+ +

{t('previewDomain')}

+ {isModified.previewDomain && ( +
+ )} +
+ + +
+
+ { + const value = e.target.value; + setPreviewDomainInput(value); + updateConfig((current) => ({ + ...current, + previewDomain: value, + })); + }} + className="flex-1" + /> {isModified.previewDomain && ( -
+ )}
- - -
-
- { - const value = e.target.value; - setPreviewDomainInput(value); +

+ {t('previewDomainDescription')} +

+
+ + + + + {/* Showcase Configuration */} + + + +
+ +

{t('showcase')}

+ {(isModified.showcaseEnabled || isModified.showcaseModerator) && ( +
+ )} +
+ + +
+
+
+ + {isModified.showcaseEnabled && ( +
+ )} +
+
+ { updateConfig((current) => ({ ...current, - previewDomain: value, + showcaseEnabled: checked, + })); + }} + /> + {isModified.showcaseEnabled && ( + + )} +
+
+

+ {t('showcaseEnabledDescription')} +

+ +
+
+ + {isModified.showcaseModerator && ( +
+ )} +
+
+ { + const value = e.target.value; + setShowcaseModeratorInput(value); + updateConfig((current) => ({ + ...current, + showcaseModerator: value, })); }} className="flex-1" /> - {isModified.previewDomain && ( + {isModified.showcaseModerator && (

- {t('previewDomainDescription')} + {t('showcaseModeratorDescription')}

- - - +
+ + + - {/* Showcase Configuration */} - - - -
- -

{t('showcase')}

- {(isModified.showcaseEnabled || isModified.showcaseModerator) && ( -
- )} -
- - -
-
-
- - {isModified.showcaseEnabled && ( -
- )} -
-
- { - updateConfig((current) => ({ - ...current, - showcaseEnabled: checked, - })); - }} - /> - {isModified.showcaseEnabled && ( - - )} -
-
-

- {t('showcaseEnabledDescription')} -

- -
-
- - {isModified.showcaseModerator && ( -
- )} -
-
- { - const value = e.target.value; - setShowcaseModeratorInput(value); - updateConfig((current) => ({ - ...current, - showcaseModerator: value, - })); - }} - className="flex-1" - /> - {isModified.showcaseModerator && ( - - )} -
-

- {t('showcaseModeratorDescription')} -

-
-
- - - - - {/* Sentry DSN Configuration */} - - - -
- -

{t('sentryDsn')}

+ {/* Sentry DSN Configuration */} + + + +
+ +

{t('sentryDsn')}

+ {isModified.sentryDsn && ( +
+ )} +
+ + +
+
+ { + const value = e.target.value; + setSentryDsnInput(value); + updateConfig((current) => ({ + ...current, + sentryDsn: value, + })); + }} + className="flex-1" + /> {isModified.sentryDsn && ( -
+ )}
- - -
+

+ {t('sentryDsnDescription')} +

+
+
+ + + + {/* Filesystem Paths Configuration */} + + + +
+ +

{t('filesystemPaths')}

+ {(isModified.fsPathProjects || isModified.fsPathConfig || isModified.fsPathTmp || isModified.fsPathPlugins || isModified.fsPathTemplates) && ( +
+ )} +
+ + +
+
+
+ + {isModified.fsPathProjects && ( +
+ )} +
{ const value = e.target.value; - setSentryDsnInput(value); + setFsPathProjectsInput(value); updateConfig((current) => ({ ...current, - sentryDsn: value, + fsPathProjects: value, })); }} className="flex-1" /> - {isModified.sentryDsn && ( + {isModified.fsPathProjects && (

- {t('sentryDsnDescription')} + {t('projectsDirectoryDescription')}

- - - - {/* Filesystem Paths Configuration */} - - - -
- -

{t('filesystemPaths')}

- {(isModified.fsPathProjects || isModified.fsPathConfig || isModified.fsPathTmp || isModified.fsPathPlugins || isModified.fsPathTemplates) && ( -
- )} +
+
+ + {isModified.fsPathConfig && ( +
+ )} +
+
+ { + const value = e.target.value; + setFsPathConfigInput(value); + updateConfig((current) => ({ + ...current, + fsPathConfig: value, + })); + }} + className="flex-1" + /> + {isModified.fsPathConfig && ( + + )} +
+

+ {t('configDirectoryDescription')} +

- - -
-
-
- - {isModified.fsPathProjects && ( -
- )} -
-
- { - const value = e.target.value; - setFsPathProjectsInput(value); - updateConfig((current) => ({ - ...current, - fsPathProjects: value, - })); - }} - className="flex-1" - /> - {isModified.fsPathProjects && ( - - )} -
-

- {t('projectsDirectoryDescription')} -

-
-
-
- - {isModified.fsPathConfig && ( -
- )} -
-
- { - const value = e.target.value; - setFsPathConfigInput(value); - updateConfig((current) => ({ - ...current, - fsPathConfig: value, - })); - }} - className="flex-1" - /> - {isModified.fsPathConfig && ( - - )} -
-

- {t('configDirectoryDescription')} -

+
+
+ + {isModified.fsPathTmp && ( +
+ )}
- -
-
- - {isModified.fsPathTmp && ( -
- )} -
-
- { - const value = e.target.value; - setFsPathTmpInput(value); - updateConfig((current) => ({ - ...current, - fsPathTmp: value, - })); - }} - className="flex-1" - /> - {isModified.fsPathTmp && ( - - )} -
-

- {t('temporaryDirectoryDescription')} -

-
- -
-
- - {isModified.fsPathPlugins && ( -
- )} -
-
- { - const value = e.target.value; - setFsPathPluginsInput(value); - updateConfig((current) => ({ - ...current, - fsPathPlugins: value, - })); - }} - className="flex-1" - /> - {isModified.fsPathPlugins && ( - - )} -
-

- {t('pluginsDirectoryDescription')} -

-
- -
-
- - {isModified.fsPathTemplates && ( -
- )} -
-
- { - const value = e.target.value; - setFsPathTemplatesInput(value); - updateConfig((current) => ({ - ...current, - fsPathTemplates: value, - })); - }} - className="flex-1" - /> - {isModified.fsPathTemplates && ( - - )} -
-

- {t('templatesDirectoryDescription')} -

+
+ { + const value = e.target.value; + setFsPathTmpInput(value); + updateConfig((current) => ({ + ...current, + fsPathTmp: value, + })); + }} + className="flex-1" + /> + {isModified.fsPathTmp && ( + + )}
+

+ {t('temporaryDirectoryDescription')} +

- - - - {/* Terminal */} - - - -
- -

{t('terminal')}

+
+
+ + {isModified.fsPathPlugins && ( +
+ )} +
+
+ { + const value = e.target.value; + setFsPathPluginsInput(value); + updateConfig((current) => ({ + ...current, + fsPathPlugins: value, + })); + }} + className="flex-1" + /> + {isModified.fsPathPlugins && ( + + )} +
+

+ {t('pluginsDirectoryDescription')} +

- - -
- + +
+
+ + {isModified.fsPathTemplates && ( +
+ )} +
+
+ { + const value = e.target.value; + setFsPathTemplatesInput(value); + updateConfig((current) => ({ + ...current, + fsPathTemplates: value, + })); + }} + className="flex-1" + /> + {isModified.fsPathTemplates && ( + + )} +
+

+ {t('templatesDirectoryDescription')} +

- - - -
+
+
+ + + + {/* Terminal */} + + + +
+ +

{t('terminal')}

+
+
+ +
+ +
+
+
+
); }