* add prebuild command to package.json * add ProfileTab navigator and screen * add prop to remove back button from profile * fix MyProfileTabNavigatorParams type * fix dep array for rendering ProfileHeader * just added ts-ignore * enable opening drawer in profile tab * clean up useNavigationTabState * clean up code * fix hideBackButton code flow
14 lines
483 B
TypeScript
14 lines
483 B
TypeScript
import {useNavigationState} from '@react-navigation/native'
|
|
import {getCurrentRoute} from 'lib/routes/helpers'
|
|
|
|
export function useNavigationTabState() {
|
|
return useNavigationState(state => {
|
|
let currentRoute = state ? getCurrentRoute(state).name : 'Home'
|
|
return {
|
|
isAtHome: currentRoute === 'Home',
|
|
isAtSearch: currentRoute === 'Search',
|
|
isAtNotifications: currentRoute === 'Notifications',
|
|
isAtMyProfile: currentRoute === 'MyProfile',
|
|
}
|
|
})
|
|
}
|