+
{this.props.t('video.edit')}
-
+
)
}
render() {
const { t, popModal, video } = this.props
+ const unlistedOptions = [
+ { value: true, label: t('main:videos.unlisted') },
+ { value: false, label: t('main:videos.public') },
+ ]
return (
- {t('video.shiftStatements')}
- {
- setSubmitting(true)
- const reply = await this.props.shiftStatements(values)
- setSubmitting(false)
- this.props.popModal()
- return reply
- }}
- >
- {({ handleSubmit, isSubmitting, values, handleChange }) => (
-
+
+ Change visibility
+
+
+ {(editVideo) => (
+ {
+ try {
+ await editVideo({
+ variables: { id: video.id, unlisted: values.unlisted },
+ })
+ this.props.flashSuccessMsg('Visibility changed')
+ window.location.reload()
+ } catch (e) {
+ console.error(e) // eslint-disable-line no-console
+ this.props.flashErrorMsg('Failed to change visibility')
+ }
+ }}
+ >
+ {({ handleSubmit, isSubmitting, setFieldValue, values }) => (
+
+ )}
+
)}
-
+
+ {video['youtube_id'] && (
+
+
+
+
+ {t('video.shiftStatements')}
+
+ {
+ setSubmitting(true)
+ const reply = await this.props.shiftStatements(values)
+ setSubmitting(false)
+ this.props.popModal()
+ return reply
+ }}
+ >
+ {({ handleSubmit, isSubmitting, values, handleChange }) => (
+
+ )}
+
+
+
+ )}
)
}