From e3faf1958d60fcf2772f7e2cdb1ade6a4be6950e Mon Sep 17 00:00:00 2001 From: Djorkaeff Alexandre Date: Mon, 6 Apr 2020 17:43:58 -0300 Subject: [PATCH 1/9] [FIX] Change notifications preferences --- app/containers/Check.js | 3 +- app/containers/Picker.js | 64 ++++++++++ .../NotificationPreferencesView/index.js | 113 ++++++++---------- .../NotificationPreferencesView/styles.js | 7 -- 4 files changed, 115 insertions(+), 72 deletions(-) create mode 100644 app/containers/Picker.js diff --git a/app/containers/Check.js b/app/containers/Check.js index e3f4f514761..e9a6b73b8bf 100644 --- a/app/containers/Check.js +++ b/app/containers/Check.js @@ -13,9 +13,10 @@ const styles = StyleSheet.create({ } }); -const Check = React.memo(({ theme }) => ); +const Check = React.memo(({ theme, style }) => ); Check.propTypes = { + style: PropTypes.object, theme: PropTypes.string }; diff --git a/app/containers/Picker.js b/app/containers/Picker.js new file mode 100644 index 00000000000..031ddda3ec9 --- /dev/null +++ b/app/containers/Picker.js @@ -0,0 +1,64 @@ +import React from 'react'; +import { FlatList, StyleSheet } from 'react-native'; +import PropTypes from 'prop-types'; + +import ListItem from './ListItem'; +import Check from './Check'; +import Separator from './Separator'; + +const styles = StyleSheet.create({ + check: { + marginHorizontal: 0 + } +}); + +const Item = React.memo(({ + item, + selected, + onItemPress, + theme +}) => ( + )} + onPress={onItemPress} + theme={theme} + /> +)); +Item.propTypes = { + item: PropTypes.object, + selected: PropTypes.bool, + onItemPress: PropTypes.func, + theme: PropTypes.string +}; + +const Picker = React.memo(({ + data, + value = data[0].value, + onChangeValue, + theme +}) => ( + item.value} + renderItem={({ item }) => ( + <> + onChangeValue(item.value)} + /> + + )} + ItemSeparatorComponent={() => } + /> +)); +Picker.propTypes = { + data: PropTypes.array, + value: PropTypes.string, + onChangeValue: PropTypes.func, + theme: PropTypes.string +}; + +export default Picker; diff --git a/app/views/NotificationPreferencesView/index.js b/app/views/NotificationPreferencesView/index.js index b6f8790e5f6..a0768b3dc0d 100644 --- a/app/views/NotificationPreferencesView/index.js +++ b/app/views/NotificationPreferencesView/index.js @@ -3,21 +3,22 @@ import { View, ScrollView, Switch, Text } from 'react-native'; import PropTypes from 'prop-types'; -import RNPickerSelect from 'react-native-picker-select'; import { SafeAreaView } from 'react-navigation'; +import database from '../../lib/database'; import { SWITCH_TRACK_COLOR, themes } from '../../constants/colors'; import StatusBar from '../../containers/StatusBar'; import ListItem from '../../containers/ListItem'; import Separator from '../../containers/Separator'; +import Picker from '../../containers/Picker'; import I18n from '../../i18n'; import scrollPersistTaps from '../../utils/scrollPersistTaps'; import styles from './styles'; import sharedStyles from '../Styles'; import RocketChat from '../../lib/rocketchat'; -import log from '../../utils/log'; import { withTheme } from '../../theme'; import { themedHeader } from '../../utils/navigation'; +import protectedFunction from '../../lib/methods/helpers/protectedFunction'; const SectionTitle = React.memo(({ title, theme }) => ( { - const params = { - [key]: value ? '1' : '0' - }; - try { - await RocketChat.saveNotificationSettings(this.rid, params); - } catch (e) { - log(e); - } - } + saveNotificationSettings = async(key, value, params) => { + const { room } = this.state; + const db = database.active; + + await db.action(async() => { + await room.update(protectedFunction((r) => { + r[key] = value; + })); + }); - onValueChangePicker = async(key, value) => { - const params = { - [key]: value.toString() - }; try { - await RocketChat.saveNotificationSettings(this.rid, params); - } catch (e) { - log(e); + const result = await RocketChat.saveNotificationSettings(this.rid, params); + if (result.success) { + return; + } + } catch { + // do nothing } + + await db.action(async() => { + await room.update(protectedFunction((r) => { + r[key] = room[key]; + })); + }); } + onValueChangeSwitch = (key, value) => this.saveNotificationSettings(key, value, { [key]: value ? '1' : '0' }); + + onValueChangePicker = (key, value) => this.saveNotificationSettings(key, value, { [key]: value.toString() }); + renderPicker = (key) => { const { room } = this.state; const { theme } = this.props; return ( - this.onValueChangePicker(key, value)} - items={OPTIONS[key]} + onChangeValue={value => this.onValueChangePicker(key, value)} + theme={theme} /> ); } @@ -278,68 +283,48 @@ class NotificationPreferencesView extends React.Component { + + + {this.renderPicker('desktopNotifications')} - this.renderPicker('desktopNotifications')} - theme={theme} - /> + + + {this.renderPicker('mobilePushNotifications')} - this.renderPicker('mobilePushNotifications')} - theme={theme} - /> + + + + {this.renderPicker('audioNotifications')} - this.renderPicker('audioNotifications')} - theme={theme} - /> + - this.renderPicker('audioNotificationValue')} - theme={theme} - /> + {this.renderPicker('audioNotificationValue')} - this.renderPicker('desktopNotificationDuration')} - theme={theme} - /> + + + + {this.renderPicker('desktopNotificationDuration')} + {this.renderPicker('emailNotifications')} - this.renderPicker('emailNotifications')} - theme={theme} - /> - diff --git a/app/views/NotificationPreferencesView/styles.js b/app/views/NotificationPreferencesView/styles.js index 61b39cb6da9..baba8a94926 100644 --- a/app/views/NotificationPreferencesView/styles.js +++ b/app/views/NotificationPreferencesView/styles.js @@ -23,12 +23,5 @@ export default StyleSheet.create({ paddingHorizontal: 15, paddingVertical: 10, fontSize: 14 - }, - viewContainer: { - justifyContent: 'center' - }, - pickerText: { - ...sharedStyles.textRegular, - fontSize: 16 } }); From 7564c6f91602d865a20e3045e525c8efaa79cf5d Mon Sep 17 00:00:00 2001 From: Djorkaeff Alexandre Date: Mon, 6 Apr 2020 18:07:59 -0300 Subject: [PATCH 2/9] [IMPROVEMENT] Picker View --- app/containers/Picker.js | 64 -------------- app/index.js | 3 + .../NotificationPreferencesView/index.js | 70 +++++++++------ app/views/PickerView.js | 88 +++++++++++++++++++ 4 files changed, 134 insertions(+), 91 deletions(-) delete mode 100644 app/containers/Picker.js create mode 100644 app/views/PickerView.js diff --git a/app/containers/Picker.js b/app/containers/Picker.js deleted file mode 100644 index 031ddda3ec9..00000000000 --- a/app/containers/Picker.js +++ /dev/null @@ -1,64 +0,0 @@ -import React from 'react'; -import { FlatList, StyleSheet } from 'react-native'; -import PropTypes from 'prop-types'; - -import ListItem from './ListItem'; -import Check from './Check'; -import Separator from './Separator'; - -const styles = StyleSheet.create({ - check: { - marginHorizontal: 0 - } -}); - -const Item = React.memo(({ - item, - selected, - onItemPress, - theme -}) => ( - )} - onPress={onItemPress} - theme={theme} - /> -)); -Item.propTypes = { - item: PropTypes.object, - selected: PropTypes.bool, - onItemPress: PropTypes.func, - theme: PropTypes.string -}; - -const Picker = React.memo(({ - data, - value = data[0].value, - onChangeValue, - theme -}) => ( - item.value} - renderItem={({ item }) => ( - <> - onChangeValue(item.value)} - /> - - )} - ItemSeparatorComponent={() => } - /> -)); -Picker.propTypes = { - data: PropTypes.array, - value: PropTypes.string, - onChangeValue: PropTypes.func, - theme: PropTypes.string -}; - -export default Picker; diff --git a/app/index.js b/app/index.js index 9a10476b788..f65cb72fa5a 100644 --- a/app/index.js +++ b/app/index.js @@ -166,6 +166,9 @@ const ChatsStack = createStackNavigator({ NotificationPrefView: { getScreen: () => require('./views/NotificationPreferencesView').default }, + PickerView: { + getScreen: () => require('./views/PickerView').default + }, ...RoomRoutes }, { defaultNavigationOptions: defaultHeader, diff --git a/app/views/NotificationPreferencesView/index.js b/app/views/NotificationPreferencesView/index.js index a0768b3dc0d..2de2b13a74d 100644 --- a/app/views/NotificationPreferencesView/index.js +++ b/app/views/NotificationPreferencesView/index.js @@ -10,7 +10,6 @@ import { SWITCH_TRACK_COLOR, themes } from '../../constants/colors'; import StatusBar from '../../containers/StatusBar'; import ListItem from '../../containers/ListItem'; import Separator from '../../containers/Separator'; -import Picker from '../../containers/Picker'; import I18n from '../../i18n'; import scrollPersistTaps from '../../utils/scrollPersistTaps'; import styles from './styles'; @@ -214,15 +213,12 @@ class NotificationPreferencesView extends React.Component { renderPicker = (key) => { const { room } = this.state; - const { theme } = this.props; - return ( - this.onValueChangePicker(key, value)} - theme={theme} - /> - ); + const { navigation } = this.props; + navigation.navigate('PickerView', { + data: OPTIONS[key], + value: room[key], + onChangeValue: value => this.onValueChangePicker(key, value) + }); } renderSwitch = (key) => { @@ -283,48 +279,68 @@ class NotificationPreferencesView extends React.Component { - - - {this.renderPicker('desktopNotifications')} + this.renderPicker('desktopNotifications')} + theme={theme} + /> - - - {this.renderPicker('mobilePushNotifications')} + this.renderPicker('mobilePushNotifications')} + theme={theme} + /> - - - - {this.renderPicker('audioNotifications')} - - - {this.renderPicker('audioNotificationValue')} + this.renderPicker('audioNotifications')} + theme={theme} + /> - - + this.renderPicker('audioNotificationValue')} + theme={theme} + /> - {this.renderPicker('desktopNotificationDuration')} + this.renderPicker('desktopNotificationDuration')} + theme={theme} + /> - {this.renderPicker('emailNotifications')} + this.renderPicker('emailNotifications')} + theme={theme} + /> + diff --git a/app/views/PickerView.js b/app/views/PickerView.js new file mode 100644 index 00000000000..1ae20767d13 --- /dev/null +++ b/app/views/PickerView.js @@ -0,0 +1,88 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import { FlatList, StyleSheet } from 'react-native'; + +import I18n from '../i18n'; +import { themedHeader } from '../utils/navigation'; +import { withTheme } from '../theme'; +import { themes } from '../constants/colors'; + +import ListItem from '../containers/ListItem'; +import Check from '../containers/Check'; +import Separator from '../containers/Separator'; + +const styles = StyleSheet.create({ + check: { + marginHorizontal: 0 + } +}); + +const Item = React.memo(({ + item, + selected, + onItemPress, + theme +}) => ( + )} + onPress={onItemPress} + theme={theme} + /> +)); +Item.propTypes = { + item: PropTypes.object, + selected: PropTypes.bool, + onItemPress: PropTypes.func, + theme: PropTypes.string +}; + +class PickerView extends React.PureComponent { + static navigationOptions = ({ screenProps }) => ({ + title: I18n.t('Legal'), + ...themedHeader(screenProps.theme) + }) + + static propTypes = { + navigation: PropTypes.object, + theme: PropTypes.string + } + + constructor(props) { + super(props); + const data = props.navigation.getParam('data', []); + const value = props.navigation.getParam('value', data[0].value); + this.state = { data, value }; + } + + onChangeValue = (value) => { + const { navigation } = this.props; + const onChange = navigation.getParam('onChangeValue', () => {}); + onChange(value); + navigation.goBack(); + } + + render() { + const { data, value } = this.state; + const { theme } = this.props; + + return ( + item.value} + renderItem={({ item }) => ( + this.onChangeValue(item.value)} + /> + )} + ItemSeparatorComponent={() => } + style={{ backgroundColor: themes[theme].backgroundColor }} + /> + ); + } +} + +export default withTheme(PickerView); From fdbd0a56fb4c02f5fa6cf136d0808e0d2a58a7ab Mon Sep 17 00:00:00 2001 From: Djorkaeff Alexandre Date: Mon, 6 Apr 2020 18:09:52 -0300 Subject: [PATCH 3/9] [I18N] Translations --- app/i18n/locales/en.js | 1 + app/i18n/locales/pt-BR.js | 1 + app/views/PickerView.js | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/i18n/locales/en.js b/app/i18n/locales/en.js index c4b925962f3..6b485ea7235 100644 --- a/app/i18n/locales/en.js +++ b/app/i18n/locales/en.js @@ -414,6 +414,7 @@ export default { Select_Server: 'Select Server', Select_Users: 'Select Users', Select_a_Channel: 'Select a Channel', + Select_an_option: 'Select an option', Send: 'Send', Send_audio_message: 'Send audio message', Send_crash_report: 'Send crash report', diff --git a/app/i18n/locales/pt-BR.js b/app/i18n/locales/pt-BR.js index 78210f2df69..5cd3fb3e1a1 100644 --- a/app/i18n/locales/pt-BR.js +++ b/app/i18n/locales/pt-BR.js @@ -377,6 +377,7 @@ export default { Select_Server: 'Selecionar Servidor', Select_Users: 'Selecionar Usuários', Select_a_Channel: 'Selecione um canal', + Select_an_option: 'Selecione uma opção', Send: 'Enviar', Send_audio_message: 'Enviar mensagem de áudio', Send_message: 'Enviar mensagem', diff --git a/app/views/PickerView.js b/app/views/PickerView.js index 1ae20767d13..7c6fd21f332 100644 --- a/app/views/PickerView.js +++ b/app/views/PickerView.js @@ -39,7 +39,7 @@ Item.propTypes = { class PickerView extends React.PureComponent { static navigationOptions = ({ screenProps }) => ({ - title: I18n.t('Legal'), + title: I18n.t('Select_an_option'), ...themedHeader(screenProps.theme) }) From d96d8075f7b57bf27f76ce7cb1804b817274879a Mon Sep 17 00:00:00 2001 From: Djorkaeff Alexandre Date: Mon, 6 Apr 2020 18:23:16 -0300 Subject: [PATCH 4/9] [FIX] Picker Selection --- .../NotificationPreferencesView/index.js | 27 ++++++++++++++----- .../NotificationPreferencesView/styles.js | 4 +++ app/views/PickerView.js | 4 +-- 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/app/views/NotificationPreferencesView/index.js b/app/views/NotificationPreferencesView/index.js index 2de2b13a74d..1f9bf0eb393 100644 --- a/app/views/NotificationPreferencesView/index.js +++ b/app/views/NotificationPreferencesView/index.js @@ -211,7 +211,7 @@ class NotificationPreferencesView extends React.Component { onValueChangePicker = (key, value) => this.saveNotificationSettings(key, value, { [key]: value.toString() }); - renderPicker = (key) => { + pickerSelection = (key) => { const { room } = this.state; const { navigation } = this.props; navigation.navigate('PickerView', { @@ -221,6 +221,13 @@ class NotificationPreferencesView extends React.Component { }); } + renderPickerOption = (key) => { + const { room } = this.state; + const { theme } = this.props; + const text = room[key] ? OPTIONS[key].find(option => option.value === room[key]) : OPTIONS[key][0]; + return {text?.label}; + } + renderSwitch = (key) => { const { room } = this.state; return ( @@ -284,7 +291,8 @@ class NotificationPreferencesView extends React.Component { this.renderPicker('desktopNotifications')} + onPress={() => this.pickerSelection('desktopNotifications')} + right={() => this.renderPickerOption('desktopNotifications')} theme={theme} /> @@ -297,7 +305,8 @@ class NotificationPreferencesView extends React.Component { this.renderPicker('mobilePushNotifications')} + onPress={() => this.pickerSelection('mobilePushNotifications')} + right={() => this.renderPickerOption('mobilePushNotifications')} theme={theme} /> @@ -310,21 +319,24 @@ class NotificationPreferencesView extends React.Component { this.renderPicker('audioNotifications')} + onPress={() => this.pickerSelection('audioNotifications')} + right={() => this.renderPickerOption('audioNotifications')} theme={theme} /> this.renderPicker('audioNotificationValue')} + onPress={() => this.pickerSelection('audioNotificationValue')} + right={() => this.renderPickerOption('audioNotificationValue')} theme={theme} /> this.renderPicker('desktopNotificationDuration')} + onPress={() => this.pickerSelection('desktopNotificationDuration')} + right={() => this.renderPickerOption('desktopNotificationDuration')} theme={theme} /> @@ -336,7 +348,8 @@ class NotificationPreferencesView extends React.Component { this.renderPicker('emailNotifications')} + onPress={() => this.pickerSelection('emailNotifications')} + right={() => this.renderPickerOption('emailNotifications')} theme={theme} /> diff --git a/app/views/NotificationPreferencesView/styles.js b/app/views/NotificationPreferencesView/styles.js index baba8a94926..9b4c9e0e6a0 100644 --- a/app/views/NotificationPreferencesView/styles.js +++ b/app/views/NotificationPreferencesView/styles.js @@ -23,5 +23,9 @@ export default StyleSheet.create({ paddingHorizontal: 15, paddingVertical: 10, fontSize: 14 + }, + pickerText: { + ...sharedStyles.textRegular, + fontSize: 16 } }); diff --git a/app/views/PickerView.js b/app/views/PickerView.js index 7c6fd21f332..540cab39101 100644 --- a/app/views/PickerView.js +++ b/app/views/PickerView.js @@ -51,7 +51,7 @@ class PickerView extends React.PureComponent { constructor(props) { super(props); const data = props.navigation.getParam('data', []); - const value = props.navigation.getParam('value', data[0].value); + const value = props.navigation.getParam('value'); this.state = { data, value }; } @@ -74,7 +74,7 @@ class PickerView extends React.PureComponent { this.onChangeValue(item.value)} /> )} From d0c0b4e9fcf911f0b8d83c79ca65ed0472e07c75 Mon Sep 17 00:00:00 2001 From: Djorkaeff Alexandre Date: Mon, 6 Apr 2020 18:24:29 -0300 Subject: [PATCH 5/9] [FIX] List border --- app/views/PickerView.js | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/PickerView.js b/app/views/PickerView.js index 540cab39101..ba56a3c911e 100644 --- a/app/views/PickerView.js +++ b/app/views/PickerView.js @@ -79,6 +79,7 @@ class PickerView extends React.PureComponent { /> )} ItemSeparatorComponent={() => } + ListFooterComponent={() => } style={{ backgroundColor: themes[theme].backgroundColor }} /> ); From 7d44cfe342478cce20868af53f483d6f2c1a9737 Mon Sep 17 00:00:00 2001 From: Djorkaeff Alexandre Date: Mon, 6 Apr 2020 18:25:56 -0300 Subject: [PATCH 6/9] [FIX] Prevent crash --- app/views/PickerView.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/PickerView.js b/app/views/PickerView.js index ba56a3c911e..a29ff71c24f 100644 --- a/app/views/PickerView.js +++ b/app/views/PickerView.js @@ -74,7 +74,7 @@ class PickerView extends React.PureComponent { this.onChangeValue(item.value)} /> )} From 11e6dcfeb4b52fb6896aa571ad84e5396290f4fb Mon Sep 17 00:00:00 2001 From: Djorkaeff Alexandre Date: Mon, 6 Apr 2020 18:30:38 -0300 Subject: [PATCH 7/9] [FIX] Not-Pref tablet --- app/index.js | 3 +++ app/views/PickerView.js | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/index.js b/app/index.js index f65cb72fa5a..cbc099457d5 100644 --- a/app/index.js +++ b/app/index.js @@ -451,6 +451,9 @@ const RoomActionsStack = createStackNavigator({ }, AttachmentView: { getScreen: () => require('./views/AttachmentView').default + }, + PickerView: { + getScreen: () => require('./views/PickerView').default } }, { defaultNavigationOptions: defaultHeader, diff --git a/app/views/PickerView.js b/app/views/PickerView.js index a29ff71c24f..91514c3678f 100644 --- a/app/views/PickerView.js +++ b/app/views/PickerView.js @@ -38,8 +38,8 @@ Item.propTypes = { }; class PickerView extends React.PureComponent { - static navigationOptions = ({ screenProps }) => ({ - title: I18n.t('Select_an_option'), + static navigationOptions = ({ navigation, screenProps }) => ({ + title: navigation.getParam('title', I18n.t('Select_an_option')), ...themedHeader(screenProps.theme) }) From c8b8ba88a7bc7ea9143262a43d510df2e59890f4 Mon Sep 17 00:00:00 2001 From: Djorkaeff Alexandre Date: Mon, 6 Apr 2020 18:32:43 -0300 Subject: [PATCH 8/9] [FIX] Use same style of LanguageView --- app/views/PickerView.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/views/PickerView.js b/app/views/PickerView.js index 91514c3678f..5a8c73f2a8b 100644 --- a/app/views/PickerView.js +++ b/app/views/PickerView.js @@ -6,6 +6,7 @@ import I18n from '../i18n'; import { themedHeader } from '../utils/navigation'; import { withTheme } from '../theme'; import { themes } from '../constants/colors'; +import sharedStyles from './Styles'; import ListItem from '../containers/ListItem'; import Check from '../containers/Check'; @@ -79,8 +80,14 @@ class PickerView extends React.PureComponent { /> )} ItemSeparatorComponent={() => } - ListFooterComponent={() => } - style={{ backgroundColor: themes[theme].backgroundColor }} + contentContainerStyle={[ + sharedStyles.listContentContainer, + { + backgroundColor: themes[theme].auxiliaryBackground, + borderColor: themes[theme].separatorColor + } + ]} + style={{ backgroundColor: themes[theme].auxiliaryBackground }} /> ); } From 4ec7f314181d2d3edb564df0b3b15ed0e407bf08 Mon Sep 17 00:00:00 2001 From: Djorkaeff Alexandre Date: Mon, 6 Apr 2020 18:35:35 -0300 Subject: [PATCH 9/9] [IMPROVEMENT] Send listItem title --- app/containers/ListItem.js | 3 ++- app/views/NotificationPreferencesView/index.js | 15 ++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/app/containers/ListItem.js b/app/containers/ListItem.js index faccf4c0b58..6b7498dd8e7 100644 --- a/app/containers/ListItem.js +++ b/app/containers/ListItem.js @@ -52,7 +52,7 @@ const Button = React.memo(({ onPress, ...props }) => ( onPress(props.title)} style={{ backgroundColor: themes[props.theme].backgroundColor }} enabled={!props.disabled} theme={props.theme} @@ -89,6 +89,7 @@ Content.propTypes = { }; Button.propTypes = { + title: PropTypes.string, onPress: PropTypes.func, disabled: PropTypes.bool, theme: PropTypes.string diff --git a/app/views/NotificationPreferencesView/index.js b/app/views/NotificationPreferencesView/index.js index 1f9bf0eb393..52acad338f6 100644 --- a/app/views/NotificationPreferencesView/index.js +++ b/app/views/NotificationPreferencesView/index.js @@ -211,10 +211,11 @@ class NotificationPreferencesView extends React.Component { onValueChangePicker = (key, value) => this.saveNotificationSettings(key, value, { [key]: value.toString() }); - pickerSelection = (key) => { + pickerSelection = (title, key) => { const { room } = this.state; const { navigation } = this.props; navigation.navigate('PickerView', { + title, data: OPTIONS[key], value: room[key], onChangeValue: value => this.onValueChangePicker(key, value) @@ -291,7 +292,7 @@ class NotificationPreferencesView extends React.Component { this.pickerSelection('desktopNotifications')} + onPress={title => this.pickerSelection(title, 'desktopNotifications')} right={() => this.renderPickerOption('desktopNotifications')} theme={theme} /> @@ -305,7 +306,7 @@ class NotificationPreferencesView extends React.Component { this.pickerSelection('mobilePushNotifications')} + onPress={title => this.pickerSelection(title, 'mobilePushNotifications')} right={() => this.renderPickerOption('mobilePushNotifications')} theme={theme} /> @@ -319,7 +320,7 @@ class NotificationPreferencesView extends React.Component { this.pickerSelection('audioNotifications')} + onPress={title => this.pickerSelection(title, 'audioNotifications')} right={() => this.renderPickerOption('audioNotifications')} theme={theme} /> @@ -327,7 +328,7 @@ class NotificationPreferencesView extends React.Component { this.pickerSelection('audioNotificationValue')} + onPress={title => this.pickerSelection(title, 'audioNotificationValue')} right={() => this.renderPickerOption('audioNotificationValue')} theme={theme} /> @@ -335,7 +336,7 @@ class NotificationPreferencesView extends React.Component { this.pickerSelection('desktopNotificationDuration')} + onPress={title => this.pickerSelection(title, 'desktopNotificationDuration')} right={() => this.renderPickerOption('desktopNotificationDuration')} theme={theme} /> @@ -348,7 +349,7 @@ class NotificationPreferencesView extends React.Component { this.pickerSelection('emailNotifications')} + onPress={title => this.pickerSelection(title, 'emailNotifications')} right={() => this.renderPickerOption('emailNotifications')} theme={theme} />