feat: 更新标签页和新增探索页面
- 将标签页中的“首页”改为“探索”,并更新相关逻辑 - 新增探索页面,展示推荐文章和训练计划 - 优化教练页面的导航,确保用户体验一致性 - 移除不再使用的代码,简化项目结构 - 更新路由常量,确保路径管理集中化
This commit is contained in:
@@ -19,7 +19,7 @@ export default function TabLayout() {
|
||||
initialRouteName="coach"
|
||||
screenOptions={({ route }) => {
|
||||
const routeName = route.name;
|
||||
const isSelected = (routeName === 'index' && pathname === ROUTES.TAB_HOME) ||
|
||||
const isSelected = (routeName === 'explore' && pathname === ROUTES.TAB_EXPLORE) ||
|
||||
(routeName === 'coach' && pathname === ROUTES.TAB_COACH) ||
|
||||
(routeName === 'statistics' && pathname === ROUTES.TAB_STATISTICS) ||
|
||||
pathname.includes(routeName);
|
||||
@@ -40,7 +40,7 @@ export default function TabLayout() {
|
||||
// 基于 routeName 设置图标与标题,避免 tabBarIcon 的包装导致文字裁剪
|
||||
const getIconAndTitle = () => {
|
||||
switch (routeName) {
|
||||
case 'index':
|
||||
case 'explore':
|
||||
return { icon: 'magnifyingglass.circle.fill', title: '发现' } as const;
|
||||
case 'coach':
|
||||
return { icon: 'person.3.fill', title: 'Bot' } as const;
|
||||
@@ -157,7 +157,7 @@ export default function TabLayout() {
|
||||
}}
|
||||
/>
|
||||
<Tabs.Screen
|
||||
name="index"
|
||||
name="explore"
|
||||
options={{
|
||||
title: '发现',
|
||||
tabBarIcon: ({ color }) => {
|
||||
|
||||
Reference in New Issue
Block a user