UNPKG

rn-inkpad

Version:

<img src="https://res.cloudinary.com/fercloudinary/image/upload/v1715452841/packages/inkpad-banner_acl0xl.png" />

38 lines (37 loc) 1.84 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.Card = void 0; const react_1 = __importDefault(require("react")); const react_native_1 = require("react-native"); const Ionicons_1 = __importDefault(require("react-native-vector-icons/Ionicons")); const theme_1 = require("../../theme"); const CardButton_1 = require("./CardButton"); const Card = ({ buttons, description, icon, title, theme }) => { const { backgroundColor, iconSize, themeColor, titleColor, titleSize, shadow } = theme || {}; return (<react_native_1.View style={[ theme_1.cardStyles.cardContainer, !!backgroundColor && { backgroundColor }, !!shadow && theme_1.cardStyles.shadow, ]}> <react_native_1.View style={{ ...theme_1.cardStyles.cardContent }}> <Ionicons_1.default name={icon} color={themeColor ?? '#000000'} style={{ ...theme_1.cardStyles.icon }} size={iconSize ?? 25}/> <react_native_1.View> <react_native_1.Text style={[ theme_1.cardStyles.title, { fontSize: titleSize ?? 16 }, !!titleColor && { color: titleColor }, ]}> {title} </react_native_1.Text> <react_native_1.Text style={{ ...theme_1.cardStyles.description }}>{description}</react_native_1.Text> </react_native_1.View> </react_native_1.View> <react_native_1.View style={{ ...theme_1.cardStyles.buttonsContainer }}> {buttons.map((button, idx) => (<CardButton_1.CardButton style={{ ...theme_1.cardStyles.button }} color={themeColor} button={button} key={idx}/>))} </react_native_1.View> </react_native_1.View>); }; exports.Card = Card;