3
0

index.js 6.1 KB

1
  1. "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));var _getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));var _inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits"));var _react=_interopRequireDefault(require("react"));var _Module2=_interopRequireDefault(require("../../lib/Module"));var _reactNative=require("react-native");var _Types=_interopRequireDefault(require("../../lib/Types"));var _index=_interopRequireDefault(require("../BaseContainer/index"));var _index2=_interopRequireDefault(require("../Image/index"));var _index3=_interopRequireDefault(require("../Text/index"));var _ViewSystem=require("../../lib/systems/ViewSystem");var _jsxFileName="C:\\Users\\Konstanitnos\\Development\\TrapiLib\\modules\\BlogFeed\\index.js";var defaultText="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla eget sapien justo. Nunc justo nunc, tristique sollicitudin sodales et, rhoncus vel augue. Mauris vel elit turpis. Vivamus hendrerit faucibus tortor, eget molestie turpis mattis vel. Cras maximus nibh vitae euismod lobortis. Sed iaculis quis lectus non rhoncus. Quisque non purus vel risus venenatis convallis eu at turpis. Cras accumsan quam eu dolor dignissim accumsan. Vestibulum sed orci facilisis, lacinia nibh vitae, egestas massa. Integer sit amet dui velit. Suspendisse ut nibh massa. Fusce condimentum semper odio, et hendrerit nisi venenatis consequat. Nam sed nibh eros. Nulla facilisi.";var BlogFeed=function(_Module){(0,_inherits2["default"])(BlogFeed,_Module);function BlogFeed(props){var _this;(0,_classCallCheck2["default"])(this,BlogFeed);_this=(0,_possibleConstructorReturn2["default"])(this,(0,_getPrototypeOf2["default"])(BlogFeed).call(this,props));_this.isTemplate=true;_this.configure();return _this;}(0,_createClass2["default"])(BlogFeed,[{key:"configure",value:function configure(){if(this.props.CoreSystem){var CurrentView=this.props.CoreSystem.getCurrentView();var node=CurrentView.getNode(this.props.NodeID);var children=CurrentView.getChildren(node);var base1=new _ViewSystem.Node("SS"+Math.random(),{},new _ViewSystem.ViewNode("S"+Math.random(),"BaseContainer",{width:375,height:209}));var base2=new _ViewSystem.Node("SS"+Math.random(),{},new _ViewSystem.ViewNode("S"+Math.random(),"BaseContainer",{width:375,height:209}));var Image1=new _ViewSystem.Node("SS"+Math.random(),{},new _ViewSystem.ViewNode("S"+Math.random(),"Image"));var wrapper=new _ViewSystem.Node("SS"+Math.random(),{flexDirection:"row",justifyContent:"space-between",alignItems:"flex-end",height:40},new _ViewSystem.ViewNode("S"+Math.random(),"BaseContainer",{}));var Title=new _ViewSystem.Node("SS"+Math.random(),{},new _ViewSystem.ViewNode("S"+Math.random(),"Text",{text:"This is the post Title",color:"rgba(112, 112, 112, 1)",fontSize:17,fontFamily:"bold"}));var BookMark=new _ViewSystem.Node("SS"+Math.random(),{},new _ViewSystem.ViewNode("S"+Math.random(),"Icon",{}));var subtitle=new _ViewSystem.Node("SS"+Math.random(),{height:25},new _ViewSystem.ViewNode("S"+Math.random(),"Text",{text:"This is the subtitle",color:"rgba(112, 112, 112, 1)",fontSize:14,fontFamily:"thin"}));var MainText=new _ViewSystem.Node("SS"+Math.random(),{},new _ViewSystem.ViewNode("S"+Math.random(),"Text",{text:defaultText,color:"rgba(112, 112, 112, 1)",fontSize:14}));var wrapperProfile=new _ViewSystem.Node("SS"+Math.random(),{flexDirection:"row",height:40},new _ViewSystem.ViewNode("S"+Math.random(),"BaseContainer",{}));var ImageProfile=new _ViewSystem.Node("SS"+Math.random(),{width:34,height:34},new _ViewSystem.ViewNode("S"+Math.random(),"Image",{source:require("../Image/assets/profile.png"),width:32,height:32}));var ImageWrapper=new _ViewSystem.Node("SS"+Math.random(),{flexDirection:"row",justifyContent:"center",alignItems:'center',height:40},new _ViewSystem.ViewNode("S"+Math.random(),"BaseContainer",{}));var UserWrapper=new _ViewSystem.Node("SS"+Math.random(),{flexDirection:"column",height:40,flexGrow:1},new _ViewSystem.ViewNode("S"+Math.random(),"BaseContainer",{}));var user=new _ViewSystem.Node("SS"+Math.random(),{height:20},new _ViewSystem.ViewNode("S"+Math.random(),"Text",{text:"Alexandra papadopoulou ",color:"rgba(112, 112, 112, 1)",fontSize:14,fontFamily:"thin"}));var userjob=new _ViewSystem.Node("SS"+Math.random(),{height:20},new _ViewSystem.ViewNode("S"+Math.random(),"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(base2.id))CurrentView.addViewNode(base2,node);if(!CurrentView.has(Image1.id))CurrentView.addViewNode(Image1,base1);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(subtitle.id)){CurrentView.addViewNode(subtitle,base2);}if(!CurrentView.has(wrapperProfile.id)){CurrentView.addViewNode(wrapperProfile,base2);}if(!CurrentView.has(ImageWrapper))CurrentView.addViewNode(ImageWrapper,wrapperProfile);if(!CurrentView.has(ImageProfile))CurrentView.addViewNode(ImageProfile,ImageWrapper);if(!CurrentView.has(UserWrapper))CurrentView.addViewNode(UserWrapper,wrapperProfile);if(!CurrentView.has(user))CurrentView.addViewNode(user,UserWrapper);if(!CurrentView.has(userjob)){CurrentView.addViewNode(userjob,UserWrapper);this.props.CoreSystem.forceUpdate();};if(!CurrentView.has(MainText.id)){CurrentView.addViewNode(MainText,base2);this.props.CoreSystem.forceUpdate();}}}},{key:"display",value:function display(){return _react["default"].createElement(_reactNative.View,{__source:{fileName:_jsxFileName,lineNumber:104}});}}]);return BlogFeed;}(_Module2["default"]);exports["default"]=BlogFeed;BlogFeed.Inputs={};