SecurityPage.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. import {StyleSheet, Text, View} from 'react-native';
  2. import React, {useState} from 'react';
  3. import PrimaryOutlineButton from '../components/organisms/Buttons/PrimaryOutlineButton';
  4. import NewscoutTitleHeader from '../components/organisms/Headers/NewscoutTitleHeader';
  5. import {List, Switch} from 'react-native-paper';
  6. import fonts from '../theme/fonts';
  7. import ThemedTextButton from '../components/organisms/Buttons/ThemedTextButton';
  8. const SecurityPage = props => {
  9. const {navigation} = props;
  10. // States
  11. const [faceIdStatus, setFaceIdStatus] = useState(false);
  12. const [rememberMeStatus, setRememberMeStatus] = useState(false);
  13. const [touchIdStatus, setTouchIdStatus] = useState(false);
  14. return (
  15. <View>
  16. <NewscoutTitleHeader
  17. title={'Security'}
  18. backButtonShown={true}
  19. onBackClick={() => navigation.goBack()}
  20. />
  21. <List.Item
  22. title={'Face ID'}
  23. titleStyle={styles.listItemText}
  24. style={styles.listItem}
  25. key={'1'}
  26. right={props => (
  27. <Switch
  28. value={faceIdStatus}
  29. onValueChange={() => setFaceIdStatus(!faceIdStatus)}
  30. />
  31. )}
  32. />
  33. <List.Item
  34. title={'Remember Me'}
  35. titleStyle={styles.listItemText}
  36. style={styles.listItem}
  37. key={'2'}
  38. right={props => (
  39. <Switch
  40. value={rememberMeStatus}
  41. onValueChange={() => setRememberMeStatus(!rememberMeStatus)}
  42. />
  43. )}
  44. />
  45. <List.Item
  46. title={'Touch ID'}
  47. titleStyle={styles.listItemText}
  48. style={styles.listItem}
  49. key={'3'}
  50. right={props => <Switch value={touchIdStatus} onValueChange={() => setTouchIdStatus(!touchIdStatus)} />}
  51. />
  52. <View
  53. style={{
  54. paddingHorizontal: 16,
  55. }}>
  56. <ThemedTextButton title="Change Password" theme="primary-outline"/>
  57. </View>
  58. </View>
  59. );
  60. };
  61. export default SecurityPage;
  62. const styles = StyleSheet.create({
  63. listItemText: {
  64. fontFamily: fonts.type.medium,
  65. },
  66. listItem: {
  67. height: 64,
  68. justifyContent: 'center',
  69. },
  70. });