import React, { FC, useContext } from 'react'; import { Animated, Platform, StyleSheet } from 'react-native'; import { Image } from '../../Image'; import { Colors } from '../../Consts'; import { ApplicationContext } from '../../Context'; type BackgroundImageViewProps = { useShadowHeader: boolean; headerBackground?: string; heightHeader: number | `${number}%`; opacityBackground: Animated.AnimatedInterpolation; }; const BackgroundImageView: FC = ({ useShadowHeader = true, headerBackground = null, heightHeader, opacityBackground, }) => { const { theme } = useContext(ApplicationContext); if (Platform.OS === 'android') { return ( {headerBackground && ( )} ); } return ( <> {headerBackground && ( )} ); }; export default BackgroundImageView; const styles = StyleSheet.create({ hidden: { position: 'absolute', width: '100%', zIndex: 1, overflow: 'hidden', }, nonHidden: { position: 'absolute', width: '100%', zIndex: 1, }, headerBackground: { width: '100%', height: undefined, position: 'absolute', aspectRatio: 375 / 154, }, dividerHeader: { borderBottomWidth: 1, borderColor: Colors.black_04, }, shadowHeader: { ...Platform.select({ ios: { shadowColor: Colors.black_20, shadowOffset: { width: 3, height: 3, }, shadowOpacity: 0.12, shadowRadius: 10, }, android: { shadowColor: Colors.black_17, shadowOffset: { width: 3, height: 3, }, shadowOpacity: 0.12, shadowRadius: 10, elevation: 10, }, }), }, });