loginContainer.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. import {inject, observer} from 'mobx-react';
  2. import React from 'react';
  3. import {StyleSheet, Text, View, StatusBar} from 'react-native';
  4. import ConnectButton from '../components/ConnectButton';
  5. import scrollPage from './scrollPage';
  6. const labelElem = label => {
  7. return <Text style={styles.label}>{label}</Text>;
  8. };
  9. function loginContainer(Component) {
  10. @scrollPage
  11. @inject('i18nStore')
  12. @observer
  13. class NewPage extends React.Component {
  14. render() {
  15. const {i18nStore} = this.props;
  16. const {words} = i18nStore;
  17. return (
  18. <View style={styles.page}>
  19. <StatusBar backgroundColor="#fff" barStyle="light-content" />
  20. <View style={styles.center}>
  21. </View>
  22. <Text style={styles.title}>{words.welcom}</Text>
  23. <Component stylesInfo={styles} labelElem={labelElem} />
  24. <View style={styles.flexView} />
  25. <ConnectButton />
  26. </View>
  27. );
  28. }
  29. }
  30. return () => {
  31. return <NewPage />;
  32. };
  33. }
  34. const styles = StyleSheet.create({
  35. page: {
  36. flex: 1,
  37. paddingHorizontal: 8,
  38. paddingVertical: 20,
  39. backgroundColor: '#fff',
  40. },
  41. center: {
  42. alignSelf: 'center',
  43. },
  44. title: {
  45. alignSelf: 'center',
  46. marginTop: 35,
  47. fontSize: 16,
  48. color: '#000000',
  49. fontWeight: '400',
  50. },
  51. alignRight: {
  52. textAlign: 'right',
  53. },
  54. label: {
  55. width: 96,
  56. textAlign: 'right',
  57. fontSize: 16,
  58. color: '#000000',
  59. marginRight: 19,
  60. fontWeight: '400',
  61. },
  62. button: {
  63. width: 112,
  64. },
  65. input: {
  66. backgroundColor: '#F0F0F0',
  67. paddingHorizontal: 19,
  68. borderRadius: 3,
  69. },
  70. form: {
  71. marginTop: 24,
  72. },
  73. textButton: {
  74. color: '#FFC21C',
  75. fontSize: 12,
  76. },
  77. flexView: {
  78. flex: 1,
  79. },
  80. });
  81. export default loginContainer;