From daf6ed724667472dc68c4e783e069d5ed3afce59 Mon Sep 17 00:00:00 2001 From: G Date: Wed, 19 Jun 2024 11:17:11 +0000 Subject: [PATCH] a goBack props that will show a back button if set to true --- src/components/backgrounds/BackgroundWithBeasyIconAndWhiteContentArea.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/backgrounds/BackgroundWithBeasyIconAndWhiteContentArea.tsx b/src/components/backgrounds/BackgroundWithBeasyIconAndWhiteContentArea.tsx index b0d1fea..775ed91 100644 --- a/src/components/backgrounds/BackgroundWithBeasyIconAndWhiteContentArea.tsx +++ b/src/components/backgrounds/BackgroundWithBeasyIconAndWhiteContentArea.tsx @@ -1,10 +1,16 @@ import BeasyLogoIcon from "@components/BeasyLogoIcon"; +import GoBackIconButton from "@components/GoBackIconButton"; import WrapperTopEdgeCurved from "@components/WrapperTopEdgeCurved"; import Box from "@components/bases/Box"; +import { useNavigation } from "@react-navigation/native"; import type { ReactElement } from "react"; import BackgroundDefault from "./BackgroundDefault"; -const BackgroundWithBeasyIconAndWhiteContentArea = ({ children }: { children?: ReactElement }) => { +const BackgroundWithBeasyIconAndWhiteContentArea = ({ + children, + goBack = false, +}: { children?: ReactElement; goBack?: boolean }) => { + const navigation = useNavigation(); return ( + {goBack && navigation.goBack()} />} {children} -- libgit2 0.27.1