♻️ Work on app tile design

Fixes Hide overflowing app names / option to hide app name #590
This commit is contained in:
ajnart
2023-01-19 10:05:48 +09:00
parent 0dc8f24306
commit fc5aca8379

View File

@@ -1,4 +1,4 @@
import { Center, Text, UnstyledButton } from '@mantine/core';
import { Box, Stack, Title, UnstyledButton } from '@mantine/core';
import { NextLink } from '@mantine/next';
import { createStyles } from '@mantine/styles';
import { motion } from 'framer-motion';
@@ -26,23 +26,34 @@ export const AppTile = ({ className, app }: AppTileProps) => {
function Inner() {
return (
<>
<Text align="center" weight={500} size="md" className={classes.appName}>
<Stack
m={0}
p={0}
spacing="xs"
justify="space-around"
align="center"
style={{ height: '100%', width: '100%' }}
>
<Box hidden={false}>
<Title order={5} size="md" ta="center" lineClamp={1} className={classes.appName}>
{app.name}
</Text>
<Center style={{ height: '85%', flex: 1, width: '85%' }}>
</Title>
</Box>
<motion.img
className={classes.image}
height="85%"
width="85%"
style={{
objectFit: 'contain',
}}
src={app.appearance.iconUrl}
alt={app.name}
whileHover={{
scale: 1.2,
transition: { duration: 0.2 },
}}
initial={{ opacity: 0, scale: 0.5 }}
animate={{ scale: 1, opacity: 1 }}
transition={{ duration: 0.3 }}
/>
</Center>
</Stack>
</>
);
}