优化归档页、图标
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user