fixed dark theme for big Action button

This commit is contained in:
Clément Le Bihan
2023-04-13 09:17:56 +02:00
parent 50f6fe6851
commit 968ae149a5
+5 -2
View File
@@ -13,6 +13,7 @@ import {
PresenceTransition, PresenceTransition,
} from "native-base"; } from "native-base";
import { StyleProp, ViewStyle } from "react-native"; import { StyleProp, ViewStyle } from "react-native";
import useColorScheme from "../hooks/colorScheme";
type BigActionButtonProps = { type BigActionButtonProps = {
title: string; title: string;
@@ -34,6 +35,8 @@ const BigActionButton = ({
onPress, onPress,
}: BigActionButtonProps) => { }: BigActionButtonProps) => {
const screenSize = useBreakpointValue({ base: "small", md: "big" }); const screenSize = useBreakpointValue({ base: "small", md: "big" });
const colorScheme = useColorScheme();
const isDark = colorScheme === "dark";
return ( return (
<Pressable onPress={onPress} style={style}> <Pressable onPress={onPress} style={style}>
@@ -91,7 +94,7 @@ const BigActionButton = ({
left: "0", left: "0",
width: "100%", width: "100%",
height: "100%", height: "100%",
backgroundColor: "white", backgroundColor: isDark ? "black" : "white",
padding: "10px", padding: "10px",
}} }}
> >
@@ -100,7 +103,7 @@ const BigActionButton = ({
as={iconProvider} as={iconProvider}
name={iconName} name={iconName}
size={screenSize === "small" ? "sm" : "md"} size={screenSize === "small" ? "sm" : "md"}
color="black" color={isDark ? "white" : "black"}
marginRight="10px" marginRight="10px"
/> />
<Heading <Heading