About.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. const author = 2021;
  9. export default About = () => {
  10. return (
  11. <View style={styles.container}>
  12. <Image
  13. style={styles.logo}
  14. source={require('../images/about-logo.png')}/>
  15. <Text style={styles.appName}>{app.displayName}</Text>
  16. <Text style={styles.versionName}>{app.versionName}</Text>
  17. <Text style={styles.copyright}>{/*app.versionName + ' Build ' + app.versionCode + */getYearRange()+' EV Charging Technology Pte. Ltd.'}</Text>
  18. </View>
  19. );
  20. }
  21. const getYearRange = () => {
  22. const y = new Date().getFullYear();
  23. var r = '©' + author;
  24. if (y != author) {
  25. r += '-' + y
  26. }
  27. return r;
  28. }
  29. const styles = StyleSheet.create({
  30. container: {
  31. flex: 1,
  32. alignItems: 'center',
  33. backgroundColor: '#FFF'
  34. },
  35. logo: {
  36. width: 96,
  37. height: 96,
  38. marginTop: $vw(25)
  39. },
  40. appName: {
  41. color: '#000',
  42. fontSize: 20,
  43. paddingTop: 5,
  44. textAlign: 'center'
  45. },
  46. versionName: {
  47. color: '#999',
  48. fontSize: 11,
  49. paddingTop: 4,
  50. textAlign: 'center',
  51. },
  52. copyright: {
  53. left: 0,
  54. right: 0,
  55. bottom: 16,
  56. color: '#aaa',
  57. fontSize: 10,
  58. lineHeight: 14,
  59. textAlign: 'center',
  60. position: 'absolute',
  61. }
  62. })