From b55409d4215c5e1be26c8c5b0ba04e4656d98c0c Mon Sep 17 00:00:00 2001 From: xfy Date: Thu, 11 Jun 2026 15:47:46 +0800 Subject: [PATCH] fix(comments): remove admin action buttons from public comment item --- src/components/comments/item.rs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/components/comments/item.rs b/src/components/comments/item.rs index daae7ce..439710e 100644 --- a/src/components/comments/item.rs +++ b/src/components/comments/item.rs @@ -1,17 +1,14 @@ use dioxus::prelude::*; -use crate::context::UserContext; use crate::models::comment::PublicComment; use crate::components::comments::section::CommentContext; use crate::components::comments::form::CommentForm; -use crate::components::comments::actions::CommentActions; #[component] pub fn CommentItem(comment: PublicComment, post_id: i32) -> Element { let ctx: CommentContext = use_context(); let mut active_reply = ctx.active_reply; let refresh_trigger = ctx.refresh_trigger; - let user_ctx: UserContext = use_context(); let depth = if comment.parent_id.is_none() && comment.depth > 0 { 0 @@ -21,7 +18,6 @@ pub fn CommentItem(comment: PublicComment, post_id: i32) -> Element { let indent = depth.min(6) * 24; - let is_admin = user_ctx.user.read().as_ref().is_some(); let is_replying = active_reply() == Some(comment.id); let show_reply = depth < 20; @@ -90,9 +86,6 @@ pub fn CommentItem(comment: PublicComment, post_id: i32) -> Element { } } - if is_admin { - CommentActions { comment_id: comment.id, post_id } - } } if is_replying {