优化归档页、图标

This commit is contained in:
anian
2026-07-04 16:56:31 +08:00
parent adb151dc53
commit 70ab5ef059
6 changed files with 34 additions and 42 deletions
@@ -1,7 +1,6 @@
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip";
import useCurrentUser from "@/hooks/useCurrentUser";
import { cn } from "@/lib/utils";
import { State } from "@/types/proto/api/v1/common_pb";
import type { Memo } from "@/types/proto/api/v1/memo_service_pb";
import type { User } from "@/types/proto/api/v1/user_service_pb";
import { formatReactionTooltip, useReactionActions } from "./hooks";
@@ -16,16 +15,15 @@ const ReactionView = (props: Props) => {
const { memo, reactionType, users } = props;
const currentUser = useCurrentUser();
const hasReaction = users.some((user) => currentUser && user.username === currentUser.username);
const readonly = memo.state === State.ARCHIVED;
const { handleReactionClick } = useReactionActions({ memo });
const handleClick = () => {
if (!currentUser || readonly) return;
if (!currentUser) return;
handleReactionClick(reactionType);
};
const isClickable = currentUser && !readonly;
const isClickable = Boolean(currentUser);
return (
<TooltipProvider>