Last active
October 25, 2019 13:24
-
-
Save artyorsh/754aa001580756ccdfdef6faf2e9276a to your computer and use it in GitHub Desktop.
UI Kitten BottomNavigation (Binding React Navigation 5 to Eva Design System)
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 { BottomNavigation, BottomNavigationTab, Divider } from 'react-native-ui-kitten'; | |
import { SafeAreaLayout, SafeAreaLayoutElement, SaveAreaInset } from '@app-components/safe-area-layout.component'; | |
import { LayoutIcon, PersonIcon } from '@app-assets/icons'; | |
export const BottomHomeScreen = (props): SafeAreaLayoutElement => { | |
const onSelect = (index: number): void => { | |
const { [index]: selectedRoute } = props.state.routeNames; | |
props.navigation.navigate(selectedRoute); | |
}; | |
return ( | |
<SafeAreaLayout insets={SaveAreaInset.BOTTOM}> | |
<Divider/> | |
<BottomNavigation | |
appearance='noIndicator' | |
selectedIndex={props.state.index} | |
onSelect={onSelect}> | |
<BottomNavigationTab icon={LayoutIcon} title='TODO'/> | |
<BottomNavigationTab icon={PersonIcon} title='PROFILE'/> | |
</BottomNavigation> | |
</SafeAreaLayout> | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment