// @flow import * as ICONS from 'constants/icons'; import * as PAGES from 'constants/pages'; import React from 'react'; import * as SETTINGS from 'constants/settings'; import { Lbryio } from 'lbryinc'; import { SETTINGS_GRP } from 'constants/settings'; import Button from 'component/button'; import Card from 'component/common/card'; import { FormField, FormFieldPrice } from 'component/common/form'; import MaxPurchasePrice from 'component/maxPurchasePrice'; import SettingsRow from 'component/settingsRow'; type Price = { currency: string, amount: number, }; type Props = { // --- select --- isAuthenticated: boolean, floatingPlayer: boolean, autoplayMedia: boolean, autoplayNext: boolean, hideReposts: ?boolean, showNsfw: boolean, myChannelUrls: ?Array, instantPurchaseEnabled: boolean, instantPurchaseMax: Price, enablePublishPreview: boolean, // --- perform --- setClientSetting: (string, boolean | string | number) => void, clearPlayingUri: () => void, }; export default function SettingContent(props: Props) { const { isAuthenticated, floatingPlayer, autoplayMedia, autoplayNext, hideReposts, showNsfw, myChannelUrls, instantPurchaseEnabled, instantPurchaseMax, enablePublishPreview, setClientSetting, clearPlayingUri, } = props; return ( <>

{__('Content settings')}

{ setClientSetting(SETTINGS.FLOATING_PLAYER, !floatingPlayer); clearPlayingUri(); }} checked={floatingPlayer} /> setClientSetting(SETTINGS.AUTOPLAY_MEDIA, !autoplayMedia)} checked={autoplayMedia} /> setClientSetting(SETTINGS.AUTOPLAY_NEXT, !autoplayNext)} checked={autoplayNext} /> { if (isAuthenticated) { let param = e.target.checked ? { add: 'noreposts' } : { remove: 'noreposts' }; Lbryio.call('user_tag', 'edit', param); } setClientSetting(SETTINGS.HIDE_REPOSTS, !hideReposts); }} /> setClientSetting(SETTINGS.SHOW_MATURE, !showNsfw)} />