import * as React from 'react'; import type { ImageResizeMode, ImageSourcePropType, ImageStyle, StyleProp, ViewStyle, } from 'react-native'; import Animated, { useAnimatedStyle } from 'react-native-reanimated'; import type { Edge } from 'react-native-safe-area-context'; import { SafeAreaView } from 'react-native-safe-area-context'; import { commonStyles } from '../../../constants'; import type { AnimatedColorProp } from '../../common/SharedProps'; import { parseAnimatedColorProp } from '../../common/utils/parseAnimatedColorProp'; interface HeaderBarProps { backgroundColor?: AnimatedColorProp; enableSafeAreaTopInset?: boolean; logo: ImageSourcePropType; logoContainerStyle?: StyleProp>; logoResizeMode?: ImageResizeMode; logoStyle?: StyleProp>; } export const HeaderBar: React.FC = ({ backgroundColor, enableSafeAreaTopInset, logo, logoResizeMode, logoStyle, logoContainerStyle, }) => { const wrapperAnimatedStyle = useAnimatedStyle(() => { return { // TypeScript complains about AnimatedNode> from reanimated v1 backgroundColor: parseAnimatedColorProp(backgroundColor) as string, }; }, [backgroundColor]); const safeAreaEdges: Edge[] = ['left', 'right']; if (enableSafeAreaTopInset) { safeAreaEdges.push('top'); } return ( // @ts-ignore ); };