feat: 更新依赖项并优化组件结构

- 在 package.json 和 package-lock.json 中新增 @sentry/react-native、react-native-device-info 和 react-native-purchases 依赖
- 更新统计页面,替换 CircularRing 组件为 FitnessRingsCard,增强健身数据展示
- 在布局文件中引入 ToastProvider,优化用户通知体验
- 新增 SuccessToast 组件,提供全局成功提示功能
- 更新健康数据获取逻辑,支持健身圆环数据的提取
- 优化多个组件的样式和交互,提升用户体验
This commit is contained in:
richarjiang
2025-08-21 09:51:25 +08:00
parent 19b92547e1
commit 78620f18ee
21 changed files with 2494 additions and 108 deletions

24
utils/native.utils.ts Normal file
View File

@@ -0,0 +1,24 @@
import { Dimensions, StatusBar } from 'react-native';
import DeviceInfo from 'react-native-device-info';
export const getStatusBarHeight = () => {
return StatusBar.currentHeight;
};
export const getDeviceDimensions = () => {
const { width, height } = Dimensions.get('window');
// 检测是否为平板设备
const isTablet = DeviceInfo.isTablet();
// 对于平板设备,使用不同的基准尺寸
const baseWidth = isTablet ? 768 : 375; // iPad 通常使用 768pt 作为宽度基准
const ratio = width / baseWidth;
return {
width,
height,
ratio,
isTablet,
};
};