From 968ae149a5b80a9e1c263f18b2c78e4b59396f56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Le=20Bihan?= Date: Thu, 13 Apr 2023 09:17:56 +0200 Subject: [PATCH] fixed dark theme for big Action button --- front/components/BigActionButton.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/front/components/BigActionButton.tsx b/front/components/BigActionButton.tsx index fd3d364..aa19eb2 100644 --- a/front/components/BigActionButton.tsx +++ b/front/components/BigActionButton.tsx @@ -13,6 +13,7 @@ import { PresenceTransition, } from "native-base"; import { StyleProp, ViewStyle } from "react-native"; +import useColorScheme from "../hooks/colorScheme"; type BigActionButtonProps = { title: string; @@ -34,6 +35,8 @@ const BigActionButton = ({ onPress, }: BigActionButtonProps) => { const screenSize = useBreakpointValue({ base: "small", md: "big" }); + const colorScheme = useColorScheme(); + const isDark = colorScheme === "dark"; return ( @@ -91,7 +94,7 @@ const BigActionButton = ({ left: "0", width: "100%", height: "100%", - backgroundColor: "white", + backgroundColor: isDark ? "black" : "white", padding: "10px", }} > @@ -100,7 +103,7 @@ const BigActionButton = ({ as={iconProvider} name={iconName} size={screenSize === "small" ? "sm" : "md"} - color="black" + color={isDark ? "white" : "black"} marginRight="10px" />