From 50f811666aa8999bd7c6cf0c823437f23ddce4c6 Mon Sep 17 00:00:00 2001 From: Ansh Date: Fri, 15 Sep 2023 04:40:59 +0530 Subject: Fix Profile link from drawer on Mobile Web (#1437) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🗺️ fix an issue where web devices that see the Drawer couldn't access Profile from said Drawer * fix routes on web * handle profile button active state * add hack for web navigation * fix comment --------- Co-authored-by: Micah Maligie --- src/Navigation.tsx | 5 +++-- src/view/shell/Drawer.tsx | 9 +++++++-- src/view/shell/bottom-bar/BottomBarWeb.tsx | 28 ++++++++++++++++++++-------- 3 files changed, 30 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/Navigation.tsx b/src/Navigation.tsx index dac70dfc7..c16ff3a8c 100644 --- a/src/Navigation.tsx +++ b/src/Navigation.tsx @@ -348,7 +348,6 @@ const MyProfileTabNavigator = observer(function MyProfileTabNavigatorImpl() { component={ProfileScreen} initialParams={{ name: store.me.did, - hideBackButton: true, }} /> {commonScreens(MyProfileTab as typeof HomeTab)} @@ -362,7 +361,9 @@ const MyProfileTabNavigator = observer(function MyProfileTabNavigatorImpl() { */ const FlatNavigator = observer(function FlatNavigatorImpl() { const pal = usePalette('default') - const unreadCountLabel = useStores().me.notifications.unreadCountLabel + const store = useStores() + const unreadCountLabel = store.me.notifications.unreadCountLabel + const title = (page: string) => bskyTitle(page, unreadCountLabel) return ( - {() => ( - - )} + {({isActive}) => { + const Icon = isActive ? UserIconSolid : UserIcon + return ( + + ) + }} ) @@ -107,7 +112,14 @@ const NavItem: React.FC<{ routeName: string }> = ({children, href, routeName}) => { const currentRoute = useNavigationState(getCurrentRoute) - const isActive = isTab(currentRoute.name, routeName) + const store = useStores() + const isActive = + currentRoute.name === 'Profile' + ? isTab(currentRoute.name, routeName) && + (currentRoute.params as CommonNavigatorParams['Profile']).name === + store.me.handle + : isTab(currentRoute.name, routeName) + return ( {children({isActive})} -- cgit 1.4.1