SettingsPage.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. import { ScrollView, StyleSheet, Text, View } from 'react-native'
  2. import React from 'react'
  3. import { List } from 'react-native-paper';
  4. import EntypoIcon from 'react-native-vector-icons/dist/Entypo'
  5. import colors from '../theme/colors';
  6. import fonts from '../theme/fonts';
  7. import NewscoutTitleHeader from '../components/organisms/Headers/NewscoutTitleHeader';
  8. const SettingsPage = (props) => {
  9. const {
  10. navigation
  11. } = props
  12. const listItem = [
  13. {
  14. id:1,
  15. title:"Edit Profile",
  16. icon:'account'
  17. },
  18. {
  19. id:2,
  20. title: "Notification",
  21. icon:'bell'
  22. },
  23. {
  24. id:3,
  25. title:"Security",
  26. icon:'security'
  27. },
  28. {
  29. id:4,
  30. title: "Invite Friends",
  31. icon:'account-multiple-plus'
  32. },
  33. {
  34. id:5,
  35. title:"Help",
  36. icon:'chat-question'
  37. },
  38. {
  39. id:6,
  40. title:"Dark mode",
  41. icon:'theme-light-dark'
  42. },
  43. {
  44. id:7,
  45. title:"Logout",
  46. icon:'logout'
  47. },
  48. ]
  49. return (
  50. <View style={styles.container}>
  51. <NewscoutTitleHeader title="Settings" backButtonShown={true} onBackClick={() => navigation.goBack()}/>
  52. <ScrollView>
  53. {listItem.map((item) =>
  54. <SettingListItem title={item.title} key={item.id} id={item.id} icon={item.icon}/>
  55. )}
  56. </ScrollView>
  57. </View>
  58. )
  59. }
  60. const SettingListItem = (props) => {
  61. const {
  62. title,
  63. id,
  64. icon
  65. } = props
  66. return (
  67. <>
  68. <List.Item title={title}
  69. titleStyle={styles.listItemText}
  70. key={id}
  71. left={props =>
  72. <List.Icon
  73. {...props}
  74. size={24}
  75. style={styles.circularIcon}
  76. icon={icon}
  77. color={colors.topColor}/>
  78. }
  79. right={props => <EntypoIcon name="chevron-thin-right" size={16} color={colors.black}/>}/>
  80. </>
  81. )
  82. }
  83. export default SettingsPage
  84. const styles = StyleSheet.create({
  85. container:{
  86. backgroundColor: colors.white,
  87. height: '100%'
  88. },
  89. listItemText:{
  90. fontFamily: fonts.type.medium
  91. },
  92. circularIcon:{
  93. backgroundColor: colors.primaryTintColor,
  94. marginLeft: 16,
  95. padding:8,
  96. // maxHeight:48,
  97. // maxWidth: 48,
  98. borderRadius: 32,
  99. }
  100. })