(props: HeaderProps)
| 149 | * @returns {JSX.Element} The rendered `Header` component. |
| 150 | */ |
| 151 | export function Header(props: HeaderProps) { |
| 152 | const { |
| 153 | theme: { colors }, |
| 154 | themed, |
| 155 | } = useAppTheme() |
| 156 | const { |
| 157 | backgroundColor = colors.background, |
| 158 | LeftActionComponent, |
| 159 | leftIcon, |
| 160 | leftIconColor, |
| 161 | leftText, |
| 162 | leftTx, |
| 163 | leftTxOptions, |
| 164 | onLeftPress, |
| 165 | onRightPress, |
| 166 | RightActionComponent, |
| 167 | rightIcon, |
| 168 | rightIconColor, |
| 169 | rightText, |
| 170 | rightTx, |
| 171 | rightTxOptions, |
| 172 | safeAreaEdges = ["top"], |
| 173 | title, |
| 174 | titleMode = "center", |
| 175 | titleTx, |
| 176 | titleTxOptions, |
| 177 | titleContainerStyle: $titleContainerStyleOverride, |
| 178 | style: $styleOverride, |
| 179 | titleStyle: $titleStyleOverride, |
| 180 | containerStyle: $containerStyleOverride, |
| 181 | } = props |
| 182 | |
| 183 | const $containerInsets = useSafeAreaInsetsStyle(safeAreaEdges) |
| 184 | |
| 185 | const titleContent = titleTx ? translate(titleTx, titleTxOptions) : title |
| 186 | |
| 187 | return ( |
| 188 | <View style={[$container, $containerInsets, { backgroundColor }, $containerStyleOverride]}> |
| 189 | <View style={[$styles.row, $wrapper, $styleOverride]}> |
| 190 | <HeaderAction |
| 191 | tx={leftTx} |
| 192 | text={leftText} |
| 193 | icon={leftIcon} |
| 194 | iconColor={leftIconColor} |
| 195 | onPress={onLeftPress} |
| 196 | txOptions={leftTxOptions} |
| 197 | backgroundColor={backgroundColor} |
| 198 | ActionComponent={LeftActionComponent} |
| 199 | /> |
| 200 | |
| 201 | {!!titleContent && ( |
| 202 | <View |
| 203 | style={[ |
| 204 | $titleWrapperPointerEvents, |
| 205 | titleMode === "center" && themed($titleWrapperCenter), |
| 206 | titleMode === "flex" && $titleWrapperFlex, |
| 207 | $titleContainerStyleOverride, |
| 208 | ]} |
nothing calls this directly
no test coverage detected