Bugfixes in media display
This commit is contained in:
@@ -28,10 +28,10 @@ export const CalendarDay = ({ date, medias }: CalendarDayProps) => {
|
|||||||
>
|
>
|
||||||
<Popover.Target>
|
<Popover.Target>
|
||||||
<Box onClick={open}>
|
<Box onClick={open}>
|
||||||
<DayIndicator color={'red'} position="bottom-start" medias={medias.books}>
|
<DayIndicator color="red" position="bottom-start" medias={medias.books}>
|
||||||
<DayIndicator color={'yellow'} position="top-start" medias={medias.movies}>
|
<DayIndicator color="yellow" position="top-start" medias={medias.movies}>
|
||||||
<DayIndicator color={'blue'} position="top-end" medias={medias.tvShows}>
|
<DayIndicator color="blue" position="top-end" medias={medias.tvShows}>
|
||||||
<DayIndicator color={'green'} position="bottom-end" medias={medias.musics}>
|
<DayIndicator color="green" position="bottom-end" medias={medias.musics}>
|
||||||
<div>{date.getDate()}</div>
|
<div>{date.getDate()}</div>
|
||||||
</DayIndicator>
|
</DayIndicator>
|
||||||
</DayIndicator>
|
</DayIndicator>
|
||||||
|
|||||||
@@ -41,14 +41,13 @@ const mapMedias = (
|
|||||||
medias: any[],
|
medias: any[],
|
||||||
MediaComponent: (props: { media: any }) => JSX.Element | null,
|
MediaComponent: (props: { media: any }) => JSX.Element | null,
|
||||||
containsLastItem: boolean
|
containsLastItem: boolean
|
||||||
) => {
|
) =>
|
||||||
return medias.map((media, index) => (
|
medias.map((media, index) => (
|
||||||
<React.Fragment>
|
<div key={index}>
|
||||||
<MediaComponent media={media} />
|
<MediaComponent media={media} />
|
||||||
{containsLastItem && index === medias.length - 1 ? null : <MediaDivider />}
|
{containsLastItem && index === medias.length - 1 ? null : <MediaDivider />}
|
||||||
</React.Fragment>
|
</div>
|
||||||
));
|
));
|
||||||
};
|
|
||||||
|
|
||||||
const MediaDivider = () => <Divider variant="dashed" size="sm" my="xl" />;
|
const MediaDivider = () => <Divider variant="dashed" size="sm" my="xl" />;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user