Skip to content

Commit 2460689

Browse files
feat(ui): style board name
1 parent 781b800 commit 2460689

File tree

1 file changed

+6
-18
lines changed

1 file changed

+6
-18
lines changed

invokeai/frontend/web/src/features/gallery/components/GalleryBoardName.tsx

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,17 @@
1-
import { Flex } from '@invoke-ai/ui-library';
1+
import { Flex, Text } from '@invoke-ai/ui-library';
22
import { useAppSelector } from 'app/store/storeHooks';
3-
import { memo, useMemo } from 'react';
3+
import { memo } from 'react';
44
import { useBoardName } from 'services/api/hooks/useBoardName';
55

66
const GalleryBoardName = () => {
77
const selectedBoardId = useAppSelector((s) => s.gallery.selectedBoardId);
88
const boardName = useBoardName(selectedBoardId);
99

10-
const formattedBoardName = useMemo(() => {
11-
if (boardName.length > 20) {
12-
return `${boardName.substring(0, 20)}...`;
13-
}
14-
return boardName;
15-
}, [boardName]);
16-
1710
return (
18-
<Flex
19-
justifyContent="center"
20-
fontSize="md"
21-
fontWeight="bold"
22-
borderWidth="thin"
23-
borderStyle="solid"
24-
borderRadius="base"
25-
>
26-
{formattedBoardName}
11+
<Flex w="full" borderWidth={1} borderRadius="base" alignItems="center" justifyContent="center" px={2}>
12+
<Text fontWeight="semibold" fontSize="md" noOfLines={1} wordBreak="break-all" color="base.200">
13+
{boardName}
14+
</Text>
2715
</Flex>
2816
);
2917
};

0 commit comments

Comments
 (0)