Files
digital-pilates/components/MoodCard.tsx
richarjiang a7607e0f74 feat: 添加心情记录功能
在统计页面新增心情卡片和弹窗组件,支持用户记录和查看每日心情状态。
2025-08-21 15:34:47 +08:00

76 lines
1.6 KiB
TypeScript

import React from 'react';
import { StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import { ThemedText } from './ThemedText';
import { ThemedView } from './ThemedView';
interface MoodCardProps {
onPress: () => void;
}
export function MoodCard({ onPress }: MoodCardProps) {
return (
<ThemedView style={styles.container}>
<View style={styles.header}>
<ThemedText style={styles.title}></ThemedText>
<ThemedText style={styles.subtitle}></ThemedText>
</View>
<TouchableOpacity style={styles.content} onPress={onPress}>
<View style={styles.moodIcon}>
<Text style={styles.emoji}>😊</Text>
</View>
<ThemedText style={styles.moodText}></ThemedText>
</TouchableOpacity>
</ThemedView>
);
}
const styles = StyleSheet.create({
container: {
backgroundColor: '#fff',
borderRadius: 16,
padding: 16,
marginBottom: 16,
shadowColor: '#000',
shadowOffset: {
width: 0,
height: 2,
},
shadowOpacity: 0.1,
shadowRadius: 3.84,
elevation: 5,
},
header: {
marginBottom: 12,
},
title: {
fontSize: 18,
fontWeight: '600',
marginBottom: 4,
},
subtitle: {
fontSize: 14,
opacity: 0.6,
},
content: {
flexDirection: 'row',
alignItems: 'center',
paddingVertical: 8,
},
moodIcon: {
width: 40,
height: 40,
borderRadius: 20,
backgroundColor: '#f0f0f0',
justifyContent: 'center',
alignItems: 'center',
marginRight: 12,
},
emoji: {
fontSize: 20,
},
moodText: {
fontSize: 16,
flex: 1,
},
});