From 477f9ea0e6a4e28cf63096c299eb9ced791a9c0b Mon Sep 17 00:00:00 2001 From: Innei Date: Thu, 13 Mar 2025 14:48:00 +0800 Subject: [PATCH] refactor(tabbar): update TabBarBackground to include a separator view and remove border styling - Removed borderTopWidth from styles. - Added a new separator view with animated opacity to TabBarBackground for improved visual separation. Signed-off-by: Innei --- .../src/components/layouts/tabbar/Tabbar.tsx | 22 +++++++++++++++---- .../modules/settings/routes/EditCondition.tsx | 4 ++-- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/apps/mobile/src/components/layouts/tabbar/Tabbar.tsx b/apps/mobile/src/components/layouts/tabbar/Tabbar.tsx index c0649aa6e..1ff0598ee 100644 --- a/apps/mobile/src/components/layouts/tabbar/Tabbar.tsx +++ b/apps/mobile/src/components/layouts/tabbar/Tabbar.tsx @@ -16,7 +16,7 @@ import { useSafeAreaInsets } from "react-native-safe-area-context" import { SetBottomTabBarHeightContext } from "@/src/components/layouts/tabbar/contexts/BottomTabBarHeightContext" import { gentleSpringPreset, quickSpringPreset, softSpringPreset } from "@/src/constants/spring" import { PlayerTabBar } from "@/src/modules/player/PlayerTabBar" -import { accentColor, useColor } from "@/src/theme/colors" +import { accentColor } from "@/src/theme/colors" import { ThemedBlurView } from "../../common/ThemedBlurView" import { Grid } from "../../ui/grid" @@ -242,7 +242,6 @@ const styles = StyleSheet.create({ ...StyleSheet.absoluteFillObject, overflow: "hidden", backgroundColor: "transparent", - borderTopWidth: StyleSheet.hairlineWidth, }, icon: { // We render the icon twice at the same position on top of each other: @@ -269,8 +268,23 @@ const TabBarBackground = () => { opacity: opacity.value, ...styles.blurEffect, })) - const borderColor = useColor("opaqueSeparator") - return + const separatorStyle = useAnimatedStyle(() => ({ + opacity: opacity.value, + })) + return ( + + + + + ) } const TabItem = memo( diff --git a/apps/mobile/src/modules/settings/routes/EditCondition.tsx b/apps/mobile/src/modules/settings/routes/EditCondition.tsx index 5732bdf7d..8f1fd628f 100644 --- a/apps/mobile/src/modules/settings/routes/EditCondition.tsx +++ b/apps/mobile/src/modules/settings/routes/EditCondition.tsx @@ -43,7 +43,7 @@ function ConditionForm({ index }: { index: ConditionIndex }) { : undefined return ( - <> + @@ -145,6 +145,6 @@ function ConditionForm({ index }: { index: ConditionIndex }) { {JSON.stringify(item)} )} - + ) }