UNPKG

rn-custom-alert-prompt

Version:
24 lines (23 loc) 1.11 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.Button = void 0; const react_1 = __importDefault(require("react")); const react_native_1 = require("react-native"); const useTheme_1 = require("../hooks/useTheme"); const Button = ({ button, buttons = 2, isFirst, theme, appearance, onPress: customPress, }) => { const { text, onPress, textStyle } = button; const { styles, ios } = (0, useTheme_1.useTheme)({ theme, appearance }); return (<react_native_1.TouchableOpacity style={[ styles.button, { borderLeftWidth: ios ? (isFirst ? 0 : buttons <= 2 ? 1 : 0) : 0 }, ios && buttons <= 2 ? styles.flex : null, ]} activeOpacity={0.6} onPress={!!customPress ? customPress : onPress}> <react_native_1.Text style={[{ textAlign: ios ? 'center' : 'right' }, textStyle]}> {text} </react_native_1.Text> </react_native_1.TouchableOpacity>); }; exports.Button = Button;