feat: 添加饮水设置页面,支持每日饮水目标和快速添加默认值的配置

This commit is contained in:
richarjiang
2025-09-05 16:31:52 +08:00
parent 83805a4b07
commit 8d71d751d6
4 changed files with 781 additions and 133 deletions

View File

@@ -1,8 +1,8 @@
import type { BottomTabNavigationOptions } from '@react-navigation/bottom-tabs';
import * as Haptics from 'expo-haptics';
import { Tabs, usePathname } from 'expo-router';
import React from 'react';
import { Text, TouchableOpacity, View, ViewStyle } from 'react-native';
import type { BottomTabNavigationOptions } from '@react-navigation/bottom-tabs';
import { IconSymbol } from '@/components/ui/IconSymbol';
import { Colors } from '@/constants/Colors';
@@ -18,7 +18,7 @@ type TabConfig = {
const TAB_CONFIGS: Record<string, TabConfig> = {
statistics: { icon: 'chart.pie.fill', title: '健康' },
explore: { icon: 'magnifyingglass.circle.fill', title: '发现' },
// explore: { icon: 'magnifyingglass.circle.fill', title: '发现' },
goals: { icon: 'flag.fill', title: '习惯' },
personal: { icon: 'person.fill', title: '个人' },
};
@@ -35,7 +35,7 @@ export default function TabLayout() {
goals: ROUTES.TAB_GOALS,
statistics: ROUTES.TAB_STATISTICS,
};
return routeMap[routeName] === pathname || pathname.includes(routeName);
};
@@ -43,11 +43,11 @@ export default function TabLayout() {
const createTabButton = (routeName: string) => (props: any) => {
const { onPress } = props;
const tabConfig = TAB_CONFIGS[routeName];
if (!tabConfig) return null;
const isSelected = isTabSelected(routeName);
const handlePress = (event: any) => {
if (process.env.EXPO_OS === 'ios') {
Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);