X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fcomponents%2Fepisodes%2FItem.js;h=612c5ea85f6f76db13ca777f85a93fbebae70bf2;hb=d4e908822c1750b086e90007bf677f66241d0f5b;hp=03cb6febd827301ff7d0a8442a11044b3e95f23a;hpb=7c1db464de8560af8f72228fc311c34f38c1134d;p=alttp.git
diff --git a/resources/js/components/episodes/Item.js b/resources/js/components/episodes/Item.js
index 03cb6fe..612c5ea 100644
--- a/resources/js/components/episodes/Item.js
+++ b/resources/js/components/episodes/Item.js
@@ -10,16 +10,16 @@ import MultiLink from './MultiLink';
import Players from './Players';
import Icon from '../common/Icon';
import { hasPassed, hasSGRestream, isActive } from '../../helpers/Episode';
+import { getLink } from '../../helpers/Event';
import { canApplyForEpisode, canRestreamEpisode } from '../../helpers/permissions';
-import { withUser } from '../../helpers/UserContext';
+import { useUser } from '../../hooks/user';
-const Item = ({ episode, onAddRestream, onApply, onEditRestream, user }) => {
+const Item = ({ episode, onAddRestream, onApply, onEditRestream }) => {
const { t } = useTranslation();
+ const { user } = useUser();
const classNames = [
'episodes-item',
- 'd-flex',
- 'align-items-stretch',
'my-3',
'p-2',
'border',
@@ -42,47 +42,61 @@ const Item = ({ episode, onAddRestream, onApply, onEditRestream, user }) => {
const hasPlayers = episode.players && episode.players.length;
return
-
- {t('schedule.startTime', { date: new Date(episode.start) })}
-
-
-
-
- {episode.title || episode.event ?
-
- {episode.title || episode.event.title}
-
- : null}
- {episode.comment ?
-
- {episode.comment}
-
- : null}
-
-
- {hasChannels ?
-
- : null}
- {!hasChannels && hasPlayers ?
-
- : null}
- {onAddRestream && canRestreamEpisode(user, episode) ?
-
-
-
- : null}
-
+
+
+ {t('schedule.startTime', { date: new Date(episode.start) })}
+
+
+ {episode.title || episode.event ?
+
+ {episode.title || episode.event.title}
+
+ : null}
+ {episode.comment ?
+
+ {episode.comment}
+
+ : null}
+
+ {hasChannels ?
+
+ : null}
+ {!hasChannels && hasPlayers ?
+
+ : null}
+ {episode.raceroom ?
+
+
+
+ : null}
+ {onAddRestream && canRestreamEpisode(user, episode) ?
+
+
+
+ : null}
+
+
+
{hasPlayers ?
: null}
@@ -98,7 +112,7 @@ const Item = ({ episode, onAddRestream, onApply, onEditRestream, user }) => {
{episode.event ?
{episode.event.description_id ?
-
+
{episode.event.title}
:
@@ -125,14 +139,13 @@ Item.propTypes = {
}),
players: PropTypes.arrayOf(PropTypes.shape({
})),
+ raceroom: PropTypes.string,
start: PropTypes.string,
title: PropTypes.string,
}),
onAddRestream: PropTypes.func,
onApply: PropTypes.func,
onEditRestream: PropTypes.func,
- user: PropTypes.shape({
- }),
};
-export default withUser(Item);
+export default Item;