Fix full screen overflow (#113)

* fix text overflow making image take up too much space in full screen

* Fix missing key

---------

Co-authored-by: jeffvli <jeffvictorli@gmail.com>
This commit is contained in:
Kendall Garner 2023-05-21 23:01:37 +00:00 committed by GitHub
parent da519c2250
commit 8ee99adb2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 5 deletions

View file

@ -12,11 +12,19 @@ import { useFastAverageColor } from '/@/renderer/hooks';
import { AppRoute } from '/@/renderer/router/routes'; import { AppRoute } from '/@/renderer/router/routes';
import { PlayerData, usePlayerData, usePlayerStore } from '/@/renderer/store'; import { PlayerData, usePlayerData, usePlayerStore } from '/@/renderer/store';
const PlayerContainer = styled(Flex)`
flex: 0.5;
gap: '1rem';
@media screen and (min-width: 1080px) {
max-width: 60%;
}
`;
const Image = styled(motion.img)` const Image = styled(motion.img)`
position: absolute; position: absolute;
width: 100%; width: 100%;
max-width: 100%; max-width: 100%;
height: 100%;
max-height: 100%; max-height: 100%;
object-fit: cover; object-fit: cover;
border-radius: 5px; border-radius: 5px;
@ -29,6 +37,7 @@ const ImageContainer = styled(motion.div)`
align-items: center; align-items: center;
height: 65%; height: 65%;
aspect-ratio: 1/1; aspect-ratio: 1/1;
max-width: 100%;
`; `;
const imageVariants: Variants = { const imageVariants: Variants = {
@ -120,13 +129,12 @@ export const FullScreenPlayerImage = () => {
}, [imageState, queue, setImageState]); }, [imageState, queue, setImageState]);
return ( return (
<Flex <PlayerContainer
align="center" align="center"
className="full-screen-player-image-container" className="full-screen-player-image-container"
direction="column" direction="column"
justify="flex-start" justify="flex-start"
p="1rem" p="1rem"
sx={{ flex: 0.5, gap: '1rem' }}
> >
<ImageContainer> <ImageContainer>
<AnimatePresence <AnimatePresence
@ -171,6 +179,7 @@ export const FullScreenPlayerImage = () => {
<Stack <Stack
className="full-screen-player-image-metadata" className="full-screen-player-image-metadata"
spacing="sm" spacing="sm"
sx={{ maxWidth: '100%' }}
> >
<TextTitle <TextTitle
align="center" align="center"
@ -232,6 +241,6 @@ export const FullScreenPlayerImage = () => {
{currentSong?.releaseYear && <Badge size="lg">{currentSong?.releaseYear}</Badge>} {currentSong?.releaseYear && <Badge size="lg">{currentSong?.releaseYear}</Badge>}
</Group> </Group>
</Stack> </Stack>
</Flex> </PlayerContainer>
); );
}; };

View file

@ -72,7 +72,10 @@ export const FullScreenPlayerQueue = () => {
position="center" position="center"
> >
{headerItems.map((item) => ( {headerItems.map((item) => (
<Box pos="relative"> <Box
key={`tab-${item.label}`}
pos="relative"
>
<Button <Button
fullWidth fullWidth
uppercase uppercase