About.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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 = 2023;
  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)}>{$t("drawer.termsOfUse")}</Text>
  22. <Text style={styles.linkText} onPress={() => startPage(PageList.privacy)}>{$t("drawer.privacyPolicy")}</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: colorLight
  41. },
  42. logo: {
  43. width: 215,
  44. height: 70,
  45. marginTop: $vw(25),
  46. marginBottom: 12
  47. },
  48. appName: {
  49. color: '#000',
  50. fontSize: 20,
  51. paddingTop: 5,
  52. textAlign: 'center'
  53. },
  54. versionName: {
  55. color: '#999',
  56. fontSize: 11,
  57. paddingTop: 4,
  58. textAlign: 'center',
  59. },
  60. copyright: {
  61. color: '#aaa',
  62. fontSize: 10,
  63. lineHeight: 14,
  64. marginBottom: 16,
  65. textAlign: 'center'
  66. },
  67. linkText: {
  68. ...ui.link,
  69. fontSize: 10,
  70. padding: 1,
  71. marginLeft: 4,
  72. marginRight: 4
  73. }
  74. })