From 4687394658662e8b7694f603ee6aadb0dd9fa4a8 Mon Sep 17 00:00:00 2001 From: fishshi <2855691008@qq.com> Date: Mon, 16 Dec 2024 15:36:00 +0800 Subject: [PATCH 1/2] fix GameHeader and BatchAdder on small size --- src/renderer/src/components/Game/Header.tsx | 2 +- src/renderer/src/pages/GameBatchAdder/GameList.tsx | 2 +- src/renderer/src/pages/GameBatchAdder/GameListTable.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/renderer/src/components/Game/Header.tsx b/src/renderer/src/components/Game/Header.tsx index 25d06cf..d5fc1fc 100644 --- a/src/renderer/src/components/Game/Header.tsx +++ b/src/renderer/src/components/Game/Header.tsx @@ -77,7 +77,7 @@ export function Header({ gameId, className }: { gameId: string; className?: stri className )} > -
+
{name} {showOriginalNameInGameHeader && originalName && originalName !== name && ( diff --git a/src/renderer/src/pages/GameBatchAdder/GameList.tsx b/src/renderer/src/pages/GameBatchAdder/GameList.tsx index 6a270ce..18bb9a2 100644 --- a/src/renderer/src/pages/GameBatchAdder/GameList.tsx +++ b/src/renderer/src/pages/GameBatchAdder/GameList.tsx @@ -16,7 +16,7 @@ export function GameList(): JSX.Element { }) } return ( -
+
diff --git a/src/renderer/src/pages/GameBatchAdder/GameListTable.tsx b/src/renderer/src/pages/GameBatchAdder/GameListTable.tsx index a7a24e3..3997e89 100644 --- a/src/renderer/src/pages/GameBatchAdder/GameListTable.tsx +++ b/src/renderer/src/pages/GameBatchAdder/GameListTable.tsx @@ -28,7 +28,7 @@ export function GameListTable(): JSX.Element { -
+
{games.map((game) => ( ))} From 5e6e79d82aabb7b03bf8751c0668e6c68413c0ed Mon Sep 17 00:00:00 2001 From: fishshi <2855691008@qq.com> Date: Mon, 16 Dec 2024 16:23:28 +0800 Subject: [PATCH 2/2] fix CollectionPoster --- .../Showcase/posters/CollectionPoster.tsx | 59 ++++++++++--------- .../contextMenu/CollectionCM/main.tsx | 18 +++++- 2 files changed, 47 insertions(+), 30 deletions(-) diff --git a/src/renderer/src/components/Showcase/posters/CollectionPoster.tsx b/src/renderer/src/components/Showcase/posters/CollectionPoster.tsx index e45ba7f..245bb6a 100644 --- a/src/renderer/src/components/Showcase/posters/CollectionPoster.tsx +++ b/src/renderer/src/components/Showcase/posters/CollectionPoster.tsx @@ -18,25 +18,26 @@ export function CollectionPoster({ const gameId = collections[collctionId].games[0] const length = collections[collctionId].games.length return ( -
navigate(`/library/collections/${collctionId}`)} - > - {/* background mask layer */} +
+ onClick={() => navigate(`/library/collections/${collctionId}`)} + > + {/* background mask layer */} +
+ + {/* HoverBigCardAnimation layer */} - {/* HoverBigCardAnimation layer */} -
-
- {/* text content layer */} -
-
-
{collectionName}
-
{`( ${length} )`}
+ {/* text content layer */} +
+
+
+ {collectionName} +
+
{`( ${length} )`}
+
-
+ ) } diff --git a/src/renderer/src/components/contextMenu/CollectionCM/main.tsx b/src/renderer/src/components/contextMenu/CollectionCM/main.tsx index 15f5036..600d57f 100644 --- a/src/renderer/src/components/contextMenu/CollectionCM/main.tsx +++ b/src/renderer/src/components/contextMenu/CollectionCM/main.tsx @@ -21,7 +21,7 @@ import { } from '@ui/alert-dialog' import { useCollections } from '~/hooks' import { cn } from '~/utils' -import { useState } from 'react' +import { useEffect, useState } from 'react' export function CollectionCM({ collectionId, @@ -33,6 +33,13 @@ export function CollectionCM({ const { renameCollection, removeCollection, collections } = useCollections() const [newName, setNewName] = useState('') const [isOpen, setIsOpen] = useState(false) + + useEffect(() => { + if (collections[collectionId].name !== newName) { + setNewName(collections[collectionId].name) + } + }, [collections[collectionId].name]) + return ( {children} @@ -59,12 +66,19 @@ export function CollectionCM({ +