// @flow import React from 'react'; import { Component, Text, View } from 'reactxp'; import { Layout, Container } from './Layout'; import NavigationBar, { BackBarItem } from './NavigationBar'; import SettingsHeader, { HeaderTitle } from './SettingsHeader'; import Switch from './Switch'; import styles from './PreferencesStyles'; export type PreferencesProps = { autoConnect: boolean, allowLan: boolean, getAutoStart: () => boolean, setAutoStart: (boolean) => void, setAutoConnect: (boolean) => void, setAllowLan: (boolean) => void, onClose: () => void, }; type State = { autoStart: boolean, }; export default class Preferences extends Component { state = { autoStart: false, }; constructor(props: PreferencesProps) { super(); this.state.autoStart = props.getAutoStart(); } render() { return ( Preferences Auto-connect {'Automatically connect the VPN when the computer starts.'} Auto-start {'Automatically open Mullvad VPN at login to the system.'} Local network sharing { 'Allows access to other devices on the same network for sharing, printing etc.' } ); } _onChangeAutoStart = (autoStart: boolean) => { this.props.setAutoStart(autoStart); // TODO: Handle failure to set auto-start this.setState({ autoStart }); }; }