X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fcomponents%2Fepisodes%2FChannel.js;h=5b6c5e26e007dc67f2bc2fa4f2e3fc065b96ee19;hb=a0bca4306e882d77ba192eed889bd7ed52896dad;hp=1943753617095c1da4b5da6075f77c6f1b05f892;hpb=15132749249f6418fd5695547b5c323a0ad10939;p=alttp.git diff --git a/resources/js/components/episodes/Channel.js b/resources/js/components/episodes/Channel.js index 1943753..5b6c5e2 100644 --- a/resources/js/components/episodes/Channel.js +++ b/resources/js/components/episodes/Channel.js @@ -3,8 +3,10 @@ import React from 'react'; import { Button } from 'react-bootstrap'; import Icon from '../common/Icon'; +import { mayEditRestream } from '../../helpers/permissions'; +import { withUser } from '../../helpers/UserContext'; -const Channel = ({ channel }) => +const Channel = ({ channel, episode, onEditRestream, user }) =>
+ {onEditRestream && mayEditRestream(user, episode, channel) ? + + : null}
; Channel.propTypes = { @@ -25,6 +36,11 @@ Channel.propTypes = { stream_link: PropTypes.string, title: PropTypes.string, }), + episode: PropTypes.shape({ + }), + onEditRestream: PropTypes.func, + user: PropTypes.shape({ + }), }; -export default Channel; +export default withUser(Channel);