mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
1import {useNavigationState} from '@react-navigation/native'
2
3import {getCurrentRoute} from 'lib/routes/helpers'
4
5export function useNavigationTabState() {
6 return useNavigationState(state => {
7 let currentRoute = state ? getCurrentRoute(state).name : 'Home'
8 return {
9 isAtHome: currentRoute === 'Home',
10 isAtSearch: currentRoute === 'Search',
11 isAtNotifications: currentRoute === 'Notifications',
12 isAtMyProfile: currentRoute === 'MyProfile',
13 isAtMessages: currentRoute === 'Messages',
14 }
15 })
16}