Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Commit

Permalink
[C-296] Persist stack history across bottom tabs (#1939)
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanjeffers committed Sep 16, 2022
1 parent 6705cb5 commit 19381a3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/mobile/src/screens/app-screen/AppScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { useEffect } from 'react'

import { walletActions } from '@audius/common'
import { useAppState } from '@react-native-community/hooks'
import type { BottomTabBarProps } from '@react-navigation/bottom-tabs'
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'
import type { NavigatorScreenParams } from '@react-navigation/native'
import { useDispatch } from 'react-redux'
Expand Down Expand Up @@ -29,6 +30,9 @@ export type AppScreenParamList = {

const Tab = createBottomTabNavigator()

const screenOptions = { headerShown: false }
const tabBar = (props: BottomTabBarProps) => <AppTabBar {...props} />

export const AppScreen = () => {
const dispatch = useDispatch()
const appState = useAppState()
Expand All @@ -40,10 +44,7 @@ export const AppScreen = () => {
}, [appState, dispatch])

return (
<Tab.Navigator
tabBar={(props) => <AppTabBar {...props} />}
screenOptions={{ headerShown: false, unmountOnBlur: true }}
>
<Tab.Navigator tabBar={tabBar} screenOptions={screenOptions}>
<Tab.Screen name='feed' component={FeedTabScreen} />
<Tab.Screen name='trending' component={TrendingTabScreen} />
<Tab.Screen name='explore' component={ExploreTabScreen} />
Expand Down

0 comments on commit 19381a3

Please sign in to comment.