Environment.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. import React from 'react';
  2. import { View, Text, StyleSheet } from 'react-native';
  3. export default class Environment {
  4. constructor(CS, phoneRef) {
  5. this.phoneRef = phoneRef;
  6. this.CoreSystem = CS;
  7. }
  8. render() {
  9. let CurrentView = this.CoreSystem.getCurrentView();
  10. let defaultContainer = CurrentView.getDefaultContainer();
  11. let Rows = CurrentView.getRows(defaultContainer);
  12. return <View style={styles.container}>
  13. <View style={styles.row}>
  14. <Text>Row</Text>
  15. </View>
  16. <View style={styles.row}>
  17. <View style={styles.col}>
  18. <Text>Colasdasdasdasdasd</Text>
  19. {Rows.map((row) => {
  20. return <Text>Row : {row.id}</Text>
  21. })}
  22. </View>
  23. <div ref={this.phoneRef}>
  24. <View style={[styles.mobileView]}>
  25. {this.CoreSystem.render()}
  26. </View>
  27. </div>
  28. <View style={styles.col}>
  29. <Text>Col</Text>
  30. </View>
  31. </View>
  32. <View style={styles.row}>
  33. <Text>row</Text>
  34. </View>
  35. </View>
  36. }
  37. }
  38. const styles = StyleSheet.create({
  39. container: {
  40. flex: 1,
  41. flexDirection: "column"
  42. },
  43. mobileView: {
  44. backgroundColor: 'white',
  45. borderWidth: 4,
  46. borderColor: 'orange',
  47. flex:1,
  48. alignSelf: 'stretch',
  49. // iphone X
  50. width:1125/3,
  51. height: 2436/3
  52. },
  53. row: {
  54. flexDirection: "row",
  55. borderWidth: 1
  56. },
  57. col: {
  58. flexDirection: "column",
  59. borderWidth: 1
  60. }
  61. });