diff --git a/app/globals.css b/app/globals.css index 13e0002..ab13287 100644 --- a/app/globals.css +++ b/app/globals.css @@ -3144,25 +3144,3 @@ a.btn-secondary { flex-wrap: wrap; } } - -/* ===== 继续此消息串(Discourse 风格折叠) ===== */ -.reply-show-more { - display: flex; - align-items: center; - gap: 6px; - margin: 12px 0 4px; - padding: 8px 16px; - background: var(--glass-bg); - border: 1px solid var(--glass-border); - border-radius: var(--radius-sm); - color: var(--primary); - font-size: 13px; - font-weight: 500; - cursor: pointer; - transition: all 0.15s; -} -.reply-show-more:hover { - background: var(--primary); - color: #fff; - border-color: var(--primary); -} diff --git a/components/ReplyList.js b/components/ReplyList.js index 6b5a704..cfe14a7 100644 --- a/components/ReplyList.js +++ b/components/ReplyList.js @@ -94,15 +94,6 @@ export default function ReplyList({ postId, onRefresh }) { // 正在回复的目标回复对象(用于显示 @用户名) const replyToObj = replyTo ? replies.find((x) => x.id === replyTo) : null; - // 回复折叠:根据视口高度动态调整可见条数(至少 3 条) - const [showCount, setShowCount] = useState(3); - const [showAllReplies, setShowAllReplies] = useState(false); - useEffect(() => { - setShowCount(Math.max(3, Math.floor(window.innerHeight / 200))); - }, []); - const visibleReplies = showAllReplies ? replies : replies.slice(-showCount); - const hiddenCount = replies.length - visibleReplies.length; - return ( <>
@@ -112,7 +103,7 @@ export default function ReplyList({ postId, onRefresh }) { {replies.length === 0 ? (
还没有回复,快来发表第一条回复吧
) : ( - visibleReplies.map((r) => { + replies.map((r) => { const rTime = r.created_at ? new Date(r.created_at).toLocaleString('zh-CN') : ''; const nestDepth = Math.min(replyDepths[r.id] || 0, 5); return ( @@ -141,11 +132,6 @@ export default function ReplyList({ postId, onRefresh }) { ); }) )} - {hiddenCount > 0 && ( - - )}