UNPKG

@kietpt2003/react-native-core-ui

Version:
17 lines (16 loc) 734 B
import { jsx as _jsx } from "react/jsx-runtime"; import { ImageBackground, } from 'react-native'; import FastImage from 'react-native-fast-image'; const CardMedia = (props) => { const { children } = props; if (props.component === 'background') { const { source, resizeMode = 'cover', style } = props; return (_jsx(ImageBackground, { source: source, resizeMode: resizeMode, style: [{ width: '100%' }, style], children: children })); } const { source, resizeMode = 'cover', style } = props; if (!source) return null; return (_jsx(FastImage, { source: source, resizeMode: resizeMode, style: [{ width: '100%' }, style] })); }; CardMedia.displayName = 'CardMedia'; export default CardMedia;