Changes in background and dark mode
Run Tests on Branches / Detect Changes (push) Successful in 8s
Run Tests on Branches / Backend Tests (push) Has been skipped
Run Tests on Branches / Frontend Tests (push) Has been skipped
Run Tests on Branches / Frontend Mobile Tests (push) Successful in 1m43s

This commit is contained in:
Antoni Nuñez Romeu
2026-07-10 12:41:10 +02:00
parent 02cab5f740
commit d371fd2bb7
3 changed files with 26 additions and 13 deletions
+24 -11
View File
@@ -81,24 +81,34 @@ function RootLayoutInner() {
); );
} }
function ThemedBackground({ children }: { children: React.ReactNode }) {
const { isDark } = useThemeContext();
return (
<ImageBackground
source={isDark ? require('../assets/bg_dark.png') : require('../assets/bg.png')}
style={bgStyles.background}
resizeMode="cover"
imageStyle={bgStyles.backgroundImage}
>
<View style={[bgStyles.overlay, isDark && bgStyles.overlayDark]} />
{children}
</ImageBackground>
);
}
export default function RootLayout() { export default function RootLayout() {
return ( return (
<GestureHandlerRootView style={{ flex: 1 }}> <GestureHandlerRootView style={{ flex: 1 }}>
<ImageBackground
source={require('../assets/bg.png')}
style={bgStyles.background}
resizeMode="cover"
imageStyle={bgStyles.backgroundImage}
>
<View style={bgStyles.overlay} />
<SafeAreaProvider> <SafeAreaProvider>
<QueryClientProvider client={queryClient}> <QueryClientProvider client={queryClient}>
<ThemeProvider> <ThemeProvider>
<RootLayoutInner /> <ThemedBackground>
<RootLayoutInner />
</ThemedBackground>
</ThemeProvider> </ThemeProvider>
</QueryClientProvider> </QueryClientProvider>
</SafeAreaProvider> </SafeAreaProvider>
</ImageBackground>
</GestureHandlerRootView> </GestureHandlerRootView>
); );
} }
@@ -108,10 +118,13 @@ const bgStyles = StyleSheet.create({
flex: 1, flex: 1,
}, },
backgroundImage: { backgroundImage: {
opacity: 0.8, opacity: 0.55,
}, },
overlay: { overlay: {
...StyleSheet.absoluteFillObject, ...StyleSheet.absoluteFillObject,
backgroundColor: 'rgba(255, 252, 245, 0.2)', backgroundColor: 'rgba(255, 252, 245, 0.48)',
},
overlayDark: {
backgroundColor: 'rgba(0, 0, 0, 0.25)',
}, },
}); });
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

+2 -2
View File
@@ -26,7 +26,7 @@ export const colors = {
warning: '#FF9500', warning: '#FF9500',
// Surface // Surface
background: '#fbfbfb', background: 'transparent',
card: '#ffffff', card: '#ffffff',
surfaceLow: '#f2f4f5', surfaceLow: '#f2f4f5',
surface: '#eceeef', surface: '#eceeef',
@@ -72,7 +72,7 @@ export const darkColors = {
warning: '#FF9500', warning: '#FF9500',
// Surface // Surface
background: '#121212', background: 'transparent',
card: '#1e1e1e', card: '#1e1e1e',
surfaceLow: '#2a2a2a', surfaceLow: '#2a2a2a',
surface: '#333333', surface: '#333333',