Created
March 5, 2020 18:46
-
-
Save bogoslavskiy/f00087c68a8c3655aba25ff28b9f1a7d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { createStackNavigator } from '@react-navigation/stack'; | |
import { MainStackParams } from './types/MainStackParams'; | |
import { ConversationScreen } from '../screens/ConversationScreen'; | |
import { RegisterPushNotifications } from '../utils/Notifications'; | |
import { useUser } from '../contexts/AuthContext'; | |
const MainStack = createStackNavigator<MainStackParams>(); | |
export const MainStackScreens: React.FC = () => ( | |
<MainStack.Navigator | |
initialRouteName="Conversation" | |
screenOptions={{ | |
headerRightContainerStyle: { | |
right: 6, | |
}, | |
headerLeftContainerStyle: { | |
left: 6, | |
}, | |
}} | |
> | |
<MainStack.Screen | |
name="Conversation" | |
component={ConversationScreen} | |
/> | |
</MainStack.Navigator> | |
); | |
export const WrapperMainStack: React.FC = () => { | |
const user = useUser(); | |
React.useEffect(() => { | |
RegisterPushNotifications(user._id); | |
}, []) | |
return <MainStackScreens />; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment