UNPKG

replyke-rn

Version:

Replyke React Native components: Build interactive apps with social features like comments, votes, feeds, user lists, notifications, and more.

39 lines 1.92 kB
"use strict"; var __assign = (this && this.__assign) || function () { __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; }; return __assign.apply(this, arguments); }; Object.defineProperty(exports, "__esModule", { value: true }); var jsx_runtime_1 = require("react/jsx-runtime"); var react_native_1 = require("react-native"); var CustomButton = function (_a) { var onPress = _a.onPress, text = _a.text, activeText = _a.activeText, error = _a.error, disabled = _a.disabled, style = _a.style, submitting = _a.submitting; var baseStyle = { backgroundColor: "#60a5fa", paddingHorizontal: 16, paddingVertical: 20, flexDirection: "row", alignItems: "center", justifyContent: "center", borderRadius: 12, }; var textStyle = { fontSize: 18, fontWeight: "500", color: "#ffffff", }; var errorStyle = { color: "#ef4444", marginTop: 4, }; return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: style, children: [disabled ? ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: __assign(__assign({}, baseStyle), { opacity: 0.5, pointerEvents: "none" }), children: (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: textStyle, children: submitting ? activeText : text }) })) : ((0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, { onPress: onPress, style: baseStyle, children: (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: textStyle, children: submitting ? activeText : text }) })), error && (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: errorStyle, children: error })] })); }; exports.default = CustomButton; //# sourceMappingURL=CustomButton.js.map