settings page recon

This commit is contained in:
zeppi 2021-07-22 14:41:08 -04:00 committed by jessopb
parent e920738cd1
commit 085ea15247

View file

@ -15,6 +15,7 @@ import Card from 'component/common/card';
import SettingAccountPassword from 'component/settingAccountPassword'; import SettingAccountPassword from 'component/settingAccountPassword';
import classnames from 'classnames'; import classnames from 'classnames';
import { getPasswordFromCookie } from 'util/saved-passwords'; import { getPasswordFromCookie } from 'util/saved-passwords';
import { SIMPLE_SITE } from 'config';
// $FlowFixMe // $FlowFixMe
import homepages from 'homepages'; import homepages from 'homepages';
import { Lbryio } from 'lbryinc'; import { Lbryio } from 'lbryinc';
@ -208,37 +209,41 @@ class SettingsPage extends React.PureComponent<Props, State> {
className="card-stack" className="card-stack"
> >
{/* @if TARGET='web' */} {/* @if TARGET='web' */}
{user && user.fiat_enabled && <Card {user && user.fiat_enabled && (
title={__('Bank Accounts')} <Card
subtitle={__('Connect a bank account to receive tips and compensation in your local currency')} title={__('Bank Accounts')}
actions={ subtitle={__('Connect a bank account to receive tips and compensation in your local currency')}
<div className="section__actions"> actions={
<Button <div className="section__actions">
button="secondary" <Button
label={__('Manage')} button="secondary"
icon={ICONS.SETTINGS} label={__('Manage')}
navigate={`/$/${PAGES.SETTINGS_STRIPE_ACCOUNT}`} icon={ICONS.SETTINGS}
/> navigate={`/$/${PAGES.SETTINGS_STRIPE_ACCOUNT}`}
</div> />
} </div>
/>} }
/>
)}
{/* @endif */} {/* @endif */}
{/* @if TARGET='web' */} {/* @if TARGET='web' */}
<Card {isAuthenticated && (
title={__('Payment Methods')} <Card
subtitle={__('Add a credit card to tip creators in their local currency')} title={__('Payment Methods')}
actions={ subtitle={__('Add a credit card to tip creators in their local currency')}
<div className="section__actions"> actions={
<Button <div className="section__actions">
button="secondary" <Button
label={__('Manage')} button="secondary"
icon={ICONS.SETTINGS} label={__('Manage')}
navigate={`/$/${PAGES.SETTINGS_STRIPE_CARD}`} icon={ICONS.SETTINGS}
/> navigate={`/$/${PAGES.SETTINGS_STRIPE_CARD}`}
</div> />
} </div>
/> }
/>
)}
{/* @endif */} {/* @endif */}
<Card title={__('Language')} actions={<SettingLanguage />} /> <Card title={__('Language')} actions={<SettingLanguage />} />
@ -393,46 +398,53 @@ class SettingsPage extends React.PureComponent<Props, State> {
'Autoplay video and audio files when navigating to a file, as well as the next related item when a file finishes playing.' 'Autoplay video and audio files when navigating to a file, as well as the next related item when a file finishes playing.'
)} )}
/> />
{!SIMPLE_SITE && (
<>
<FormField
type="checkbox"
name="hide_reposts"
onChange={(e) => {
if (isAuthenticated) {
let param = e.target.checked ? { add: 'noreposts' } : { remove: 'noreposts' };
Lbryio.call('user_tag', 'edit', param);
}
<FormField setClientSetting(SETTINGS.HIDE_REPOSTS, !hideReposts);
type="checkbox" }}
name="hide_reposts" checked={hideReposts}
onChange={(e) => { label={__('Hide reposts')}
if (isAuthenticated) { helper={__(
let param = e.target.checked ? { add: 'noreposts' } : { remove: 'noreposts' }; 'You will not see reposts by people you follow or receive email notifying about them.'
Lbryio.call('user_tag', 'edit', param); )}
} />
setClientSetting(SETTINGS.HIDE_REPOSTS, !hideReposts); {/*
}} <FormField
checked={hideReposts} type="checkbox"
label={__('Hide reposts')} name="show_anonymous"
helper={__('You will not see reposts by people you follow or receive email notifying about them.')} onChange={() => setClientSetting(SETTINGS.SHOW_ANONYMOUS, !showAnonymous)}
/> checked={showAnonymous}
label={__('Show anonymous content')}
helper={__('Anonymous content is published without a channel.')}
/>
*/}
{/* <FormField <FormField
type="checkbox" type="checkbox"
name="show_anonymous" name="show_nsfw"
onChange={() => setClientSetting(SETTINGS.SHOW_ANONYMOUS, !showAnonymous)} onChange={() =>
checked={showAnonymous} !IS_WEB || showNsfw
label={__('Show anonymous content')} ? setClientSetting(SETTINGS.SHOW_MATURE, !showNsfw)
helper={__('Anonymous content is published without a channel.')} : openModal(MODALS.CONFIRM_AGE)
/> */} }
checked={showNsfw}
<FormField label={__('Show mature content')}
type="checkbox" helper={__(
name="show_nsfw" '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. '
onChange={() => )}
!IS_WEB || showNsfw />
? setClientSetting(SETTINGS.SHOW_MATURE, !showNsfw) </>
: openModal(MODALS.CONFIRM_AGE) )}
}
checked={showNsfw}
label={__('Show mature content')}
helper={__(
'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. '
)}
/>
</React.Fragment> </React.Fragment>
} }
/> />