UNPKG

react-web-native-sketch

Version:

[TODO: We need an overview of how this can be used via npm vs as a local package]

56 lines 2.47 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __assign = (this && this.__assign) || Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; Object.defineProperty(exports, "__esModule", { value: true }); var React = require("react"); var __1 = require("../../"); var styles = function () { return ({ container: { height: 43, width: '100%', flexDirection: 'column', backgroundColor: '#fff', }, inner: { flex: 1, height: '100%', flexDirection: 'row', padding: __1.appTheme.marginM, }, }); }; var CNativeButton = /** @class */ (function (_super) { __extends(CNativeButton, _super); function CNativeButton() { return _super !== null && _super.apply(this, arguments) || this; } CNativeButton.prototype.render = function () { var _a = this.props, classes = _a.classes, title = _a.title, onPress = _a.onPress, icon = _a.icon, extraItemLeft = _a.extraItemLeft, extraItemRight = _a.extraItemRight; return (React.createElement(__1.Touchable, __assign({}, __1.getTestProps(this.props.testId), { onPress: function () { return onPress(); }, style: classes.container }), React.createElement(__1.View, { style: classes.inner }, React.createElement(__1.Text, null, title), extraItemLeft || null, React.createElement(__1.View, { style: { flex: 1 } }), extraItemRight || null, icon && React.createElement(__1.Image, { source: icon })), React.createElement(__1.View, { style: { height: 1, width: '100%', backgroundColor: '#e2e2e2' } }))); }; return CNativeButton; }(React.PureComponent)); exports.NativeButton = __1.createStyles(styles, 'NativeButton')(CNativeButton); //# sourceMappingURL=NativeButton.js.map