mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
chore: update archived page
This commit is contained in:
@ -2,6 +2,7 @@ import { uniq } from "lodash-es";
|
||||
import { memo, useEffect, useState } from "react";
|
||||
import useCurrentUser from "@/hooks/useCurrentUser";
|
||||
import { useUserStore } from "@/store/v1";
|
||||
import { RowStatus } from "@/types/proto/api/v1/common";
|
||||
import { Memo } from "@/types/proto/api/v1/memo_service";
|
||||
import { Reaction } from "@/types/proto/api/v1/reaction_service";
|
||||
import { User } from "@/types/proto/api/v1/user_service";
|
||||
@ -18,6 +19,7 @@ const MemoReactionListView = (props: Props) => {
|
||||
const currentUser = useCurrentUser();
|
||||
const userStore = useUserStore();
|
||||
const [reactionGroup, setReactionGroup] = useState<Map<string, User[]>>(new Map());
|
||||
const readonly = memo.rowStatus === RowStatus.ARCHIVED;
|
||||
|
||||
useEffect(() => {
|
||||
(async () => {
|
||||
@ -38,7 +40,7 @@ const MemoReactionListView = (props: Props) => {
|
||||
{Array.from(reactionGroup).map(([reactionType, users]) => {
|
||||
return <ReactionView key={`${reactionType.toString()} ${users.length}`} memo={memo} reactionType={reactionType} users={users} />;
|
||||
})}
|
||||
{currentUser && <ReactionSelector memo={memo} />}
|
||||
{!readonly && currentUser && <ReactionSelector memo={memo} />}
|
||||
</div>
|
||||
)
|
||||
);
|
||||
|
Reference in New Issue
Block a user