Signing out with TabBarIOS
Our final step involves adding a sign out page for the user. Using the TabBarIOS
component and the react-native-vector-icons
, we will create a tabbed view that allows the user to sign out.
Let's make some modifications for this to happen. We need to first modify App.js
so that it does the following functions:
- Imports the
TabBarIOS
andreact-native-vector-icons
dependencies - Returns a
TabBarIOS
component in its_renderView
method if the activity indicator is not spinning - Add a
selectedTab
string in theApp
component's state to track which tab is currently chosen, defaulting to theFeedList
component - Has separate functions to render the
FeedList
andLoginPage
components without navigation - Passes the
LoginPage
a callback that executes the_checkLoginStatus
method - Modifies its
container
style to no longer justify nor align any items to the center
Then, modify the LoginPage
component so that its onLogoutFinished
callback will execute _checkLoginStatus
. Import new dependencies...