import React from "react"; import { withTheme } from "../core/theming"; import Touchable from "./Touchable"; import { StyleProp, ViewStyle } from "react-native"; import theme from "../styles/DefaultTheme"; type Props = { numColumns?: number; children?: React.ReactNode; onPress?: () => void; style?: StyleProp; theme: typeof theme; }; const getWidth = (numColumns: number) => { switch (numColumns) { case 1: return "33%"; case 2: return "50%"; default: return "100%"; } }; const Card: React.FC = ({ numColumns = 3, children, onPress, style, ...rest }) => { const width = getWidth(numColumns); return ( {children} ); }; export default withTheme(Card);