expo-ui-kit-test
Version:
Cross-platform UI kit for Expo/React Native with responsive breakpoints and components.
45 lines (44 loc) • 1.31 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const react_1 = __importDefault(require("react"));
const react_native_1 = require("react-native");
const Button = ({ title, onPress, variant = 'primary', disabled = false }) => {
return (<react_native_1.Pressable onPress={onPress} disabled={disabled} style={({ pressed }) => [
styles.button,
styles[variant],
pressed && styles.pressed,
disabled && styles.disabled
]}>
<react_native_1.Text style={styles.text}>{title}</react_native_1.Text>
</react_native_1.Pressable>);
};
const styles = react_native_1.StyleSheet.create({
button: {
paddingVertical: 12,
paddingHorizontal: 24,
borderRadius: 8,
alignItems: 'center',
justifyContent: 'center',
},
primary: {
backgroundColor: '#007AFF',
},
secondary: {
backgroundColor: '#E0E0E0',
},
pressed: {
opacity: 0.8,
},
disabled: {
opacity: 0.5,
},
text: {
color: '#FFFFFF',
fontSize: 14,
fontWeight: '400',
},
});
exports.default = Button;