diff --git a/src/components/layout/HeaderFirstLevel.tsx b/src/components/layout/HeaderFirstLevel.tsx index 14ab6bdc..0509d145 100644 --- a/src/components/layout/HeaderFirstLevel.tsx +++ b/src/components/layout/HeaderFirstLevel.tsx @@ -26,47 +26,16 @@ import { HStack } from "../stack"; import { H3 } from "../typography"; import { HeaderActionProps } from "./common"; -type CommonProps = WithTestID<{ +export type HeaderFirstLevel = WithTestID<{ title: string; - // This Prop will be removed once all the screens on the first level routing will be refactored - backgroundColor?: "light" | "dark"; - ignoreSafeAreaMargin?: boolean; + firstAction: HeaderActionProps; + secondAction: HeaderActionProps; + thirdAction?: HeaderActionProps; animatedRef?: AnimatedRef; animatedFlatListRef?: AnimatedRef>; + ignoreSafeAreaMargin?: boolean; }>; -interface Base extends CommonProps { - type: "base"; - firstAction?: never; - secondAction?: never; - thirdAction?: never; -} - -interface OneAction extends CommonProps { - type: "singleAction"; - firstAction: HeaderActionProps; - secondAction?: never; - thirdAction?: never; -} - -interface TwoActions extends CommonProps { - type: "twoActions"; - firstAction: HeaderActionProps; - secondAction: HeaderActionProps; - thirdAction?: never; -} - -interface ThreeActions extends CommonProps { - type: "threeActions"; - firstAction: HeaderActionProps; - secondAction: HeaderActionProps; - thirdAction: HeaderActionProps; -} - -export type HeaderFirstLevel = Base | OneAction | TwoActions | ThreeActions; - -const HEADER_BG_COLOR_DARK: IOColors = "bluegrey"; - const styles = StyleSheet.create({ headerInner: { paddingHorizontal: IOVisualCostants.appMarginDefault, @@ -88,9 +57,7 @@ const styles = StyleSheet.create({ export const HeaderFirstLevel = ({ title, - type, testID, - backgroundColor = "light", firstAction, secondAction, thirdAction, @@ -135,12 +102,7 @@ export const HeaderFirstLevel = ({ return ( {title} - {type === "threeActions" && ( - - )} - {(type === "twoActions" || type === "threeActions") && ( - - )} - {type !== "base" && ( - - )} + {thirdAction && } + +