mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-06 21:45:47 +01:00
Add the ability to display multiple medias released on the same day
This commit is contained in:
@@ -6,6 +6,7 @@ import { CalendarIcon } from '@modulz/radix-icons';
|
|||||||
import { RadarrMediaDisplay, SonarrMediaDisplay } from './MediaDisplay';
|
import { RadarrMediaDisplay, SonarrMediaDisplay } from './MediaDisplay';
|
||||||
import { useConfig } from '../../../tools/state';
|
import { useConfig } from '../../../tools/state';
|
||||||
import { MHPModule } from '../modules';
|
import { MHPModule } from '../modules';
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
export const CalendarModule: MHPModule = {
|
export const CalendarModule: MHPModule = {
|
||||||
title: 'Calendar',
|
title: 'Calendar',
|
||||||
@@ -93,8 +94,12 @@ function DayComponent(props: any) {
|
|||||||
setOpened(true);
|
setOpened(true);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{radarrFiltered.length > 0 && <Indicator size={7} color="yellow" children={null} />}
|
{radarrFiltered.length > 0 && (
|
||||||
{sonarrFiltered.length > 0 && <Indicator size={7} offset={8} color="blue" children={null} />}
|
<Indicator size={7} color="yellow" children={null} />
|
||||||
|
)}
|
||||||
|
{sonarrFiltered.length > 0 && (
|
||||||
|
<Indicator size={7} offset={8} color="blue" children={null} />
|
||||||
|
)}
|
||||||
<Popover
|
<Popover
|
||||||
position="left"
|
position="left"
|
||||||
width={700}
|
width={700}
|
||||||
@@ -104,11 +109,25 @@ function DayComponent(props: any) {
|
|||||||
target={` ${day}`}
|
target={` ${day}`}
|
||||||
>
|
>
|
||||||
<ScrollArea style={{ height: 400 }}>
|
<ScrollArea style={{ height: 400 }}>
|
||||||
{sonarrFiltered.length > 0 && <SonarrMediaDisplay media={sonarrFiltered[0]} />}
|
{sonarrFiltered.map((media: any, index: number) => {
|
||||||
|
return (
|
||||||
|
<React.Fragment key={index}>
|
||||||
|
<SonarrMediaDisplay media={media} />
|
||||||
|
{index < sonarrFiltered.length - 1 && <Divider variant="dashed" my="xl" />}
|
||||||
|
</React.Fragment>
|
||||||
|
);
|
||||||
|
})}
|
||||||
{radarrFiltered.length > 0 && sonarrFiltered.length > 0 && (
|
{radarrFiltered.length > 0 && sonarrFiltered.length > 0 && (
|
||||||
<Divider variant="dashed" my="xl" />
|
<Divider variant="dashed" my="xl" />
|
||||||
)}
|
)}
|
||||||
{radarrFiltered.length > 0 && <RadarrMediaDisplay media={radarrFiltered[0]} />}
|
{radarrFiltered.map((media: any, index: number) => {
|
||||||
|
return (
|
||||||
|
<React.Fragment key={index}>
|
||||||
|
<RadarrMediaDisplay media={media} />
|
||||||
|
{index < radarrFiltered.length - 1 && <Divider variant="dashed" my="xl" />}
|
||||||
|
</React.Fragment>
|
||||||
|
);
|
||||||
|
})}
|
||||||
</ScrollArea>
|
</ScrollArea>
|
||||||
</Popover>
|
</Popover>
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
Reference in New Issue
Block a user