X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fcomponents%2Fepisodes%2FRestreamEditForm.js;h=84a3ea2f6f0c59405935f06780c03a8b11e61e9d;hb=87ab0a1f3f0abebe078ba3972794627153352081;hp=e4cbe134fe5e8980dd60065196601555b221de77;hpb=638802eaf20d636c16d7ce337ace508708705f2c;p=alttp.git
diff --git a/resources/js/components/episodes/RestreamEditForm.js b/resources/js/components/episodes/RestreamEditForm.js
index e4cbe13..84a3ea2 100644
--- a/resources/js/components/episodes/RestreamEditForm.js
+++ b/resources/js/components/episodes/RestreamEditForm.js
@@ -1,18 +1,30 @@
import PropTypes from 'prop-types';
import React from 'react';
-import { Button, Modal } from 'react-bootstrap';
+import { Button, Col, Form, Modal, Row } from 'react-bootstrap';
import { useTranslation } from 'react-i18next';
+import CrewManagement from './CrewManagement';
+import ToggleSwitch from '../common/ToggleSwitch';
import { getName } from '../../helpers/Crew';
const RestreamEditForm = ({
channel,
+ editRestream,
episode,
+ manageCrew,
onCancel,
onRemoveRestream,
}) => {
const { t } = useTranslation();
+ const acceptToggle = React.useCallback(e => {
+ editRestream({
+ channel_id: channel.id,
+ episode_id: episode.id,
+ [e.target.name]: e.target.value,
+ });
+ }, [channel, editRestream, episode]);
+
return <>
{channel ?
@@ -31,6 +43,52 @@ const RestreamEditForm = ({
{episode.players.map(p => getName(p)).join(', ')}
> : null}
+ {channel && episode && editRestream ?
+
+
+
+ {t('episodes.restreamDialog.acceptComms')}
+
+
+
+
+
+ {t('episodes.restreamDialog.acceptTracker')}
+
+
+
+
+ : null}
+ {channel && episode && manageCrew ? <>
+
+
+
+ > : null}
{onRemoveRestream ?
@@ -49,16 +107,28 @@ const RestreamEditForm = ({
RestreamEditForm.propTypes = {
channel: PropTypes.shape({
+ id: PropTypes.number,
+ pivot: PropTypes.shape({
+ accept_comms: PropTypes.bool,
+ accept_tracker: PropTypes.bool,
+ }),
title: PropTypes.string,
}),
+ editRestream: PropTypes.func,
episode: PropTypes.shape({
+ crew: PropTypes.arrayOf(PropTypes.shape({
+ channel_id: PropTypes.number,
+ role: PropTypes.string,
+ })),
event: PropTypes.shape({
title: PropTypes.string,
}),
+ id: PropTypes.number,
players: PropTypes.arrayOf(PropTypes.shape({
})),
start: PropTypes.string,
}),
+ manageCrew: PropTypes.func,
onCancel: PropTypes.func,
onRemoveRestream: PropTypes.func,
};