feat(Comment): enhance like functionality for comments and replies
Some checks failed
Frontend CI / build-and-push-web (push) Failing after 1m54s
Frontend CI / ota-android (push) Failing after 5m36s
Frontend CI / build-android-apk (push) Failing after 9m3s

- Updated CommentItem component to accept the comment object in the onLike callback, allowing for more detailed like handling.
- Added a like button for replies, improving user interaction with nested comments.
- Refactored handleLikeComment function in PostDetailScreen for optimized state management and error handling during like operations.
- Enhanced SettingsScreen to provide debug information for theme preferences, improving user experience in theme selection.
- Updated themeStore to dynamically manage system theme changes and improve overall theme handling.
This commit is contained in:
lafay
2026-03-26 01:25:42 +08:00
parent 9529ea39c4
commit 405cd271db
6 changed files with 202 additions and 70 deletions

View File

@@ -23,6 +23,7 @@ import {
borderRadius,
useThemePreference,
useSetThemePreference,
useThemeStore,
type AppColors,
} from '../../theme';
import { useAuthStore } from '../../stores';
@@ -204,29 +205,41 @@ export const SettingsScreen: React.FC = () => {
const handleItemPress = (key: string) => {
switch (key) {
case 'theme':
Alert.alert('主题模式', '选择应用界面明暗', [
{ text: '取消', style: 'cancel' },
{
text: '跟随系统',
onPress: () => {
void setThemePreference('system');
case 'theme': {
// 获取调试信息
const { Appearance } = require('react-native');
const systemScheme = Appearance?.getColorScheme?.() || 'undefined';
const resolvedScheme = useThemeStore.getState().resolvedScheme;
const storedPref = useThemeStore.getState().preference;
const storedSystem = useThemeStore.getState().systemScheme;
Alert.alert(
'主题模式',
`选择应用界面明暗\n\n[调试信息]\n系统主题: ${systemScheme}\n存储偏好: ${storedPref}\n存储系统: ${storedSystem}\n实际应用: ${resolvedScheme}`,
[
{ text: '取消', style: 'cancel' },
{
text: '跟随系统',
onPress: () => {
void setThemePreference('system');
},
},
},
{
text: '浅色',
onPress: () => {
void setThemePreference('light');
{
text: '浅色',
onPress: () => {
void setThemePreference('light');
},
},
},
{
text: '深色',
onPress: () => {
void setThemePreference('dark');
{
text: '深色',
onPress: () => {
void setThemePreference('dark');
},
},
},
]);
]
);
break;
}
case 'edit_profile':
router.push(hrefs.hrefProfileEdit());
break;