[Content] grab Notifications, Block/Muted, Creator Settings

This commit is contained in:
infinite-persistence 2021-08-06 15:56:48 +08:00
parent 233477a2fa
commit 52472f3cfb
No known key found for this signature in database
GPG key ID: B9C3252EDC3D0AA0
4 changed files with 50 additions and 58 deletions

View file

@ -1,5 +1,5 @@
import { connect } from 'react-redux';
import { SETTINGS } from 'lbry-redux';
import { selectMyChannelUrls, SETTINGS } from 'lbry-redux';
import { doOpenModal } from 'redux/actions/app';
import { doSetPlayingUri } from 'redux/actions/content';
import { doSetClientSetting } from 'redux/actions/settings';
@ -13,6 +13,7 @@ const select = (state) => ({
autoplay: makeSelectClientSetting(SETTINGS.AUTOPLAY)(state),
hideReposts: makeSelectClientSetting(SETTINGS.HIDE_REPOSTS)(state),
showNsfw: selectShowMatureContent(state),
myChannelUrls: selectMyChannelUrls(state),
});
const perform = (dispatch) => ({

View file

@ -1,29 +1,24 @@
// @flow
import * as ICONS from 'constants/icons';
import * as PAGES from 'constants/pages';
import React from 'react';
import { SETTINGS } from 'lbry-redux';
import { Lbryio } from 'lbryinc';
import { SIMPLE_SITE } from 'config';
import * as MODALS from 'constants/modal_types';
import Button from 'component/button';
import Card from 'component/common/card';
import { FormField } from 'component/common/form';
import MaxPurchasePrice from 'component/maxPurchasePrice';
import SettingsRow from 'component/settingsRow';
const HELP_FLOATING_PLAYER = 'Keep content playing in the corner when navigating to a different page.';
const HELP_AUTOPLAY =
'Autoplay video and audio files when navigating to a file, as well as the next related item when a file finishes playing.';
const HELP_HIDE_REPOSTS = 'You will not see reposts by people you follow or receive email notifying about them.';
const HELP_SHOW_MATURE =
'Mature content may include nudity, intense sexuality, profanity, or other adult content. By displaying mature content, you are affirming you are of legal age to view mature content in your country or jurisdiction. ';
const HELP_MAX_PURCHASE_PRICE =
'This will prevent you from purchasing any content over a certain cost, as a safety measure.';
type Props = {
isAuthenticated: boolean,
floatingPlayer: boolean,
autoplay: boolean,
hideReposts: ?boolean,
showNsfw: boolean,
myChannelUrls: ?Array<string>,
setClientSetting: (string, boolean | string | number) => void,
clearPlayingUri: () => void,
openModal: (string) => void,
@ -36,6 +31,7 @@ export default function SettingContent(props: Props) {
autoplay,
hideReposts,
showNsfw,
myChannelUrls,
setClientSetting,
clearPlayingUri,
openModal,
@ -111,6 +107,39 @@ export default function SettingContent(props: Props) {
</>
)}
{(isAuthenticated || !IS_WEB) && (
<>
<SettingsRow title={__('Notifications')}>
<Button
button="secondary"
label={__('Manage')}
icon={ICONS.SETTINGS}
navigate={`/$/${PAGES.SETTINGS_NOTIFICATIONS}`}
/>
</SettingsRow>
<SettingsRow title={__('Blocked and muted channels')}>
<Button
button="secondary"
label={__('Manage')}
icon={ICONS.SETTINGS}
navigate={`/$/${PAGES.SETTINGS_BLOCKED_MUTED}`}
/>
</SettingsRow>
{myChannelUrls && myChannelUrls.length > 0 && (
<SettingsRow title={__('Creator settings')}>
<Button
button="secondary"
label={__('Manage')}
icon={ICONS.SETTINGS}
navigate={`/$/${PAGES.SETTINGS_CREATOR}`}
/>
</SettingsRow>
)}
</>
)}
{/* @if TARGET='app' */}
<SettingsRow title={__('Max purchase price')} subtitle={__(HELP_MAX_PURCHASE_PRICE)} useVerticalSeparator>
<MaxPurchasePrice />
@ -121,3 +150,12 @@ export default function SettingContent(props: Props) {
/>
);
}
const HELP_FLOATING_PLAYER = 'Keep content playing in the corner when navigating to a different page.';
const HELP_AUTOPLAY =
'Autoplay video and audio files when navigating to a file, as well as the next related item when a file finishes playing.';
const HELP_HIDE_REPOSTS = 'You will not see reposts by people you follow or receive email notifying about them.';
const HELP_SHOW_MATURE =
'Mature content may include nudity, intense sexuality, profanity, or other adult content. By displaying mature content, you are affirming you are of legal age to view mature content in your country or jurisdiction. ';
const HELP_MAX_PURCHASE_PRICE =
'This will prevent you from purchasing any content over a certain cost, as a safety measure.';

View file

@ -8,7 +8,7 @@ import {
doExitSettingsPage,
} from 'redux/actions/settings';
import { makeSelectClientSetting, selectDaemonSettings } from 'redux/selectors/settings';
import { selectMyChannelUrls, SETTINGS } from 'lbry-redux';
import { SETTINGS } from 'lbry-redux';
import SettingsPage from './view';
import { selectUserVerifiedEmail } from 'redux/selectors/user';
@ -18,7 +18,6 @@ const select = (state) => ({
isAuthenticated: selectUserVerifiedEmail(state),
autoDownload: makeSelectClientSetting(SETTINGS.AUTO_DOWNLOAD)(state),
hideBalance: makeSelectClientSetting(SETTINGS.HIDE_BALANCE)(state),
myChannelUrls: selectMyChannelUrls(state),
});
const perform = (dispatch) => ({

View file

@ -38,7 +38,6 @@ type Props = {
openModal: (string) => void,
enterSettings: () => void,
exitSettings: () => void,
myChannelUrls: ?Array<string>,
};
class SettingsPage extends React.PureComponent<Props> {
@ -68,7 +67,6 @@ class SettingsPage extends React.PureComponent<Props> {
// autoDownload,
setDaemonSetting,
toggle3PAnalytics,
myChannelUrls,
} = this.props;
const noDaemonSettings = !daemonSettings || Object.keys(daemonSettings).length === 0;
@ -170,50 +168,6 @@ class SettingsPage extends React.PureComponent<Props> {
{(isAuthenticated || !IS_WEB) && (
<>
<Card
title={__('Notifications')}
actions={
<div className="section__actions">
<Button
button="secondary"
label={__('Manage')}
icon={ICONS.SETTINGS}
navigate={`/$/${PAGES.SETTINGS_NOTIFICATIONS}`}
/>
</div>
}
/>
<Card
title={__('Blocked and muted channels')}
actions={
<div className="section__actions">
<Button
button="secondary"
label={__('Manage')}
icon={ICONS.SETTINGS}
navigate={`/$/${PAGES.SETTINGS_BLOCKED_MUTED}`}
/>
</div>
}
/>
{myChannelUrls && myChannelUrls.length > 0 && (
<Card
title={__('Creator settings')}
actions={
<div className="section__actions">
<Button
button="secondary"
label={__('Manage')}
icon={ICONS.SETTINGS}
navigate={`/$/${PAGES.SETTINGS_CREATOR}`}
/>
</div>
}
/>
)}
<Card
title={__('Advanced settings')}
actions={