- 实现拍照识别食物功能(集成大语言模型视觉能力) - 实现智能对话功能(集成大语言模型流式输出) - 实现食物记录和卡路里管理功能 - 实现体重记录和统计功能 - 实现健康数据管理页面 - 配置数据库表结构(用户、食物记录、体重记录) - 实现Express后端API路由 - 配置Tab导航和前端页面 - 采用健康运动配色方案
34 lines
719 B
TypeScript
34 lines
719 B
TypeScript
import React from 'react';
|
|
import { Text, TextProps, TextStyle } from 'react-native';
|
|
import { useTheme } from '@/hooks/useTheme';
|
|
import { Typography } from '@/constants/theme';
|
|
|
|
type TypographyVariant = keyof typeof Typography;
|
|
|
|
interface ThemedTextProps extends TextProps {
|
|
variant?: TypographyVariant;
|
|
color?: string;
|
|
}
|
|
|
|
export function ThemedText({
|
|
variant = 'body',
|
|
color,
|
|
style,
|
|
children,
|
|
...props
|
|
}: ThemedTextProps) {
|
|
const { theme } = useTheme();
|
|
const typographyStyle = Typography[variant];
|
|
|
|
const textStyle: TextStyle = {
|
|
...typographyStyle,
|
|
color: color ?? theme.textPrimary,
|
|
};
|
|
|
|
return (
|
|
<Text style={[textStyle, style]} {...props}>
|
|
{children}
|
|
</Text>
|
|
);
|
|
}
|