import React from 'react'; import { SETTINGS } from 'lbry-redux'; import { Text, View, ScrollView, Switch, NativeModules } from 'react-native'; import { navigateBack } from 'utils/helper'; import PageHeader from 'component/pageHeader'; import settingsStyle from 'styles/settings'; class SettingsPage extends React.PureComponent { static navigationOptions = { title: 'Settings' } componentDidMount() { this.props.pushDrawerStack(); } render() { const { backgroundPlayEnabled, drawerStack, keepDaemonRunning, navigation, popDrawerStack, showNsfw, setClientSetting } = this.props; // default to true if the setting is null or undefined const actualKeepDaemonRunning = (keepDaemonRunning === null || keepDaemonRunning === undefined) ? true : keepDaemonRunning; return ( navigateBack(navigation, drawerStack, popDrawerStack)} /> Enable background media playback Enable this option to play audio or video in the background when the app is suspended. setClientSetting(SETTINGS.BACKGROUND_PLAY_ENABLED, value)} /> Show NSFW content setClientSetting(SETTINGS.SHOW_NSFW, value)} /> Keep the daemon background service running after closing the app Enable this option for quicker app launch and to keep the synchronisation with the blockchain up to date. { setClientSetting(SETTINGS.KEEP_DAEMON_RUNNING, value); if (NativeModules.DaemonServiceControl) { NativeModules.DaemonServiceControl.setKeepDaemonRunning(value); } }} /> ); } } export default SettingsPage;