feat(ui): tweak board tooltip styles

When the totals were high enough, the image looked really off. Also fixed some inconsistent padding.
This commit is contained in:
psychedelicious 2024-07-24 12:23:05 +10:00
parent 6db63349f8
commit e89de1d5b7
2 changed files with 10 additions and 8 deletions

View File

@ -24,22 +24,24 @@ export const BoardTooltip = ({ board }: Props) => {
const { currentData: coverImage } = useGetImageDTOQuery(board?.cover_image_name ?? skipToken); const { currentData: coverImage } = useGetImageDTOQuery(board?.cover_image_name ?? skipToken);
return ( return (
<Flex flexDir="column" alignItems="center"> <Flex flexDir="column" alignItems="center" gap={1}>
{coverImage && ( {coverImage && (
<Image <Image
src={coverImage.thumbnail_url} src={coverImage.thumbnail_url}
draggable={false} draggable={false}
objectFit="cover" objectFit="cover"
w={100} maxW={150}
h={100} aspectRatio="1/1"
borderRadius="base" borderRadius="base"
borderBottomRadius="lg" borderBottomRadius="lg"
/> />
)} )}
<Text> <Flex flexDir="column" alignItems="center">
{t('boards.imagesWithCount', { count: imagesTotal })}, {t('boards.assetsWithCount', { count: assetsTotal })} <Text noOfLines={1}>
</Text> {t('boards.imagesWithCount', { count: imagesTotal })}, {t('boards.assetsWithCount', { count: assetsTotal })}
{board?.archived && <Text>({t('boards.archived')})</Text>} </Text>
{board?.archived && <Text>({t('boards.archived')})</Text>}
</Flex>
</Flex> </Flex>
); );
}; };

View File

@ -115,7 +115,7 @@ const GalleryBoard = ({ board, isSelected, setBoardToDelete }: GalleryBoardProps
return ( return (
<BoardContextMenu board={board} setBoardToDelete={setBoardToDelete}> <BoardContextMenu board={board} setBoardToDelete={setBoardToDelete}>
{(ref) => ( {(ref) => (
<Tooltip label={<BoardTooltip board={board} />} openDelay={1000} placement="left" closeOnScroll> <Tooltip label={<BoardTooltip board={board} />} openDelay={1000} placement="left" closeOnScroll p={2}>
<Flex <Flex
position="relative" position="relative"
ref={ref} ref={ref}