import { ImageSourcePropType } from 'react-native'; import { border, BorderProps, color, ColorProps, composeRestyleFunctions, ResponsiveValue, useRestyle } from '@shopify/restyle'; import { AppImage } from './AppImage'; import { AppSvgImage } from './AppSvgImage'; import { AppBox } from '../layout'; import { AppTheme, useAppTheme } from '~/view/theme'; type Props = { uri?: ImageSourcePropType; placeholder?: ImageSourcePropType; background?: ResponsiveValue; borderRadius?: ResponsiveValue; size?: number; }; const restyleFunctions = composeRestyleFunctions< AppTheme, ColorProps & BorderProps >([color, border]); export const AppProfileImage = ({ uri, placeholder, background, borderRadius, size }: Props) => { const { otherSizes, colors } = useAppTheme(); const props: any = useRestyle(restyleFunctions as any, { color: background, borderRadius }); const style: any = props.style[0]; const colorValue = style['color']; const borderRadiusValue = style['borderRadius']; return uri ? ( ) : ( ); };