From 3f76092a3b0b54510d2062c9206fed2c8d400581 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Mon, 2 Nov 2020 15:43:52 -0500 Subject: [PATCH] per channel notification settings take 2 --- ui/component/fileThumbnail/view.jsx | 2 +- ui/component/subscribeButton/index.js | 2 ++ ui/component/subscribeButton/view.jsx | 5 ++++- ui/scss/component/_channel.scss | 5 ++++- yarn.lock | 8 ++------ 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/ui/component/fileThumbnail/view.jsx b/ui/component/fileThumbnail/view.jsx index c8567482f..9c2449347 100644 --- a/ui/component/fileThumbnail/view.jsx +++ b/ui/component/fileThumbnail/view.jsx @@ -37,7 +37,7 @@ function FileThumbnail(props: Props) { ); } - const url = passedThumbnail || uri ? thumbnailFromClaim : Placeholder; + const url = passedThumbnail || (uri ? thumbnailFromClaim : Placeholder); return (
({ @@ -14,6 +15,7 @@ const select = (state, props) => ({ firstRunCompleted: selectFirstRunCompleted(state), permanentUrl: makeSelectPermanentUrlForUri(props.uri)(state), notificationsDisabled: makeSelectNotificationsDisabled(props.uri)(state), + user: selectUser(state), }); export default connect(select, { diff --git a/ui/component/subscribeButton/view.jsx b/ui/component/subscribeButton/view.jsx index ebd29f26c..9f5100157 100644 --- a/ui/component/subscribeButton/view.jsx +++ b/ui/component/subscribeButton/view.jsx @@ -21,6 +21,7 @@ type Props = { doToast: ({ message: string }) => void, shrinkOnMobile: boolean, notificationsDisabled: boolean, + user: ?User, }; export default function SubscribeButton(props: Props) { @@ -33,12 +34,14 @@ export default function SubscribeButton(props: Props) { doToast, shrinkOnMobile = false, notificationsDisabled, + user, } = props; const buttonRef = useRef(); const isMobile = useIsMobile(); let isHovering = useHover(buttonRef); isHovering = isMobile ? true : isHovering; + const uiNotificationsEnabled = user && user.experimental_ui; const { channelName } = parseURI(permanentUrl); const claimName = '@' + channelName; @@ -77,7 +80,7 @@ export default function SubscribeButton(props: Props) { } }} /> - {isSubscribed && ( + {isSubscribed && uiNotificationsEnabled && (