mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-05-25 01:32:40 +08:00
36 lines
923 B
TypeScript
36 lines
923 B
TypeScript
import * as React from 'react';
|
|
import { createMaterialTopTabNavigator } from '@react-navigation/material-top-tabs';
|
|
import Albums from '../Shared/Albums';
|
|
import Contacts from '../Shared/Contacts';
|
|
import Chat from '../Shared/Chat';
|
|
|
|
type MaterialTopTabParams = {
|
|
Albums: undefined;
|
|
Contacts: undefined;
|
|
Chat: undefined;
|
|
};
|
|
|
|
const MaterialTopTabs = createMaterialTopTabNavigator<MaterialTopTabParams>();
|
|
|
|
export default function MaterialTopTabsScreen() {
|
|
return (
|
|
<MaterialTopTabs.Navigator>
|
|
<MaterialTopTabs.Screen
|
|
name="Chat"
|
|
component={Chat}
|
|
options={{ title: 'Chat' }}
|
|
/>
|
|
<MaterialTopTabs.Screen
|
|
name="Contacts"
|
|
component={Contacts}
|
|
options={{ title: 'Contacts' }}
|
|
/>
|
|
<MaterialTopTabs.Screen
|
|
name="Albums"
|
|
component={Albums}
|
|
options={{ title: 'Albums' }}
|
|
/>
|
|
</MaterialTopTabs.Navigator>
|
|
);
|
|
}
|