import React from 'react'; import { StyleProp, StyleSheet, ViewStyle, View } from 'react-native'; import type { Theme } from '../../types'; import { withTheme } from '../../core/theming'; import CardContent from './CardContent'; // TODO: add following props: // onLongPress, // onPress, type Props = React.ComponentPropsWithRef & { children?: React.ReactNode; elevation?: number; style?: StyleProp; theme: Theme; }; const Card = ({ children, elevation: elevationProp = 1, style = {}, theme, ...rest }: Props) => { const elevation = elevationProp * 2; return ( {elevation !== 0 && ( )} {children} ); }; const styles = StyleSheet.create({ wrapper: { flex: 1, position: 'relative', }, inner: { flexGrow: 1, }, card: { borderWidth: 2, flexGrow: 1, }, shadow: { position: 'absolute', }, }); Card.Content = CardContent; export default withTheme(Card);