Advertisement
yosadade

about.js

Jul 11th, 2020
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.16 KB | None | 0 0
  1. import React from 'react';
  2. import {StyleSheet, View, StatusBar} from 'react-native';
  3. import Fire from '../../config';
  4. import {colors} from '../../utils';
  5. import {List, Gap} from '../../components';
  6. import Profile from '../../components/molecul/Profile';
  7. import {showMessage} from 'react-native-flash-message';
  8.  
  9. const About = ({navigation}) => {
  10. const signOut = () => {
  11. Fire.auth()
  12. .signOut()
  13. .then(() => {
  14. console.log('sign out');
  15. navigation.replace('GetStarted');
  16. })
  17. .catch(err => {
  18. showMessage({
  19. message: err.message,
  20. type: 'default',
  21. backgroundColor: colors.background.error,
  22. color: colors.text.secondary,
  23. });
  24. });
  25. };
  26. return (
  27. <View style={styles.page}>
  28. <RenderStatusBar />
  29. <RenderContent signOut={signOut} />
  30. </View>
  31. );
  32. };
  33.  
  34. const RenderStatusBar = () => {
  35. return (
  36. <StatusBar
  37. barStyle="dark-content"
  38. backgroundColor={colors.background.primary}
  39. hidden={false}
  40. />
  41. );
  42. };
  43.  
  44. const RenderContent = ({signOut}) => {
  45. return (
  46. <View style={styles.content}>
  47. <Gap height={14} />
  48. <Profile name="Yosada Dede Arissa" desc="React Native Developer" />
  49. <Gap height={10} />
  50. <List
  51. icon="edit-profile"
  52. name="About"
  53. desc="Project Akhir Bootcamp React Native"
  54. type="next"
  55. />
  56. <List
  57. icon="language"
  58. name="Programming Language"
  59. desc="Javascript, React Native"
  60. type="next"
  61. />
  62. <List
  63. icon="rate"
  64. name="Give Us Rate"
  65. desc="On Google Play Store"
  66. type="next"
  67. />
  68. <List
  69. icon="help"
  70. name="Sign Out"
  71. desc="Read our guideines"
  72. type="next"
  73. onPress={signOut}
  74. />
  75. </View>
  76. );
  77. };
  78.  
  79. export default About;
  80.  
  81. const styles = StyleSheet.create({
  82. page: {
  83. flex: 1,
  84. backgroundColor: colors.background.tertiary,
  85. },
  86. content: {
  87. flex: 1,
  88. backgroundColor: colors.background.primary,
  89. borderBottomLeftRadius: 20,
  90. borderBottomRightRadius: 20,
  91. paddingTop: 40,
  92. },
  93. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement