|
@@ -21,50 +21,85 @@ export default class BlogPost extends Module {
|
|
|
super(props)
|
|
|
this.isTemplate = true;
|
|
|
|
|
|
- this.configure();
|
|
|
+ this.id = props.ModuleID;
|
|
|
+ this.nextNumber = (function* () {
|
|
|
+ let i = 0;
|
|
|
+ do{
|
|
|
+ i++;
|
|
|
+ yield i;
|
|
|
+ }while(true);
|
|
|
+ })();
|
|
|
+ this.NodeFactory = NodeFactory.bind(this);
|
|
|
|
|
|
+ this.configure();
|
|
|
}
|
|
|
|
|
|
|
|
|
configure(){
|
|
|
if(this.props.CoreSystem){
|
|
|
- let CurrentView = this.props.CoreSystem.getCurrentView();
|
|
|
+ let CurrentView = this.props.View; // this.props.CoreSystem.getCurrentView();
|
|
|
let node = CurrentView.getNode(this.props.NodeID)
|
|
|
let children = CurrentView.getChildren(node);
|
|
|
- let base1 = new Node("SS"+ Math.random(), {},new ViewNode("S"+Math.random(), "BaseContainer", {width:375,height:209}))
|
|
|
- let base2 = new Node("SS"+ Math.random(), {},new ViewNode("S"+Math.random(), "BaseContainer", {width:375,height:209}))
|
|
|
- let Image1 = new Node("SS"+ Math.random(), {},new ViewNode("S"+Math.random(), "Image"))
|
|
|
+
|
|
|
+ // let NavContainer = NodeFactory({flexDirection:"row",justifyContent:"space-between",alignItems:'center'},'BaseContainer',{height:64,width:375,backgroundColor:'rgba(0, 84, 230, 1)'});
|
|
|
+
|
|
|
+ //NavContainer Inputs
|
|
|
+ // let navIcon = NodeFactory({},'Icon',{name:"reorder",color:'rgba(255, 255, 255, 1)'})
|
|
|
+ // let navTitle = NodeFactory({},'Text',{text:"XDi",color:'rgba(255, 255, 255, 1)',fontSize:25})
|
|
|
+ // let navProfile = NodeFactory({},'Icon',{name:"perm-identity",color:'rgba(255, 255, 255, 1)'})
|
|
|
+ /////////////////////////
|
|
|
+ let BackIcon = this.NodeFactory({},'Icon',{name:"keyboard-backspace",color:'rgba(255, 255, 255, 1)'});
|
|
|
+ let IconContainer = this.NodeFactory({justifyContent:'flex-end', height: 48, width: 58},'BaseContainer',{});
|
|
|
+
|
|
|
+
|
|
|
+ let base1 = new Node("SS"+ this.nextNumber.next().value, {},new ViewNode("S"+this.nextNumber.next().value, "BaseContainer", {width:375,height:209}))
|
|
|
+ let base2 = new Node("SS"+ this.nextNumber.next().value, {flex: 1},new ViewNode("S"+this.nextNumber.next().value, "BaseContainer", {width:375,height:209}))
|
|
|
+ let Image1 = new Node("SS"+ this.nextNumber.next().value, {alignItems:'flex-start'},new ViewNode("S"+this.nextNumber.next().value, "Image"))
|
|
|
|
|
|
- let wrapper = new Node("SS"+ Math.random(), {flexDirection:"row",justifyContent:"space-between",alignItems:"flex-end",height:40},new ViewNode("S"+Math.random(), "BaseContainer", {}))
|
|
|
- let Title = 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,fontFamily:"bold"}))
|
|
|
- let BookMark = new Node("SS"+ Math.random(), {},new ViewNode("S"+Math.random(), "Icon", {}))
|
|
|
+ let wrapper = new Node("SS"+ this.nextNumber.next().value, {flexDirection:"row",justifyContent:"space-between",alignItems:"flex-end",height:40},new ViewNode("S"+this.nextNumber.next().value, "BaseContainer", {}))
|
|
|
+ let Title = new Node("SS"+ this.nextNumber.next().value, {},new ViewNode("S"+this.nextNumber.next().value, "Text", {text:"This is the post Title",color:"rgba(112, 112, 112, 1)",fontSize:17,fontFamily:"bold"}))
|
|
|
+ let BookMark = new Node("SS"+ this.nextNumber.next().value, {},new ViewNode("S"+this.nextNumber.next().value, "Icon", {}))
|
|
|
|
|
|
- let subtitle = new Node("SS"+ Math.random(), {height:25},new ViewNode("S"+Math.random(), "Text", {text:"This is the subtitle",color:"rgba(112, 112, 112, 1)",fontSize:14,fontFamily:"thin"}))
|
|
|
- let MainText = new Node("SS"+ Math.random(), {},new ViewNode("S"+Math.random(), "Text", {text:defaultText,color:"rgba(112, 112, 112, 1)",fontSize:14}))
|
|
|
+ let subtitle = new Node("SS"+ this.nextNumber.next().value, {height:25},new ViewNode("S"+this.nextNumber.next().value, "Text", {text:"This is the subtitle",color:"rgba(112, 112, 112, 1)",fontSize:14,fontFamily:"thin"}))
|
|
|
+ let MainText = new Node("SS"+ this.nextNumber.next().value, {},new ViewNode("S"+this.nextNumber.next().value, "Text", {text:defaultText,color:"rgba(112, 112, 112, 1)",fontSize:14}))
|
|
|
|
|
|
|
|
|
|
|
|
- let wrapperProfile = new Node("SS"+ Math.random(), {flexDirection:"row",height:40},new ViewNode("S"+Math.random(), "BaseContainer", {}))
|
|
|
+ let wrapperProfile = new Node("SS"+ this.nextNumber.next().value, {flexDirection:"row", height:40},new ViewNode("S"+this.nextNumber.next().value, "BaseContainer", {}))
|
|
|
|
|
|
- let ImageProfile = new Node("SS"+ Math.random(), {width:34,height:34},new ViewNode("S"+Math.random(), "Image",{source:require('../Image/assets/profile.png'),width:32,height:32}))
|
|
|
- let ImageWrapper = new Node("SS"+ Math.random(), {flexDirection:"row",justifyContent:"center",alignItems:'center',height:40},new ViewNode("S"+Math.random(), "BaseContainer", {}))
|
|
|
+ let ImageWrapper = new Node("SS"+ this.nextNumber.next().value, {flexDirection:"row",justifyContent:"flex-end", width: 44,height:40},new ViewNode("S"+this.nextNumber.next().value, "BaseContainer", {}))
|
|
|
+ let ImageProfile = new Node("SS"+ this.nextNumber.next().value, {width:36,height:36},new ViewNode("S"+this.nextNumber.next().value, "Image",{source:require('../Image/assets/profile.png'),width:32,height:32}))
|
|
|
|
|
|
- let UserWrapper = new Node("SS"+ Math.random(), {flexDirection:"column",height:40,flexGrow:1},new ViewNode("S"+Math.random(), "BaseContainer", {}))
|
|
|
+ let UserWrapper = new Node("SS"+ this.nextNumber.next().value, {flexDirection:"column",height:40,flexGrow:1},new ViewNode("S"+this.nextNumber.next().value, "BaseContainer", {}))
|
|
|
|
|
|
- let user = new Node("SS"+ Math.random(), {height:20},new ViewNode("S"+Math.random(), "Text", {text:"Alexandra papadopoulou ",color:"rgba(112, 112, 112, 1)",fontSize:14,fontFamily:"thin"}))
|
|
|
- let userjob = new Node("SS"+ Math.random(), {height:20},new ViewNode("S"+Math.random(), "Text", {text:"Market Analyst ",color:"rgba(112, 112, 112, 1)",fontSize:14,fontFamily:"thin"}))
|
|
|
+ let user = new Node("SS"+ this.nextNumber.next().value, {height:20},new ViewNode("S"+this.nextNumber.next().value, "Text", {text:"Alexandra papadopoulou ",color:"rgba(112, 112, 112, 1)",fontSize:14,fontFamily:"thin"}))
|
|
|
+ let userjob = new Node("SS"+ this.nextNumber.next().value, {height:20},new ViewNode("S"+this.nextNumber.next().value, "Text", {text:"Market Analyst ",color:"rgba(112, 112, 112, 1)",fontSize:14,fontFamily:"thin"}))
|
|
|
|
|
|
|
|
|
- if(!CurrentView.has(base1)) CurrentView.addViewNode(base1 , node );
|
|
|
+ // if(!CurrentView.has(NavContainer)) CurrentView.addViewNode(NavContainer,node);
|
|
|
+ // //adding Children To NavContainer
|
|
|
+
|
|
|
+ // if(!CurrentView.has(navIcon)) CurrentView.addViewNode(navIcon,NavContainer)
|
|
|
+ // if(!CurrentView.has(navTitle)) CurrentView.addViewNode(navTitle,NavContainer)
|
|
|
+ // if(!CurrentView.has(navProfile)) CurrentView.addViewNode(navProfile,NavContainer)
|
|
|
+
|
|
|
+
|
|
|
+ // --------------------- This is the end of Top Nav -------------
|
|
|
+
|
|
|
+ console.log("MATCHCHECK ", CurrentView.has(base1))
|
|
|
+ if(!CurrentView.has(base1)) CurrentView.addViewNode(base1, node);
|
|
|
|
|
|
- if(!CurrentView.has(base2.id)) CurrentView.addViewNode( base2 ,node);
|
|
|
- if(!CurrentView.has(Image1.id)) CurrentView.addViewNode(Image1,base1)
|
|
|
+ if(!CurrentView.has(base2.id)) CurrentView.addViewNode(base2, node);
|
|
|
+ if(!CurrentView.has(Image1.id)) CurrentView.addViewNode(Image1, base1);
|
|
|
+
|
|
|
+ if(!CurrentView.has(IconContainer.id)) CurrentView.addViewNode(IconContainer, Image1)
|
|
|
+ if(!CurrentView.has(BackIcon.id)) CurrentView.addViewNode(BackIcon, IconContainer)
|
|
|
|
|
|
|
|
|
- if(!CurrentView.has(wrapper.id)) CurrentView.addViewNode(wrapper , base2);
|
|
|
+ if(!CurrentView.has(wrapper.id)) CurrentView.addViewNode(wrapper, base2);
|
|
|
|
|
|
- if(!CurrentView.has(Title.id)) CurrentView.addViewNode(Title , wrapper);
|
|
|
- if(!CurrentView.has(BookMark.id)) CurrentView.addViewNode(BookMark , wrapper);
|
|
|
+ if(!CurrentView.has(Title.id)) CurrentView.addViewNode(Title, wrapper);
|
|
|
+ if(!CurrentView.has(BookMark.id)) CurrentView.addViewNode(BookMark, wrapper);
|
|
|
|
|
|
|
|
|
|
|
@@ -112,4 +147,9 @@ export default class BlogPost extends Module {
|
|
|
|
|
|
BlogPost.Inputs = {
|
|
|
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+var NodeFactory = function(containerStyle = {}, component, componentStyle = {}){
|
|
|
+ return new Node("SS"+ this.nextNumber.next().value, containerStyle,new ViewNode("S"+this.nextNumber.next().value, component, componentStyle));
|
|
|
}
|