UNPKG

indusbit-test

Version:
40 lines (36 loc) 821 B
import React from "react"; import { View, Text, StyleSheet } from "react-native"; const Card = ({ children, title, cardStyle, titleStyle, contentStyle }) => { return ( <View style={[styles.card, cardStyle]}> {title && <Text style={[styles.title, titleStyle]}>{title}</Text>} <View style={[styles.content, contentStyle]}>{children}</View> </View> ); }; const styles = StyleSheet.create({ card: { backgroundColor: "white", borderRadius: 8, padding: 16, margin: 8, shadowColor: "#000", shadowOffset: { width: 0, height: 2, }, shadowOpacity: 0.1, shadowRadius: 4, elevation: 3, }, title: { fontSize: 18, fontWeight: "bold", marginBottom: 12, color: "#333", }, content: { width: "100%", }, }); export default Card;