50 lines
1.2 KiB
TypeScript
50 lines
1.2 KiB
TypeScript
|
|
/**
|
|||
|
|
* 首页 Stack 导航
|
|||
|
|
* 处理首页相关页面:首页、搜索等
|
|||
|
|
*/
|
|||
|
|
import React from 'react';
|
|||
|
|
import { createNativeStackNavigator } from '@react-navigation/native-stack';
|
|||
|
|
import type { HomeStackParamList } from './types';
|
|||
|
|
|
|||
|
|
import { colors } from '../theme';
|
|||
|
|
import { HomeScreen, SearchScreen } from '../screens/home';
|
|||
|
|
|
|||
|
|
const HomeStack = createNativeStackNavigator<HomeStackParamList>();
|
|||
|
|
|
|||
|
|
export function HomeNavigator() {
|
|||
|
|
return (
|
|||
|
|
<HomeStack.Navigator
|
|||
|
|
screenOptions={{
|
|||
|
|
headerStyle: {
|
|||
|
|
backgroundColor: colors.background.paper,
|
|||
|
|
},
|
|||
|
|
headerTintColor: colors.text.primary,
|
|||
|
|
headerTitleStyle: {
|
|||
|
|
fontWeight: '600',
|
|||
|
|
},
|
|||
|
|
headerBackTitle: '',
|
|||
|
|
headerShadowVisible: false,
|
|||
|
|
}}
|
|||
|
|
>
|
|||
|
|
<HomeStack.Screen
|
|||
|
|
name="Home"
|
|||
|
|
component={HomeScreen}
|
|||
|
|
options={{
|
|||
|
|
title: '首页',
|
|||
|
|
headerBackTitle: '',
|
|||
|
|
headerShown: false,
|
|||
|
|
}}
|
|||
|
|
/>
|
|||
|
|
<HomeStack.Screen
|
|||
|
|
name="Search"
|
|||
|
|
component={SearchScreen}
|
|||
|
|
options={{
|
|||
|
|
title: '搜索',
|
|||
|
|
headerBackTitle: '',
|
|||
|
|
headerShown: false,
|
|||
|
|
}}
|
|||
|
|
/>
|
|||
|
|
</HomeStack.Navigator>
|
|||
|
|
);
|
|||
|
|
}
|