refactor: migrate to Pressable

This commit is contained in:
Satyajit Sahoo
2021-02-22 00:47:04 +01:00
parent 205f297d07
commit f49b0d3a3b
8 changed files with 53 additions and 75 deletions

View File

@@ -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',

View File

@@ -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',