From 99c31d56bb45c6e04fe96cff3f14c3ca55fccba4 Mon Sep 17 00:00:00 2001 From: Rajarshee Chatterjee Date: Sun, 26 Jul 2026 12:38:39 +0530 Subject: [PATCH] fix: Use MD3 Outline Variant For Tab Borders --- src/screens/browse/BrowseScreen.tsx | 7 ++----- src/screens/library/LibraryScreen.tsx | 13 ++----------- .../LibraryBottomSheet/LibraryBottomSheet.tsx | 13 ++----------- src/screens/novel/components/NovelBottomSheet.tsx | 2 +- .../ReaderBottomSheet/ReaderBottomSheet.tsx | 8 +++++++- .../SettingsReaderScreen/SettingsReaderScreen.tsx | 12 ++---------- 6 files changed, 16 insertions(+), 39 deletions(-) diff --git a/src/screens/browse/BrowseScreen.tsx b/src/screens/browse/BrowseScreen.tsx index f50e5f1f..9b24f053 100644 --- a/src/screens/browse/BrowseScreen.tsx +++ b/src/screens/browse/BrowseScreen.tsx @@ -1,7 +1,6 @@ import React, { useCallback, useMemo } from 'react'; import { useWindowDimensions } from 'react-native'; import { TabView, type TabBarProps } from 'react-native-tab-view'; -import Color from 'color'; import { useSearch } from '@hooks'; import { useTheme } from '@hooks/persisted'; @@ -77,11 +76,9 @@ const BrowseScreen = ({ navigation }: BrowseScreenProps) => { backgroundColor: theme.surface, elevation: 0, borderBottomWidth: 1, - borderBottomColor: Color(theme.isDark ? '#FFFFFF' : '#000000') - .alpha(0.12) - .string(), + borderBottomColor: theme.outlineVariant, }), - [theme.isDark, theme.surface], + [theme.outlineVariant, theme.surface], ); const androidRipple = useMemo( () => ({ color: theme.rippleColor }), diff --git a/src/screens/library/LibraryScreen.tsx b/src/screens/library/LibraryScreen.tsx index 7e855b09..beea9ec0 100644 --- a/src/screens/library/LibraryScreen.tsx +++ b/src/screens/library/LibraryScreen.tsx @@ -19,7 +19,6 @@ import { SceneRendererProps, TabView, } from 'react-native-tab-view'; -import Color from 'color'; import { SearchbarV2, @@ -201,14 +200,6 @@ const LibraryScreen = ({ navigation }: LibraryScreenProps) => { const searchLower = useMemo(() => searchText.toLowerCase(), [searchText]); - const tabBarBorderColor = useMemo( - () => - Color(theme.isDark ? '#FFFFFF' : '#000000') - .alpha(0.12) - .string(), - [theme.isDark], - ); - const renderTabBar = useCallback( (props: SceneRendererProps & { navigationState: State }) => { return categories.length ? ( @@ -219,7 +210,7 @@ const LibraryScreen = ({ navigation }: LibraryScreenProps) => { style={[ { backgroundColor: theme.surface, - borderBottomColor: tabBarBorderColor, + borderBottomColor: theme.outlineVariant, }, styles.tabBar, ]} @@ -236,7 +227,7 @@ const LibraryScreen = ({ navigation }: LibraryScreenProps) => { styles.tabBar, styles.tabBarIndicator, styles.tabStyle, - tabBarBorderColor, + theme.outlineVariant, theme.primary, theme.rippleColor, theme.secondary, diff --git a/src/screens/library/components/LibraryBottomSheet/LibraryBottomSheet.tsx b/src/screens/library/components/LibraryBottomSheet/LibraryBottomSheet.tsx index f6a4ab45..dddde0e4 100644 --- a/src/screens/library/components/LibraryBottomSheet/LibraryBottomSheet.tsx +++ b/src/screens/library/components/LibraryBottomSheet/LibraryBottomSheet.tsx @@ -8,7 +8,6 @@ import { ViewStyle, } from 'react-native'; import { SceneMap, TabDescriptor, TabView } from 'react-native-tab-view'; -import color from 'color'; import { useLibrarySettings, useTheme } from '@hooks/persisted'; import { getString } from '@i18n/translations'; @@ -186,14 +185,6 @@ const LibraryBottomSheet: React.FC = ({ const layout = useWindowDimensions(); - const borderBottomColor = useMemo( - () => - color(theme.isDark ? '#FFFFFF' : '#000000') - .alpha(0.12) - .string(), - [theme.isDark], - ); - const renderTabBar = useCallback( (props: any) => ( = ({ style={[ { backgroundColor: theme.surfaceContainerLow ?? theme.surface, - borderBottomColor, + borderBottomColor: theme.outlineVariant, }, styles.tabBar, style, @@ -218,7 +209,7 @@ const LibraryBottomSheet: React.FC = ({ theme.surfaceContainerLow, theme.onSurfaceVariant, theme.rippleColor, - borderBottomColor, + theme.outlineVariant, style, ], ); diff --git a/src/screens/novel/components/NovelBottomSheet.tsx b/src/screens/novel/components/NovelBottomSheet.tsx index 77ba4d5e..aaace101 100644 --- a/src/screens/novel/components/NovelBottomSheet.tsx +++ b/src/screens/novel/components/NovelBottomSheet.tsx @@ -244,7 +244,7 @@ const ChaptersSettingsSheet = ({ style={[ { backgroundColor: theme.surfaceContainerLow ?? theme.surface, - borderBottomColor: theme.outline, + borderBottomColor: theme.outlineVariant, }, styles.tabBar, ]} diff --git a/src/screens/reader/components/ReaderBottomSheet/ReaderBottomSheet.tsx b/src/screens/reader/components/ReaderBottomSheet/ReaderBottomSheet.tsx index c8d672cb..eda94875 100644 --- a/src/screens/reader/components/ReaderBottomSheet/ReaderBottomSheet.tsx +++ b/src/screens/reader/components/ReaderBottomSheet/ReaderBottomSheet.tsx @@ -224,7 +224,13 @@ const ReaderBottomSheetV2: React.FC = ({ { [], ); - const tabBarBorderColor = useMemo( - () => - color(theme.isDark ? '#FFFFFF' : '#000000') - .alpha(0.12) - .string(), - [theme.isDark], - ); - const renderTabBar = useCallback( (props: TabBarProps) => ( { styles.tabBar, { backgroundColor: theme.surfaceContainerLow ?? theme.surface, - borderBottomColor: tabBarBorderColor, + borderBottomColor: theme.outlineVariant, }, ]} indicatorStyle={{ backgroundColor: theme.primary }} @@ -258,7 +250,7 @@ const SettingsReaderScreen = () => { /> ), [ - tabBarBorderColor, + theme.outlineVariant, theme.onSurfaceVariant, theme.primary, theme.rippleColor,