Fix Profile link from drawer on Mobile Web (#1437)

* 🗺️ 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 <kerosuppi@gmail.com>
This commit is contained in:
Ansh 2023-09-15 04:40:59 +05:30 committed by GitHub
parent e643c43459
commit 50f811666a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 12 deletions

View file

@ -64,8 +64,13 @@ export const DrawerContent = observer(function DrawerContentImpl() {
const state = navigation.getState()
store.shell.closeDrawer()
if (isWeb) {
// @ts-ignore must be Home, Search, Notifications, or MyProfile
navigation.navigate(tab)
// hack because we have flat navigator for web and MyProfile does not exist on the web navigator -ansh
if (tab === 'MyProfile') {
navigation.navigate('Profile', {name: store.me.handle})
} else {
// @ts-ignore must be Home, Search, Notifications, or MyProfile
navigation.navigate(tab)
}
} else {
const tabState = getTabState(state, tab)
if (tabState === TabState.InsideAtRoot) {