fix: thtumbnail box sizing (#415)

This commit is contained in:
diced 2023-05-30 18:33:15 -07:00
parent 86277a091c
commit a1bc2db336
No known key found for this signature in database
GPG key ID: 370BD1BA142842D1

View file

@ -58,23 +58,27 @@ function VideoThumbnailPlaceholder({ file, mediaPreview, ...props }) {
return <Placeholder Icon={IconPlayerPlay} text={`Click to view video (${file.name})`} {...props} />; return <Placeholder Icon={IconPlayerPlay} text={`Click to view video (${file.name})`} {...props} />;
return ( return (
<Box> <Box sx={{ position: 'relative' }}>
<Image <Image
src={file.thumbnail} src={file.thumbnail}
sx={{ sx={{
position: 'absolute',
width: '100%', width: '100%',
height: '100%', height: 'auto',
objectFit: 'cover',
}} }}
/> />
<Center sx={{ position: 'absolute', width: '100%', height: '100%' }}> <Center
sx={{
position: 'absolute',
height: '100%',
top: '50%',
left: '50%',
transform: 'translate(-50%, -50%)',
}}
>
<IconPlayerPlay size={48} /> <IconPlayerPlay size={48} />
</Center> </Center>
</Box> </Box>
// </Placeholder>
); );
} }