index.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import React from 'react';
  2. import Module from '../../lib/Module';
  3. import { View , StyleSheet , Text} from 'react-native';
  4. import Types from '../../lib/Types';
  5. import BaseContainer from '../BaseContainer/index';
  6. import ImageComp from '../Image/index';
  7. import TextComp from '../Text/index';
  8. import { ViewNode, Node } from '../../lib/systems/ViewSystem';
  9. let base1 = new Node("SS"+ Math.random(), {},new ViewNode("S"+Math.random(), "BaseContainer", {width:320,height:209}))
  10. let base2 = new Node("SS"+ Math.random(), {},new ViewNode("S"+Math.random(), "BaseContainer", {width:320,height:209}))
  11. let Image1 = new Node("SS"+ Math.random(), {},new ViewNode("S"+Math.random(), "Image", {width:320,height:209}))
  12. let Text1 = new Node("SS"+ Math.random(), {},new ViewNode("S"+Math.random(), "Text", {text:"hi there"}))
  13. export default class BlogFeed extends Module {
  14. constructor(props){
  15. super(props)
  16. this.isTemplate = true;
  17. this.configure();
  18. }
  19. configure(){
  20. if(this.props.CoreSystem){
  21. let CurrentView = this.props.CoreSystem.getCurrentView();
  22. let node = CurrentView.getNode(this.props.NodeID)
  23. let children = CurrentView.getChildren(node);
  24. if(!CurrentView.has(base1)) CurrentView.addViewNode(base1 , node );
  25. if(!CurrentView.has(base2.id)) CurrentView.addViewNode( base2 ,node);
  26. if(!CurrentView.has(Image1.id)) CurrentView.addViewNode(Image1,base1)
  27. if(!CurrentView.has(Text1.id)) {
  28. CurrentView.addViewNode(Text1 , base2);
  29. this.props.CoreSystem.forceUpdate();
  30. }
  31. }
  32. }
  33. display(){
  34. return(
  35. <View>
  36. </View>
  37. )
  38. }
  39. }
  40. BlogFeed.Inputs = {
  41. }