UNPKG

create-expo-cljs-app

Version:

Create a react native application with Expo and Shadow-CLJS!

75 lines (64 loc) 2.86 kB
"use strict"; exports.__esModule = true; exports.default = void 0; var React = _interopRequireWildcard(require("react")); var _StyleSheet = _interopRequireDefault(require("../StyleSheet")); var _TouchableOpacity = _interopRequireDefault(require("../TouchableOpacity")); var _Text = _interopRequireDefault(require("../Text")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } /** * Copyright (c) Nicolas Gallagher. * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * */ var Button = /*#__PURE__*/React.forwardRef(function (props, forwardedRef) { var accessibilityLabel = props.accessibilityLabel, color = props.color, disabled = props.disabled, onPress = props.onPress, testID = props.testID, title = props.title; return /*#__PURE__*/React.createElement(_TouchableOpacity.default, { accessibilityLabel: accessibilityLabel, accessibilityRole: "button", disabled: disabled, focusable: !disabled, onPress: onPress, ref: forwardedRef, style: [styles.button, color && { backgroundColor: color }, disabled && styles.buttonDisabled], testID: testID }, /*#__PURE__*/React.createElement(_Text.default, { style: [styles.text, disabled && styles.textDisabled] }, title)); }); Button.displayName = 'Button'; var styles = _StyleSheet.default.create({ button: { backgroundColor: '#2196F3', borderRadius: 2 }, text: { color: '#fff', fontWeight: '500', padding: 8, textAlign: 'center', textTransform: 'uppercase' }, buttonDisabled: { backgroundColor: '#dfdfdf' }, textDisabled: { color: '#a1a1a1' } }); var _default = Button; exports.default = _default; module.exports = exports.default;