]> git.localhorst.tv Git - alttp.git/blobdiff - resources/js/components/episodes/Channel.js
improved user context
[alttp.git] / resources / js / components / episodes / Channel.js
index d0360bd58dc4648fb83521a30940650ac9a915e6..e2d25d72bf209e59a69fc3d1ca36c79618a3f8cd 100644 (file)
@@ -4,10 +4,12 @@ import { Button } from 'react-bootstrap';
 
 import Icon from '../common/Icon';
 import { mayEditRestream } from '../../helpers/permissions';
-import { withUser } from '../../helpers/UserContext';
+import { useUser } from '../../hooks/user';
 
-const Channel = ({ channel, episode, onEditRestream, user }) =>
-       <div className="episode-channel text-nowrap">
+const Channel = ({ channel, episode, onEditRestream }) => {
+       const { user } = useUser();
+
+       return <div className="episode-channel text-nowrap">
                <Button
                        href={channel.stream_link}
                        rel="noreferer"
@@ -29,6 +31,7 @@ const Channel = ({ channel, episode, onEditRestream, user }) =>
                        </Button>
                : null}
        </div>;
+};
 
 Channel.propTypes = {
        channel: PropTypes.shape({
@@ -39,8 +42,6 @@ Channel.propTypes = {
        episode: PropTypes.shape({
        }),
        onEditRestream: PropTypes.func,
-       user: PropTypes.shape({
-       }),
 };
 
-export default withUser(Channel);
+export default Channel;