Update Settigns Screen

This commit is contained in:
docjyJ 2020-09-08 16:45:29 +02:00
parent f8f5749478
commit 7867e12a49

View file

@ -52,9 +52,6 @@ class SettingsScreen extends React.Component<PropsType, StateType> {
startScreenPickerSelected: AsyncStorageManager.getString(
AsyncStorageManager.PREFERENCES.defaultStartScreen.key,
),
selectedWash: AsyncStorageManager.getString(
AsyncStorageManager.PREFERENCES.selectedWash.key,
),
isDebugUnlocked: AsyncStorageManager.getBool(
AsyncStorageManager.PREFERENCES.debugUnlocked.key,
),
@ -88,21 +85,6 @@ class SettingsScreen extends React.Component<PropsType, StateType> {
}
};
/**
* Saves the value for the proxiwash reminder notification time
*
* @param value The value to store
*/
onSelectWashValueChange = (value: string) => {
if (value != null) {
this.setState({selectedWash: value});
AsyncStorageManager.set(
AsyncStorageManager.PREFERENCES.selectedWash.key,
value,
);
}
};
/**
* Returns a picker allowing the user to select the proxiwash reminder notification time
*
@ -124,24 +106,6 @@ class SettingsScreen extends React.Component<PropsType, StateType> {
);
}
/**
* Returns a picker allowing the user to select the wash
*
* @returns {React.Node}
*/
getSelectWashPicker(): React.Node {
const {selectedWash} = this.state;
return (
<ToggleButton.Row
onValueChange={this.onSelectWashValueChange}
value={selectedWash}
style={{marginLeft: 'auto', marginRight: 'auto'}}>
<ToggleButton icon="school-outline" value="washinsa" />
<ToggleButton icon="domain" value="tripodeB" />
</ToggleButton.Row>
);
}
/**
* Returns a picker allowing the user to select the start screen
*
@ -324,20 +288,6 @@ class SettingsScreen extends React.Component<PropsType, StateType> {
<View style={{marginLeft: 30}}>
{this.getProxiwashNotifPicker()}
</View>
<List.Item
title={i18n.t('screens.settings.proxiwashNotifReminder')}
description={i18n.t('screens.settings.proxiwashNotifReminderSub')}
left={(props: ListIconPropsType): React.Node => (
<List.Icon
color={props.color}
style={props.style}
icon="washing-machine"
/>
)}
/>
<View style={{marginLeft: 30}}>{this.getSelectWashPicker()}</View>
</List.Section>
</Card>
<Card style={{margin: 5}}>