X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;ds=sidebyside;f=resources%2Fjs%2Fcomponents%2Fepisodes%2FItem.js;h=3545e7734586a1f3006ad761621df9061fb15d10;hb=b98dac4d596e4bed9a5f96526aa66ea8512ad2ab;hp=5c6982972a6dbd57ca176bdfe0b296abb889d7ba;hpb=4dc1bbd62acf0c18100f4276d26fc87be8968f28;p=alttp.git diff --git a/resources/js/components/episodes/Item.js b/resources/js/components/episodes/Item.js index 5c69829..3545e77 100644 --- a/resources/js/components/episodes/Item.js +++ b/resources/js/components/episodes/Item.js @@ -1,12 +1,16 @@ import moment from 'moment'; import PropTypes from 'prop-types'; import React from 'react'; +import { Button } from 'react-bootstrap'; import { useTranslation } from 'react-i18next'; import Channels from './Channels'; import Crew from './Crew'; import MultiLink from './MultiLink'; import Players from './Players'; +import Icon from '../common/Icon'; +import { canApplyForEpisode, canRestreamEpisode } from '../../helpers/permissions'; +import { withUser } from '../../helpers/UserContext'; const isActive = episode => { if (!episode.start) return false; @@ -16,13 +20,13 @@ const isActive = episode => { return start.isBefore(now) && end.isAfter(now); }; -const Item = ({ episode }) => { +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', @@ -32,14 +36,23 @@ const Item = ({ episode }) => { classNames.push('is-active'); } + const style = React.useMemo(() => { + if (episode.event && episode.event.corner) { + return { + backgroundImage: `url(${episode.event.corner})`, + }; + } + return null; + }, [episode.event && episode.event.corner]); + const hasChannels = episode.channels && episode.channels.length; const hasPlayers = episode.players && episode.players.length; - return