From 4812e503a41cbea540145af0155689c0cc940142 Mon Sep 17 00:00:00 2001 From: leon-morival Date: Fri, 24 Oct 2025 10:29:08 +0200 Subject: [PATCH] fix flash & dropdown --- .../ProjectDropDown/ProjectDropDown.js | 54 ++++++++++++++----- src/navigation/MainStack.js | 34 +++++++++++- 2 files changed, 75 insertions(+), 13 deletions(-) diff --git a/src/components/ProjectDropDown/ProjectDropDown.js b/src/components/ProjectDropDown/ProjectDropDown.js index 7cd2068..f0fb4e6 100644 --- a/src/components/ProjectDropDown/ProjectDropDown.js +++ b/src/components/ProjectDropDown/ProjectDropDown.js @@ -13,6 +13,7 @@ import { Easing, FlatList, Image, + Platform, Pressable, StyleSheet, Text, @@ -24,6 +25,41 @@ import { FONT_FAMILY } from "../../styles/Fonts"; import GradientButton from "../GradientButton"; const BUTTON_BLUR_INTENSITY = 20; +const IS_WEB = Platform.OS === "web"; +const WEB_BLUR_FALLBACK_STYLE = { + backgroundColor: Palette.glass, +}; +const BLUR_VIEW_PROPS = + Platform.OS === "android" + ? { experimentalBlurMethod: "dimezisBlurView" } + : {}; +const toStyleArray = (style) => + Array.isArray(style) ? style : style ? [style] : []; + +const ThemedBlurView = ({ style, children, ...rest }) => { + if (IS_WEB) { + return ( + + {children} + + ); + } + + return ( + + {children} + + ); +}; const defaultFormatDate = (timestamp) => { try { @@ -210,11 +246,7 @@ const ProjectDropDown = ({ }, [dropdownWidth, triggerLayout?.width, triggerWindowLayout]); const dropdownContent = ( - + - + ); return ( @@ -273,9 +305,7 @@ const ProjectDropDown = ({ }, ]} > - - + {isOpen && triggerWindowLayout ? ( @@ -399,7 +429,7 @@ const ProjectRow = ({ style={styles.projectRowPressable} > - + {title} @@ -429,7 +459,7 @@ const ProjectRow = ({ /> )} - + ); }; diff --git a/src/navigation/MainStack.js b/src/navigation/MainStack.js index be92f72..ee12762 100644 --- a/src/navigation/MainStack.js +++ b/src/navigation/MainStack.js @@ -83,7 +83,7 @@ const screenOptions = { const MainStack = createStackNavigator(); -const screens = [ +const baseScreens = [ { name: Routes.Splash, component: Splash }, { name: Routes.Onboarding, component: Onboarding }, { name: Routes.Login, component: Login, title: "Connexion" }, @@ -306,6 +306,38 @@ const screens = [ }, ]; +const transparentSettingsRoutes = new Set([ + Routes.ChangeEmailAddress, + Routes.ChangePassword, + Routes.Notifications, + Routes.Language, +]); + +const screens = baseScreens.map((screen) => { + if (!transparentSettingsRoutes.has(screen.name)) { + return screen; + } + + const existingOptions = screen.options || {}; + return { + ...screen, + options: { + ...existingOptions, + animationEnabled: false, + presentation: "transparentModal", + cardOverlayEnabled: true, + contentStyle: { + ...(existingOptions.contentStyle || {}), + backgroundColor: "transparent", + }, + cardStyle: { + ...(existingOptions.cardStyle || {}), + backgroundColor: "transparent", + }, + }, + }; +}); + export default function Main() { return (