3
0

index.js 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. let base1 = new Node("SS"+ Math.random(), {},new ViewNode("S"+Math.random(), "BaseContainer", {width:370,height:209}))
  25. let base2 = new Node("SS"+ Math.random(), {},new ViewNode("S"+Math.random(), "BaseContainer", {width:370,height:209}))
  26. let Image1 = new Node("SS"+ Math.random(), {},new ViewNode("S"+Math.random(), "Image", {width:370,height:209}))
  27. let Text1 = new Node("SS"+ Math.random(), {},new ViewNode("S"+Math.random(), "Text", {text:"This is the post Title",color:"rgba(112, 112, 112, 1)",fontSize:17}))
  28. let subtitle = new Node("SS"+ Math.random(), {},new ViewNode("S"+Math.random(), "Text", {text:"This is the subtitle",color:"rgba(112, 112, 112, 1)",fontSize:14}))
  29. if(!CurrentView.has(base1)) CurrentView.addViewNode(base1 , node );
  30. if(!CurrentView.has(base2.id)) CurrentView.addViewNode( base2 ,node);
  31. if(!CurrentView.has(Image1.id)) CurrentView.addViewNode(Image1,base1)
  32. if(!CurrentView.has(Text1.id)) {
  33. CurrentView.addViewNode(Text1 , base2);
  34. }
  35. if(!CurrentView.has(subtitle.id)) {
  36. CurrentView.addViewNode(subtitle , base2);
  37. this.props.CoreSystem.forceUpdate();
  38. }
  39. }
  40. }
  41. display(){
  42. return(
  43. <View>
  44. </View>
  45. )
  46. }
  47. }
  48. BlogFeed.Inputs = {
  49. }