From 0175e7b2d5f6ac36aadde6743863ac19593f9e7d Mon Sep 17 00:00:00 2001 From: Nils Date: Fri, 28 Jul 2023 12:53:09 +0200 Subject: [PATCH] Dublicate Functionality from BaseLayout into HeaderithActions Need refactoring --- .../templates/HeaderWithActions.tsx | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/app/src/api/src/ignoreCoverage/KitchenHelper/templates/HeaderWithActions.tsx b/app/src/api/src/ignoreCoverage/KitchenHelper/templates/HeaderWithActions.tsx index d4b1acf..eaf58ba 100644 --- a/app/src/api/src/ignoreCoverage/KitchenHelper/templates/HeaderWithActions.tsx +++ b/app/src/api/src/ignoreCoverage/KitchenHelper/templates/HeaderWithActions.tsx @@ -6,6 +6,7 @@ import {Heading, Text, useContrastText, View} from "native-base"; import {useSynchedDrawerConfig} from "../synchedstate/SynchedState"; import {Navigation} from "../navigation/Navigation"; import {useMyContrastColor} from "../theme/useMyContrastColor"; +import {useProjectColor, useThemedShade} from "kitcheningredients"; export interface AppState{ renderActions?: () => any; @@ -15,9 +16,26 @@ export interface AppState{ showbackbutton?: boolean; backgroundColor?: string textColor?: string, + headerShadeLevel?: number + useProjectHeaderBackgroundColor?: boolean } export const HeaderWithActions: FunctionComponent = (props) => { - const headerBackgroundColor = props?.backgroundColor; + const projectColor = useProjectColor(); + let headerShadeLevel = props?.headerShadeLevel + if(headerShadeLevel===undefined) { + headerShadeLevel = 1; + } + const themedBackgroundColor = useThemedShade(headerShadeLevel); + let headerBackgroundColor = props?.backgroundColor; + + if(!headerBackgroundColor){ + if(props?.useProjectHeaderBackgroundColor){ + headerBackgroundColor = projectColor; + } else { + headerBackgroundColor = themedBackgroundColor + } + } + let headerTextColor = props?.textColor; if(!headerTextColor){ headerTextColor = useMyContrastColor(headerBackgroundColor);