))
, [episode, trackers, user]);
+ const showSgSignup = React.useMemo(() =>
+ !hasPassed(episode) && hasSGRestream(episode)
+ , [episode]);
+
return <Row className="episode-crew">
{showCommentators ?
<Col xs={6} md>
</Button>
</div>
: null}
- {hasSGRestream(episode) ?
+ {showSgSignup ?
<div className="button-bar m-2">
{sgLanguages.map(lang =>
<Button
</Button>
</div>
: null}
- {hasSGRestream(episode) ?
+ {showSgSignup ?
<div className="button-bar m-2">
{sgLanguages.map(lang =>
<Button
const byChannel = React.useMemo(() => {
const bc = {};
crews.forEach((crew) => {
- if (!bc[crew.channel_id]) {
- bc[crew.channel_id] = {
- channel: episode.channels.find((c) => c.id === crew.channel_id),
+ const ccid = crew.channel_id || 'none';
+ if (!bc[ccid]) {
+ bc[ccid] = {
+ channel: episode.channels.find((c) => c.id === ccid),
crews: [],
};
}
- bc[crew.channel_id].crews.push(crew);
+ bc[ccid].crews.push(crew);
});
- return Object.entries(bc).map(([, value]) => value).filter(c => !!c.channel);
+ return Object.entries(bc).map(([, value]) => value);
}, [crews, episode]);
return <div>
{byChannel.map(({ channel, crews }) => (
- <fieldset className="crew-list" key={channel.id}>
- {byChannel.length > 1 ?
+ <fieldset className="crew-list" key={channel?.id || 'none'}>
+ {byChannel.length > 1 && channel ?
<legend>{channel.title}</legend>
: null}
{crews.map((crew) => (
'p-2',
'border',
'rounded',
+ `episode-${episode.id}`
];
if (isActive(episode)) {
classNames.push('is-active');
name: PropTypes.string,
title: PropTypes.string,
}),
+ id: PropTypes.number,
players: PropTypes.arrayOf(PropTypes.shape({
})),
raceroom: PropTypes.string,