About.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /**
  2. * 关于页面
  3. * @邠心vbe on 2021/4/7
  4. */
  5. import React from 'react';
  6. import { View, Text, Image, StyleSheet } from 'react-native';
  7. import app from '../../app.json';
  8. import { PageList } from './Router';
  9. const author = 2022;
  10. export default About = () => {
  11. return (
  12. <View style={styles.container}>
  13. <Image
  14. style={styles.logo}
  15. resizeMode='contain'
  16. source={require('../images/about-logo.png')}/>
  17. {/* <Text style={styles.appName}>{app.displayName}</Text> */}
  18. <Text style={styles.versionName}>{app.versionName}</Text>
  19. <Text style={ui.flex1}></Text>
  20. <View style={ui.flexcc}>
  21. <Text style={styles.linkText} onPress={() => startPage(PageList.condition)}>Terms of Use</Text>
  22. <Text style={styles.linkText} onPress={() => startPage(PageList.privacy)}>Privacy Policy</Text>
  23. </View>
  24. <Text style={styles.copyright}>{'Copyright ' + /*app.versionName + ' Build ' + app.versionCode + */getYearRange()+' Strides YTL Pte. Ltd.'}</Text>
  25. </View>
  26. );
  27. }
  28. const getYearRange = () => {
  29. const y = new Date().getFullYear();
  30. var r = '©' + author;
  31. if (y > author) {
  32. r += '-' + y
  33. }
  34. return r;
  35. }
  36. const styles = StyleSheet.create({
  37. container: {
  38. flex: 1,
  39. alignItems: 'center',
  40. backgroundColor: '#FFF'
  41. },
  42. logo: {
  43. width: 238,
  44. height: 75,
  45. marginTop: $vw(25)
  46. },
  47. appName: {
  48. color: '#000',
  49. fontSize: 20,
  50. paddingTop: 5,
  51. textAlign: 'center'
  52. },
  53. versionName: {
  54. color: '#999',
  55. fontSize: 11,
  56. paddingTop: 4,
  57. textAlign: 'center',
  58. },
  59. copyright: {
  60. color: '#aaa',
  61. fontSize: 10,
  62. lineHeight: 14,
  63. marginBottom: 16,
  64. textAlign: 'center'
  65. },
  66. linkText: {
  67. ...ui.link,
  68. fontSize: 10,
  69. padding: 1,
  70. marginLeft: 4,
  71. marginRight: 4
  72. }
  73. })