- iOS 端集成 HealthKit 日照时间 (TimeInDaylight) 数据获取接口 - 新增 SunlightCard 组件,支持查看今日数据及最近30天历史趋势图表 - 更新统计页和自定义设置页,支持开启/关闭日照卡片 - 优化 HealthDataCard 组件,支持自定义图标组件和副标题显示 - 更新多语言文件及应用版本号至 1.1.6
39 lines
783 B
TypeScript
39 lines
783 B
TypeScript
import { Ionicons } from '@expo/vector-icons';
|
|
import React from 'react';
|
|
import { StyleSheet } from 'react-native';
|
|
import HealthDataCard from './HealthDataCard';
|
|
|
|
interface HeartRateCardProps {
|
|
resetToken: number;
|
|
style?: object;
|
|
heartRate?: number | null;
|
|
}
|
|
|
|
const HeartRateCard: React.FC<HeartRateCardProps> = ({
|
|
resetToken,
|
|
style,
|
|
heartRate
|
|
}) => {
|
|
const heartIcon = (
|
|
<Ionicons name="heart" size={24} color="#EF4444" />
|
|
);
|
|
|
|
return (
|
|
<HealthDataCard
|
|
title="心率"
|
|
value={heartRate !== null && heartRate !== undefined ? Math.round(heartRate).toString() : '--'}
|
|
unit="bpm"
|
|
style={style}
|
|
icon={heartIcon}
|
|
/>
|
|
);
|
|
};
|
|
|
|
const styles = StyleSheet.create({
|
|
container: {
|
|
flex: 1,
|
|
},
|
|
});
|
|
|
|
export default HeartRateCard;
|