@replyke/ui-core-react-native
Version:
Replyke: Build interactive apps with social features like comments, votes, feeds, user lists, notifications, and more.
25 lines • 1.17 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { View, Text, TouchableOpacity, } from "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 (_jsxs(View, { style: style, children: [disabled ? (_jsx(View, { style: { ...baseStyle, opacity: 0.5, pointerEvents: "none" }, children: _jsx(Text, { style: textStyle, children: submitting ? activeText : text }) })) : (_jsx(TouchableOpacity, { onPress: onPress, style: baseStyle, children: _jsx(Text, { style: textStyle, children: submitting ? activeText : text }) })), error && _jsx(Text, { style: errorStyle, children: error })] }));
};
export default CustomButton;
//# sourceMappingURL=CustomButton.js.map