Compare commits
No commits in common. "4c4f968e25035b1b29ca23ae22c9d4814d43e73b" and "ac9709d6668a099bfe801d63ba943affd7f1967d" have entirely different histories.
4c4f968e25
...
ac9709d666
2 changed files with 26 additions and 15 deletions
|
|
@ -10,7 +10,6 @@ import {withCollapsible} from "../../utils/withCollapsible";
|
||||||
import {Collapsible} from "react-navigation-collapsible";
|
import {Collapsible} from "react-navigation-collapsible";
|
||||||
import CustomTabBar from "../../components/Tabbar/CustomTabBar";
|
import CustomTabBar from "../../components/Tabbar/CustomTabBar";
|
||||||
import type {CustomTheme} from "../../managers/ThemeManager";
|
import type {CustomTheme} from "../../managers/ThemeManager";
|
||||||
import {Linking} from "expo";
|
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
navigation: Object,
|
navigation: Object,
|
||||||
|
|
@ -31,7 +30,7 @@ type State = {
|
||||||
|
|
||||||
const ICON_AMICALE = require('../../../assets/amicale.png');
|
const ICON_AMICALE = require('../../../assets/amicale.png');
|
||||||
|
|
||||||
const RESET_PASSWORD_PATH = "https://www.amicale-insat.fr//password/reset";
|
const RESET_PASSWORD_PATH = "password/reset";
|
||||||
|
|
||||||
const emailRegex = /^.+@.+\..+$/;
|
const emailRegex = /^.+@.+\..+$/;
|
||||||
|
|
||||||
|
|
@ -68,7 +67,10 @@ class LoginScreen extends React.Component<Props, State> {
|
||||||
|
|
||||||
handleSuccess = () => this.props.navigation.goBack();
|
handleSuccess = () => this.props.navigation.goBack();
|
||||||
|
|
||||||
onResetPasswordClick = () => Linking.openURL(RESET_PASSWORD_PATH);
|
onResetPasswordClick = () => this.props.navigation.navigate('amicale-website', {
|
||||||
|
screen: 'amicale-website',
|
||||||
|
params: {path: RESET_PASSWORD_PATH}
|
||||||
|
});
|
||||||
|
|
||||||
validateEmail = () => this.setState({isEmailValidated: true});
|
validateEmail = () => this.setState({isEmailValidated: true});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,8 +33,17 @@ export default class SettingsScreen extends React.Component<Props, State> {
|
||||||
startScreenPickerSelected: AsyncStorageManager.getInstance().preferences.defaultStartScreen.current,
|
startScreenPickerSelected: AsyncStorageManager.getInstance().preferences.defaultStartScreen.current,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
onProxiwashNotifPickerValueChange: Function;
|
||||||
|
onStartScreenPickerValueChange: Function;
|
||||||
|
onToggleNightMode: Function;
|
||||||
|
onToggleNightModeFollowSystem: Function;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
|
this.onProxiwashNotifPickerValueChange = this.onProxiwashNotifPickerValueChange.bind(this);
|
||||||
|
this.onStartScreenPickerValueChange = this.onStartScreenPickerValueChange.bind(this);
|
||||||
|
this.onToggleNightMode = this.onToggleNightMode.bind(this);
|
||||||
|
this.onToggleNightModeFollowSystem = this.onToggleNightModeFollowSystem.bind(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -42,7 +51,7 @@ export default class SettingsScreen extends React.Component<Props, State> {
|
||||||
*
|
*
|
||||||
* @param value The value to store
|
* @param value The value to store
|
||||||
*/
|
*/
|
||||||
onProxiwashNotifPickerValueChange = (value: string) => {
|
onProxiwashNotifPickerValueChange(value: string) {
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
let key = AsyncStorageManager.getInstance().preferences.proxiwashNotifications.key;
|
let key = AsyncStorageManager.getInstance().preferences.proxiwashNotifications.key;
|
||||||
AsyncStorageManager.getInstance().savePref(key, value);
|
AsyncStorageManager.getInstance().savePref(key, value);
|
||||||
|
|
@ -54,14 +63,14 @@ export default class SettingsScreen extends React.Component<Props, State> {
|
||||||
intVal = parseInt(value);
|
intVal = parseInt(value);
|
||||||
setMachineReminderNotificationTime(intVal);
|
setMachineReminderNotificationTime(intVal);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Saves the value for the proxiwash reminder notification time
|
* Saves the value for the proxiwash reminder notification time
|
||||||
*
|
*
|
||||||
* @param value The value to store
|
* @param value The value to store
|
||||||
*/
|
*/
|
||||||
onStartScreenPickerValueChange = (value: string) => {
|
onStartScreenPickerValueChange(value: string) {
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
let key = AsyncStorageManager.getInstance().preferences.defaultStartScreen.key;
|
let key = AsyncStorageManager.getInstance().preferences.defaultStartScreen.key;
|
||||||
AsyncStorageManager.getInstance().savePref(key, value);
|
AsyncStorageManager.getInstance().savePref(key, value);
|
||||||
|
|
@ -69,7 +78,7 @@ export default class SettingsScreen extends React.Component<Props, State> {
|
||||||
startScreenPickerSelected: value
|
startScreenPickerSelected: value
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a picker allowing the user to select the proxiwash reminder notification time
|
* Returns a picker allowing the user to select the proxiwash reminder notification time
|
||||||
|
|
@ -102,11 +111,11 @@ export default class SettingsScreen extends React.Component<Props, State> {
|
||||||
value={this.state.startScreenPickerSelected}
|
value={this.state.startScreenPickerSelected}
|
||||||
style={{marginLeft: 'auto', marginRight: 'auto'}}
|
style={{marginLeft: 'auto', marginRight: 'auto'}}
|
||||||
>
|
>
|
||||||
<ToggleButton icon="account-circle" value="services"/>
|
<ToggleButton icon="shopping" value="proximo"/>
|
||||||
<ToggleButton icon="tshirt-crew" value="proxiwash"/>
|
|
||||||
<ToggleButton icon="triangle" value="home"/>
|
|
||||||
<ToggleButton icon="calendar-range" value="planning"/>
|
<ToggleButton icon="calendar-range" value="planning"/>
|
||||||
<ToggleButton icon="clock" value="planex"/>
|
<ToggleButton icon="triangle" value="home"/>
|
||||||
|
<ToggleButton icon="washing-machine" value="proxiwash"/>
|
||||||
|
<ToggleButton icon="timetable" value="planex"/>
|
||||||
</ToggleButton.Row>
|
</ToggleButton.Row>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -114,12 +123,12 @@ export default class SettingsScreen extends React.Component<Props, State> {
|
||||||
/**
|
/**
|
||||||
* Toggles night mode and saves it to preferences
|
* Toggles night mode and saves it to preferences
|
||||||
*/
|
*/
|
||||||
onToggleNightMode = () => {
|
onToggleNightMode() {
|
||||||
ThemeManager.getInstance().setNightMode(!this.state.nightMode);
|
ThemeManager.getInstance().setNightMode(!this.state.nightMode);
|
||||||
this.setState({nightMode: !this.state.nightMode});
|
this.setState({nightMode: !this.state.nightMode});
|
||||||
};
|
}
|
||||||
|
|
||||||
onToggleNightModeFollowSystem = () => {
|
onToggleNightModeFollowSystem() {
|
||||||
const value = !this.state.nightModeFollowSystem;
|
const value = !this.state.nightModeFollowSystem;
|
||||||
this.setState({nightModeFollowSystem: value});
|
this.setState({nightModeFollowSystem: value});
|
||||||
let key = AsyncStorageManager.getInstance().preferences.nightModeFollowSystem.key;
|
let key = AsyncStorageManager.getInstance().preferences.nightModeFollowSystem.key;
|
||||||
|
|
@ -129,7 +138,7 @@ export default class SettingsScreen extends React.Component<Props, State> {
|
||||||
ThemeManager.getInstance().setNightMode(nightMode);
|
ThemeManager.getInstance().setNightMode(nightMode);
|
||||||
this.setState({nightMode: nightMode});
|
this.setState({nightMode: nightMode});
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a list item using a checkbox control
|
* Gets a list item using a checkbox control
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue