UNPKG

@replyke/ui-core-react-native

Version:

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

27 lines 1.43 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const jsx_runtime_1 = require("react/jsx-runtime"); const react_native_1 = require("react-native"); const CustomButton = ({ onPress, text, activeText, error, disabled, style, submitting, }) => { const baseStyle = { backgroundColor: "#60a5fa", paddingHorizontal: 16, paddingVertical: 20, flexDirection: "row", alignItems: "center", justifyContent: "center", borderRadius: 12, }; const textStyle = { fontSize: 18, fontWeight: "500", color: "#ffffff", }; const 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: { ...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