mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-05-22 08:01:56 +08:00
refactor: migrate to Pressable
This commit is contained in:
@@ -24,10 +24,10 @@ const getTabBarIcon = (name: string) => ({
|
||||
}) => <MaterialCommunityIcons name={name} color={color} size={size} />;
|
||||
|
||||
type BottomTabParams = {
|
||||
Article: NavigatorScreenParams<SimpleStackParams>;
|
||||
Albums: undefined;
|
||||
Contacts: undefined;
|
||||
Chat: undefined;
|
||||
TabStack: NavigatorScreenParams<SimpleStackParams>;
|
||||
TabAlbums: undefined;
|
||||
TabContacts: undefined;
|
||||
TabChat: undefined;
|
||||
};
|
||||
|
||||
const BottomTabs = createBottomTabNavigator<BottomTabParams>();
|
||||
@@ -58,7 +58,7 @@ export default function BottomTabsScreen({
|
||||
}}
|
||||
>
|
||||
<BottomTabs.Screen
|
||||
name="Article"
|
||||
name="TabStack"
|
||||
component={SimpleStackScreen}
|
||||
options={{
|
||||
title: 'Article',
|
||||
@@ -66,7 +66,7 @@ export default function BottomTabsScreen({
|
||||
}}
|
||||
/>
|
||||
<BottomTabs.Screen
|
||||
name="Chat"
|
||||
name="TabChat"
|
||||
component={Chat}
|
||||
options={{
|
||||
tabBarLabel: 'Chat',
|
||||
@@ -75,7 +75,7 @@ export default function BottomTabsScreen({
|
||||
}}
|
||||
/>
|
||||
<BottomTabs.Screen
|
||||
name="Contacts"
|
||||
name="TabContacts"
|
||||
component={Contacts}
|
||||
options={{
|
||||
title: 'Contacts',
|
||||
@@ -83,7 +83,7 @@ export default function BottomTabsScreen({
|
||||
}}
|
||||
/>
|
||||
<BottomTabs.Screen
|
||||
name="Albums"
|
||||
name="TabAlbums"
|
||||
component={Albums}
|
||||
options={{
|
||||
title: 'Albums',
|
||||
|
||||
@@ -8,10 +8,10 @@ import Chat from '../Shared/Chat';
|
||||
import SimpleStackScreen, { SimpleStackParams } from './SimpleStack';
|
||||
|
||||
type MaterialBottomTabParams = {
|
||||
Article: NavigatorScreenParams<SimpleStackParams>;
|
||||
Albums: undefined;
|
||||
Contacts: undefined;
|
||||
Chat: undefined;
|
||||
TabStack: NavigatorScreenParams<SimpleStackParams>;
|
||||
TabAlbums: undefined;
|
||||
TabContacts: undefined;
|
||||
TabChat: undefined;
|
||||
};
|
||||
|
||||
const MaterialBottomTabs = createMaterialBottomTabNavigator<MaterialBottomTabParams>();
|
||||
@@ -20,7 +20,7 @@ export default function MaterialBottomTabsScreen() {
|
||||
return (
|
||||
<MaterialBottomTabs.Navigator barStyle={styles.tabBar}>
|
||||
<MaterialBottomTabs.Screen
|
||||
name="Article"
|
||||
name="TabStack"
|
||||
options={{
|
||||
tabBarLabel: 'Article',
|
||||
tabBarIcon: 'file-document',
|
||||
@@ -35,7 +35,7 @@ export default function MaterialBottomTabsScreen() {
|
||||
)}
|
||||
</MaterialBottomTabs.Screen>
|
||||
<MaterialBottomTabs.Screen
|
||||
name="Chat"
|
||||
name="TabChat"
|
||||
component={Chat}
|
||||
options={{
|
||||
tabBarLabel: 'Chat',
|
||||
@@ -45,7 +45,7 @@ export default function MaterialBottomTabsScreen() {
|
||||
}}
|
||||
/>
|
||||
<MaterialBottomTabs.Screen
|
||||
name="Contacts"
|
||||
name="TabContacts"
|
||||
component={Contacts}
|
||||
options={{
|
||||
tabBarLabel: 'Contacts',
|
||||
@@ -54,7 +54,7 @@ export default function MaterialBottomTabsScreen() {
|
||||
}}
|
||||
/>
|
||||
<MaterialBottomTabs.Screen
|
||||
name="Albums"
|
||||
name="TabAlbums"
|
||||
component={Albums}
|
||||
options={{
|
||||
tabBarLabel: 'Albums',
|
||||
|
||||
Reference in New Issue
Block a user