UNPKG

modo-mobile

Version:

A mobile UI toolkit, based on React

32 lines (26 loc) 1.1 kB
import _extends from 'babel-runtime/helpers/extends'; import _classCallCheck from 'babel-runtime/helpers/classCallCheck'; import _createClass from 'babel-runtime/helpers/createClass'; import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn'; import _inherits from 'babel-runtime/helpers/inherits'; import * as React from 'react'; var View = function (_React$Component) { _inherits(View, _React$Component); function View() { _classCallCheck(this, View); return _possibleConstructorReturn(this, (View.__proto__ || Object.getPrototypeOf(View)).apply(this, arguments)); } _createClass(View, [{ key: 'render', value: function render() { var style = this.props.hasOwnProperty('show') && !this.props.show && { display: 'none' }; return React.cloneElement(React.Children.only(this.props.children), { style: _extends({}, this.props.children.props.style, style) }); } }]); return View; }(React.Component); export default View;