X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fcomponents%2Fepisodes%2FItem.js;h=5c6982972a6dbd57ca176bdfe0b296abb889d7ba;hb=1555e7984ae682c7c7cddb5026275317742eaef3;hp=2078c6dc6573bb74f554032ae67a3fdc0323cd3d;hpb=e2af94795e9d8e8a2eb8c272201b4e54ebb130f0;p=alttp.git diff --git a/resources/js/components/episodes/Item.js b/resources/js/components/episodes/Item.js index 2078c6d..5c69829 100644 --- a/resources/js/components/episodes/Item.js +++ b/resources/js/components/episodes/Item.js @@ -5,13 +5,14 @@ import { useTranslation } from 'react-i18next'; import Channels from './Channels'; import Crew from './Crew'; +import MultiLink from './MultiLink'; import Players from './Players'; const isActive = episode => { if (!episode.start) return false; const now = moment(); - const start = moment(episode.start); - const end = moment(start).add(episode.estimate, 'seconds'); + const start = moment(episode.start).subtract(10, 'minutes'); + const end = moment(episode.start).add(episode.estimate, 'seconds'); return start.isBefore(now) && end.isAfter(now); }; @@ -31,6 +32,9 @@ const Item = ({ episode }) => { classNames.push('is-active'); } + const hasChannels = episode.channels && episode.channels.length; + const hasPlayers = episode.players && episode.players.length; + return
{t('schedule.startTime', { date: new Date(episode.start) })} @@ -50,12 +54,15 @@ const Item = ({ episode }) => { : null}
- {episode.channels ? + {hasChannels ? : null} + {!hasChannels && hasPlayers ? + + : null}
- {episode.players && episode.players.length ? + {hasPlayers ? : null} {episode.crew && episode.crew.length ?