X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fcomponents%2Fepisodes%2FItem.js;h=5c6982972a6dbd57ca176bdfe0b296abb889d7ba;hb=1555e7984ae682c7c7cddb5026275317742eaef3;hp=3a3afa44f8c548b38ba02ebe97d5045a22c65ce7;hpb=15132749249f6418fd5695547b5c323a0ad10939;p=alttp.git diff --git a/resources/js/components/episodes/Item.js b/resources/js/components/episodes/Item.js index 3a3afa4..5c69829 100644 --- a/resources/js/components/episodes/Item.js +++ b/resources/js/components/episodes/Item.js @@ -4,13 +4,15 @@ import React from 'react'; 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); }; @@ -30,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) })} @@ -49,14 +54,20 @@ const Item = ({ episode }) => { : null}
- {episode.channels ? + {hasChannels ? : null} + {!hasChannels && hasPlayers ? + + : null}
- {episode.players ? + {hasPlayers ? : null} + {episode.crew && episode.crew.length ? + + : null} ; }; @@ -65,6 +76,8 @@ Item.propTypes = { episode: PropTypes.shape({ channels: PropTypes.arrayOf(PropTypes.shape({ })), + crew: PropTypes.arrayOf(PropTypes.shape({ + })), event: PropTypes.shape({ title: PropTypes.string, }),