react-native-ios-utilities
Version:
Utilities for react-native + iOS and wrappers for using swift together with fabric/paper + JSI
53 lines (51 loc) • 1.49 kB
JavaScript
"use strict";
import * as React from 'react';
import { StyleSheet, Text, TouchableOpacity } from 'react-native';
import { Colors } from "../misc/Colors.js";
/**
* ```
* ┌─────────────────────────────┐
* │ Title │
* │ Subtitle │
* └─────────────────────────────┘
* ```
*/
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
export function CardButton(props) {
const buttonColor = props.buttonColor ?? Colors.PURPLE.A200;
return /*#__PURE__*/_jsx(TouchableOpacity, {
style: [props.style, styles.cardButtonContainer, {
backgroundColor: buttonColor
}],
onPress: props.onPress,
children: /*#__PURE__*/_jsxs(React.Fragment, {
children: [/*#__PURE__*/_jsx(Text, {
style: styles.cardButtonTitleText,
children: props.title
}), /*#__PURE__*/_jsx(Text, {
style: styles.cardButtonSubtitleText,
children: props.subtitle
})]
})
});
}
;
const styles = StyleSheet.create({
cardButtonContainer: {
paddingHorizontal: 12,
paddingVertical: 8,
borderRadius: 10,
marginTop: 12
},
cardButtonTitleText: {
color: 'white',
fontSize: 14,
fontWeight: '700'
},
cardButtonSubtitleText: {
fontSize: 13,
color: 'rgba(255,255,255,0.8)',
fontWeight: '400'
}
});
//# sourceMappingURL=CardButton.js.map