per channel notification settings take 2
This commit is contained in:
parent
3f7d7674ff
commit
3f76092a3b
5 changed files with 13 additions and 9 deletions
|
@ -37,7 +37,7 @@ function FileThumbnail(props: Props) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const url = passedThumbnail || uri ? thumbnailFromClaim : Placeholder;
|
const url = passedThumbnail || (uri ? thumbnailFromClaim : Placeholder);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
|
|
@ -7,6 +7,7 @@ import {
|
||||||
} from 'redux/selectors/subscriptions';
|
} from 'redux/selectors/subscriptions';
|
||||||
import { makeSelectPermanentUrlForUri } from 'lbry-redux';
|
import { makeSelectPermanentUrlForUri } from 'lbry-redux';
|
||||||
import { doToast } from 'redux/actions/notifications';
|
import { doToast } from 'redux/actions/notifications';
|
||||||
|
import { selectUser } from 'redux/selectors/user';
|
||||||
import SubscribeButton from './view';
|
import SubscribeButton from './view';
|
||||||
|
|
||||||
const select = (state, props) => ({
|
const select = (state, props) => ({
|
||||||
|
@ -14,6 +15,7 @@ const select = (state, props) => ({
|
||||||
firstRunCompleted: selectFirstRunCompleted(state),
|
firstRunCompleted: selectFirstRunCompleted(state),
|
||||||
permanentUrl: makeSelectPermanentUrlForUri(props.uri)(state),
|
permanentUrl: makeSelectPermanentUrlForUri(props.uri)(state),
|
||||||
notificationsDisabled: makeSelectNotificationsDisabled(props.uri)(state),
|
notificationsDisabled: makeSelectNotificationsDisabled(props.uri)(state),
|
||||||
|
user: selectUser(state),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(select, {
|
export default connect(select, {
|
||||||
|
|
|
@ -21,6 +21,7 @@ type Props = {
|
||||||
doToast: ({ message: string }) => void,
|
doToast: ({ message: string }) => void,
|
||||||
shrinkOnMobile: boolean,
|
shrinkOnMobile: boolean,
|
||||||
notificationsDisabled: boolean,
|
notificationsDisabled: boolean,
|
||||||
|
user: ?User,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function SubscribeButton(props: Props) {
|
export default function SubscribeButton(props: Props) {
|
||||||
|
@ -33,12 +34,14 @@ export default function SubscribeButton(props: Props) {
|
||||||
doToast,
|
doToast,
|
||||||
shrinkOnMobile = false,
|
shrinkOnMobile = false,
|
||||||
notificationsDisabled,
|
notificationsDisabled,
|
||||||
|
user,
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
const buttonRef = useRef();
|
const buttonRef = useRef();
|
||||||
const isMobile = useIsMobile();
|
const isMobile = useIsMobile();
|
||||||
let isHovering = useHover(buttonRef);
|
let isHovering = useHover(buttonRef);
|
||||||
isHovering = isMobile ? true : isHovering;
|
isHovering = isMobile ? true : isHovering;
|
||||||
|
const uiNotificationsEnabled = user && user.experimental_ui;
|
||||||
|
|
||||||
const { channelName } = parseURI(permanentUrl);
|
const { channelName } = parseURI(permanentUrl);
|
||||||
const claimName = '@' + channelName;
|
const claimName = '@' + channelName;
|
||||||
|
@ -77,7 +80,7 @@ export default function SubscribeButton(props: Props) {
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{isSubscribed && (
|
{isSubscribed && uiNotificationsEnabled && (
|
||||||
<Button
|
<Button
|
||||||
button="alt"
|
button="alt"
|
||||||
icon={notificationsDisabled ? ICONS.BELL : ICONS.BELL_ON}
|
icon={notificationsDisabled ? ICONS.BELL : ICONS.BELL_ON}
|
||||||
|
|
|
@ -187,8 +187,11 @@ $metadata-z-index: 1;
|
||||||
|
|
||||||
> .button,
|
> .button,
|
||||||
> .button-group .button {
|
> .button-group .button {
|
||||||
padding: 0 var(--spacing-xs);
|
padding: 0 var(--spacing-s);
|
||||||
|
}
|
||||||
|
|
||||||
|
> .button,
|
||||||
|
> .button-group {
|
||||||
&:not(:last-child) {
|
&:not(:last-child) {
|
||||||
margin-right: var(--spacing-m);
|
margin-right: var(--spacing-m);
|
||||||
}
|
}
|
||||||
|
|
|
@ -7411,15 +7411,11 @@ lazy-val@^1.0.4:
|
||||||
yargs "^13.2.2"
|
yargs "^13.2.2"
|
||||||
zstd-codec "^0.1.1"
|
zstd-codec "^0.1.1"
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
lbry-redux@lbryio/lbry-redux#04789190b060f27bf0c438a9af449b4a18ef4925:
|
|
||||||
version "0.0.1"
|
|
||||||
resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/04789190b060f27bf0c438a9af449b4a18ef4925"
|
|
||||||
=======
|
|
||||||
lbry-redux@lbryio/lbry-redux#4d11f319141ba49a26f06053c42c01f00dd4feaf:
|
lbry-redux@lbryio/lbry-redux#4d11f319141ba49a26f06053c42c01f00dd4feaf:
|
||||||
version "0.0.1"
|
version "0.0.1"
|
||||||
resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/4d11f319141ba49a26f06053c42c01f00dd4feaf"
|
resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/4d11f319141ba49a26f06053c42c01f00dd4feaf"
|
||||||
>>>>>>> per channel notification settings
|
|
||||||
dependencies:
|
dependencies:
|
||||||
proxy-polyfill "0.1.6"
|
proxy-polyfill "0.1.6"
|
||||||
reselect "^3.0.0"
|
reselect "^3.0.0"
|
||||||
|
|
Loading…
Reference in a new issue