X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;ds=inline;f=resources%2Fjs%2Fcomponents%2Fepisodes%2FItem.js;h=03cb6febd827301ff7d0a8442a11044b3e95f23a;hb=7c1db464de8560af8f72228fc311c34f38c1134d;hp=c911bc3b6e1f54e3ff15d09ceb76de4abbccefd0;hpb=5a575dc29f3af10f1d8e142ff9e1c6ccdfa3b075;p=alttp.git diff --git a/resources/js/components/episodes/Item.js b/resources/js/components/episodes/Item.js index c911bc3..03cb6fe 100644 --- a/resources/js/components/episodes/Item.js +++ b/resources/js/components/episodes/Item.js @@ -1,32 +1,25 @@ -import moment from 'moment'; import PropTypes from 'prop-types'; import React from 'react'; import { Button } from 'react-bootstrap'; import { useTranslation } from 'react-i18next'; +import { Link } from 'react-router-dom'; import Channels from './Channels'; import Crew from './Crew'; import MultiLink from './MultiLink'; import Players from './Players'; import Icon from '../common/Icon'; +import { hasPassed, hasSGRestream, isActive } from '../../helpers/Episode'; import { canApplyForEpisode, canRestreamEpisode } from '../../helpers/permissions'; import { withUser } from '../../helpers/UserContext'; -const isActive = episode => { - if (!episode.start) return false; - const now = moment(); - const start = moment(episode.start).subtract(10, 'minutes'); - const end = moment(episode.start).add(episode.estimate, 'seconds'); - return start.isBefore(now) && end.isAfter(now); -}; - const Item = ({ episode, onAddRestream, onApply, onEditRestream, user }) => { const { t } = useTranslation(); const classNames = [ 'episodes-item', 'd-flex', - 'align-items-start', + 'align-items-stretch', 'my-3', 'p-2', 'border', @@ -52,17 +45,17 @@ const Item = ({ episode, onAddRestream, onApply, onEditRestream, user }) => {