index.js 2.1 KB

1
  1. 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 _Types=_interopRequireDefault(require("../../lib/Types"));var _Module2=_interopRequireDefault(require("../../lib/Module"));var _reactNative=require("react-native");var _jsxFileName="C:\\Users\\Karteri\\Desktop\\Development\\TrapiLib\\modules\\Image\\index.js";var image=require("./assets/default.jpg");var ImageComp=function(_Module){(0,_inherits2.default)(ImageComp,_Module);function ImageComp(props){var _this;(0,_classCallCheck2.default)(this,ImageComp);_this=(0,_possibleConstructorReturn2.default)(this,(0,_getPrototypeOf2.default)(ImageComp).call(this,props));_this.setContainerStyle({marginLeft:0,marginRight:0});return _this;}(0,_createClass2.default)(ImageComp,[{key:"display",value:function display(){var _this$props=this.props,width=_this$props.width,height=_this$props.height,resizeMode=_this$props.resizeMode,source=_this$props.source,borderRadius=_this$props.borderRadius;if(!width)width="100%";return _react.default.createElement(_reactNative.Image,{style:{borderRadius:borderRadius,width:width,height:height,paddingTop:height?'0':'56.25%',minHeight:20,minWidth:20},resizeMode:resizeMode,source:source||image,__source:{fileName:_jsxFileName,lineNumber:23}});}}]);return ImageComp;}(_Module2.default);exports.default=ImageComp;ImageComp.Inputs={source:new _Types.default.Text(),width:new _Types.default.Integer(),height:new _Types.default.Integer(),resizeMode:new _Types.default.Text().require().default('cover'),borderRadius:new _Types.default.Integer()};