From 0416e1ba4165346c94599ea375649c30ff0faef0 Mon Sep 17 00:00:00 2001 From: Arthur Jamet Date: Wed, 21 Jun 2023 14:48:23 +0100 Subject: [PATCH] Front: Loading View: Use Theme to set background color --- front/components/Loading.tsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/front/components/Loading.tsx b/front/components/Loading.tsx index 7e75c5e..0fd7880 100644 --- a/front/components/Loading.tsx +++ b/front/components/Loading.tsx @@ -1,13 +1,26 @@ import { useTheme } from 'native-base'; import { Center, Spinner } from 'native-base'; +import useColorScheme from '../hooks/colorScheme'; +import { DefaultTheme, DarkTheme } from '@react-navigation/native'; +import { useMemo } from 'react'; const LoadingComponent = () => { const theme = useTheme(); return ; }; const LoadingView = () => { + const colorScheme = useColorScheme(); + const bgColor = useMemo(() => { + switch (colorScheme) { + case 'light': + return DefaultTheme.colors.background; + case 'dark': + return DarkTheme.colors.background; + } + }, [colorScheme]); + return ( -
+
);