- 在 package.json 和 package-lock.json 中新增 @sentry/react-native、react-native-device-info 和 react-native-purchases 依赖 - 更新统计页面,替换 CircularRing 组件为 FitnessRingsCard,增强健身数据展示 - 在布局文件中引入 ToastProvider,优化用户通知体验 - 新增 SuccessToast 组件,提供全局成功提示功能 - 更新健康数据获取逻辑,支持健身圆环数据的提取 - 优化多个组件的样式和交互,提升用户体验
53 lines
1.1 KiB
TypeScript
53 lines
1.1 KiB
TypeScript
import { MaterialIcons } from '@expo/vector-icons';
|
|
import React from 'react';
|
|
import { StyleSheet, TouchableOpacity } from 'react-native';
|
|
|
|
interface CustomCheckBoxProps {
|
|
checked: boolean;
|
|
onCheckedChange: (checked: boolean) => void;
|
|
size?: number;
|
|
checkedColor?: string;
|
|
uncheckedColor?: string;
|
|
}
|
|
|
|
const CustomCheckBox = (props: CustomCheckBoxProps) => {
|
|
const {
|
|
checked,
|
|
onCheckedChange,
|
|
size = 16,
|
|
checkedColor = '#E91E63',
|
|
uncheckedColor = '#999'
|
|
} = props;
|
|
|
|
return (
|
|
<TouchableOpacity
|
|
style={[styles.container, { width: size + 4, height: size + 4 }]}
|
|
onPress={() => onCheckedChange(!checked)}
|
|
activeOpacity={0.7}
|
|
>
|
|
{checked ? (
|
|
<MaterialIcons
|
|
name="check-box"
|
|
size={size}
|
|
color={checkedColor}
|
|
/>
|
|
) : (
|
|
<MaterialIcons
|
|
name="check-box-outline-blank"
|
|
size={size}
|
|
color={uncheckedColor}
|
|
/>
|
|
)}
|
|
</TouchableOpacity>
|
|
);
|
|
};
|
|
|
|
const styles = StyleSheet.create({
|
|
container: {
|
|
alignItems: 'center',
|
|
justifyContent: 'center',
|
|
marginRight: 8,
|
|
},
|
|
});
|
|
|
|
export default CustomCheckBox; |