-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e99bb09
commit 3aa6058
Showing
19 changed files
with
189 additions
and
115 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
37 changes: 37 additions & 0 deletions
37
apps/example/src/Examples/NativeBottomTabsCustomTabBar.tsx
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { Article } from '../Screens/Article'; | ||
import { Albums } from '../Screens/Albums'; | ||
import { Contacts } from '../Screens/Contacts'; | ||
import { Chat } from '../Screens/Chat'; | ||
import { | ||
createNativeBottomTabNavigator, | ||
type BottomTabBarProps, | ||
} from '@bottom-tabs/react-navigation'; | ||
import { BottomTabBar } from '@react-navigation/bottom-tabs'; | ||
import { useSafeAreaInsets } from 'react-native-safe-area-context'; | ||
|
||
const Tab = createNativeBottomTabNavigator(); | ||
|
||
const CustomTabBar = (props: BottomTabBarProps) => { | ||
const insets = useSafeAreaInsets(); | ||
// @ts-ignore Typescript thinks that props don't match but they are actually the same under the hood | ||
return <BottomTabBar insets={insets} {...props} />; | ||
}; | ||
|
||
function NativeBottomTabsCustomTabBar() { | ||
return ( | ||
<Tab.Navigator tabBar={CustomTabBar}> | ||
<Tab.Screen name="Article" component={Article} /> | ||
<Tab.Screen name="Albums" component={Albums} /> | ||
<Tab.Screen name="Contacts" component={Contacts} /> | ||
<Tab.Screen | ||
name="Chat" | ||
component={Chat} | ||
options={{ | ||
tabBarBadge: '3', | ||
}} | ||
/> | ||
</Tab.Navigator> | ||
); | ||
} | ||
|
||
export default NativeBottomTabsCustomTabBar; |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.