feat(push): integrate Honor and Xiaomi push plugins with related updates
This commit is contained in:
@@ -42,6 +42,7 @@ import { postService, commentService, authService, showPrompt, voteService } fro
|
||||
import { postSyncService } from '@/services/post';
|
||||
import { useCursorPagination } from '../../hooks/useCursorPagination';
|
||||
import { CommentItem, VoteCard, ReportDialog, ShareSheet, PostContentRenderer, PostMentionInput } from '../../components/business';
|
||||
import type { PostMentionInputHandle } from '../../components/business';
|
||||
import { Avatar, Button, Loading, EmptyState, Text, ImageGallery, ImageGrid, ImageGridItem, AdaptiveLayout, AppBackButton } from '../../components/common';
|
||||
import { useResponsive, useResponsiveValue, useResponsiveSpacing } from '../../hooks';
|
||||
import {
|
||||
@@ -1271,10 +1272,22 @@ export const PostDetailScreen: React.FC = () => {
|
||||
// 回复评论
|
||||
const [replyingTo, setReplyingTo] = useState<Comment | null>(null);
|
||||
const [isComposerVisible, setIsComposerVisible] = useState(false);
|
||||
const commentInputRef = useRef<PostMentionInputHandle>(null);
|
||||
|
||||
// 展开编辑器后自动聚焦输入框、唤起键盘,提升回复体验
|
||||
const focusCommentInput = useCallback(() => {
|
||||
// 展开态需要先渲染,延迟一帧再 focus,避免 ref 尚未挂载到真实 TextInput
|
||||
requestAnimationFrame(() => {
|
||||
setTimeout(() => {
|
||||
commentInputRef.current?.focus();
|
||||
}, 60);
|
||||
});
|
||||
}, []);
|
||||
|
||||
const handleReply = (comment: Comment) => {
|
||||
setReplyingTo(comment);
|
||||
setIsComposerVisible(true);
|
||||
focusCommentInput();
|
||||
};
|
||||
|
||||
const handleCancelReply = () => {
|
||||
@@ -1363,6 +1376,7 @@ export const PostDetailScreen: React.FC = () => {
|
||||
|
||||
const openComposer = () => {
|
||||
setIsComposerVisible(true);
|
||||
focusCommentInput();
|
||||
};
|
||||
|
||||
const closeComposer = () => {
|
||||
@@ -1471,6 +1485,7 @@ export const PostDetailScreen: React.FC = () => {
|
||||
|
||||
{/* Text Input —— 小红书风格:无边框、自动扩展 */}
|
||||
<PostMentionInput
|
||||
ref={commentInputRef}
|
||||
value={commentText}
|
||||
onChangeText={setCommentText}
|
||||
onSegmentsChange={setCommentSegments}
|
||||
|
||||
Reference in New Issue
Block a user