From 3d4bdcf7f2910071abff211685af44dbefb055e9 Mon Sep 17 00:00:00 2001 From: the-ghost-bot Date: Thu, 21 Nov 2024 19:57:25 +0100 Subject: [PATCH] fix: improve mobile responsiveness and UI consistency - Enhance table layout for small screens - Fix tab navigation counts - Improve text wrapping and spacing - Optimize settings modal for mobile - Add responsive gallery grid - Fix DOM nesting issues --- src/components/ContentTable.tsx | 105 +++++++++++++++------------ src/components/GameDetails.tsx | 23 +++--- src/components/ScreenshotGallery.tsx | 4 +- src/components/Settings.tsx | 23 +++--- 4 files changed, 80 insertions(+), 75 deletions(-) diff --git a/src/components/ContentTable.tsx b/src/components/ContentTable.tsx index 74a4e9f..87780fe 100644 --- a/src/components/ContentTable.tsx +++ b/src/components/ContentTable.tsx @@ -37,7 +37,7 @@ export function ContentTable({ const { updates, dlcs } = getRelatedContent(allItems, baseId); return ( -
+
{updates.length > 0 && ( {updates.length} Update{updates.length !== 1 ? 's' : ''} @@ -53,41 +53,37 @@ export function ContentTable({ }; const renderSortHeader = (field: SortField, label: string, showForType?: 'base' | 'update' | 'dlc') => { - // Si showForType est spécifié et que tous les éléments ne sont pas de ce type, masquer la colonne const shouldShow = !showForType || items.every(item => item.type === showForType); if (!shouldShow) return null; return ( - - - + ); }; - // Vérifier si nous affichons des jeux de base const showingBaseGames = items.length > 0 && items[0].type === 'base'; return ( @@ -96,17 +92,29 @@ export function ContentTable({ - - {renderSortHeader('id', 'Title ID')} - {renderSortHeader('name', 'Name')} - {renderSortHeader('size', 'Size')} - {showingBaseGames && renderSortHeader('releaseDate', 'Release Date', 'base')} - + + + {showingBaseGames && ( + + )} + - + @@ -116,7 +124,7 @@ export function ContentTable({ onClick={() => handleDetails(item.id)} className="group hover:bg-muted/50 active:bg-muted transition-colors cursor-pointer" > - - - - {showingBaseGames && ( - )} - - @@ -181,8 +192,8 @@ export function ContentTable({ )} {selectedId && ( -
-
+
+
setSelectedId(null)} diff --git a/src/components/GameDetails.tsx b/src/components/GameDetails.tsx index bbbb90a..a7c8eb8 100644 --- a/src/components/GameDetails.tsx +++ b/src/components/GameDetails.tsx @@ -21,10 +21,10 @@ function ContentList({ items, maxVisible = 5, type }: ContentListProps) {
{visibleItems.map(item => (
-

+

{item.id}

- {item.name &&

{item.name}

} + {item.name &&

{item.name}

} {item.version && type === 'update' && (

Version {item.version} @@ -67,18 +67,18 @@ export function GameDetails({ content, onClose }: GameDetailsProps) { const assets = getVisualAssets(base.id); return ( -

+
-

Content Details

-
+

{base.name || 'Content Details'}

+ - {/* Banner */}
- {/* Content Info */} -
+

Base Game

-

{base.id}

+

{base.id}

- {base.name &&

{base.name}

} + {base.name &&

{base.name}

} {base.size && (

Size: {formatFileSize(base.size)} @@ -163,7 +161,6 @@ export function GameDetails({ content, onClose }: GameDetailsProps) { )}

- {/* Screenshots */}
); diff --git a/src/components/ScreenshotGallery.tsx b/src/components/ScreenshotGallery.tsx index 1c0f78d..4df6a16 100644 --- a/src/components/ScreenshotGallery.tsx +++ b/src/components/ScreenshotGallery.tsx @@ -11,7 +11,7 @@ export function ScreenshotGallery({ screenshots }: ScreenshotGalleryProps) {

Screenshots

-
+
{screenshots.map((url, index) => (
- + View Fullscreen
diff --git a/src/components/Settings.tsx b/src/components/Settings.tsx index 7f895c9..dcffd88 100644 --- a/src/components/Settings.tsx +++ b/src/components/Settings.tsx @@ -31,8 +31,8 @@ export function Settings({ onClose }: SettingsProps) { } = useUserPreferences(); return ( -
-
+
+
@@ -47,7 +47,6 @@ export function Settings({ onClose }: SettingsProps) {
- {/* Search Settings */}

Search Settings

@@ -64,7 +63,7 @@ export function Settings({ onClose }: SettingsProps) { onChange={(e) => setNamePrecision(parseFloat(e.target.value))} className="w-full accent-primary" /> -
+
Exact Match Fuzzy Match
@@ -83,14 +82,13 @@ export function Settings({ onClose }: SettingsProps) { onChange={(e) => setTidPrecision(parseFloat(e.target.value))} className="w-full accent-primary" /> -
+
Exact Match Partial Match
- {/* Display Settings */}

Display Settings

@@ -101,7 +99,7 @@ export function Settings({ onClose }: SettingsProps) { setMaxDlcDisplay(Number(e.target.value))} - className="w-full bg-muted border border-border rounded-lg px-3 py-2" + className="w-full bg-muted border border-border rounded-lg px-3 py-2 text-sm" > @@ -174,7 +172,7 @@ export function Settings({ onClose }: SettingsProps) { setAutoRefreshInterval(e.target.value ? Number(e.target.value) : null)} - className="w-full bg-muted border border-border rounded-lg px-3 py-2" + className="w-full bg-muted border border-border rounded-lg px-3 py-2 text-sm" > @@ -202,7 +200,6 @@ export function Settings({ onClose }: SettingsProps) {
- {/* Advanced Settings */}
@@ -239,7 +236,7 @@ export function Settings({ onClose }: SettingsProps) { type="url" value={dataSources.titlesDb} onChange={(e) => setDataSource('titlesDb', e.target.value)} - className="w-full bg-muted border border-border rounded-lg px-3 py-2 text-sm" + className="w-full bg-muted border border-border rounded-lg px-3 py-2 text-xs sm:text-sm break-all" placeholder="Enter URL for titles_db.txt" />
+ Icon + + {renderSortHeader('id', 'Title ID')} + + {renderSortHeader('name', 'Name')} + + {renderSortHeader('size', 'Size')} + + {renderSortHeader('releaseDate', 'Release Date', 'base')} + Related Content + Actions +
+
-
+
+
{item.id}
{item.version && ( @@ -139,27 +147,30 @@ export function ContentTable({ )}
-
+
+
{item.name || 'Unknown Title'}
+
+ {formatFileSize(item.size)} +
+
{formatFileSize(item.size)}
+
{formatDate(item.releaseDate)}
+ {getContentBadges(item.id)} +