chore: add disable filter to renderer context

This commit is contained in:
Steven
2024-01-18 14:52:57 +08:00
parent d426f89cf0
commit 893dd2c85e
7 changed files with 24 additions and 12 deletions

View File

@ -32,7 +32,7 @@ interface Props {
memo: Memo;
showCreator?: boolean;
showVisibility?: boolean;
showPinnedStyle?: boolean;
showPinned?: boolean;
className?: string;
}
@ -166,7 +166,7 @@ const MemoView: React.FC<Props> = (props: Props) => {
return (
<div
className={classNames("group memo-wrapper", "memos-" + memo.id, memo.pinned && props.showPinnedStyle ? "pinned" : "", className)}
className={classNames("group memo-wrapper", "memos-" + memo.id, memo.pinned && props.showPinned ? "pinned" : "", className)}
ref={memoContainerRef}
>
<div className="memo-top-wrapper mb-1">
@ -189,7 +189,7 @@ const MemoView: React.FC<Props> = (props: Props) => {
<span className="text-sm text-gray-400 select-none" onClick={handleGotoMemoDetailPage}>
{displayTime}
</span>
{props.showPinnedStyle && memo.pinned && (
{props.showPinned && memo.pinned && (
<>
<Icon.Dot className="w-4 h-auto text-gray-400 dark:text-zinc-400" />
<Tooltip title={"Pinned"} placement="top">
@ -217,10 +217,12 @@ const MemoView: React.FC<Props> = (props: Props) => {
</span>
<div className="more-action-btns-wrapper">
<div className="more-action-btns-container min-w-[6em]">
<span className="btn" onClick={handleTogglePinMemoBtnClick}>
{memo.pinned ? <Icon.BookmarkMinus className="w-4 h-auto mr-2" /> : <Icon.BookmarkPlus className="w-4 h-auto mr-2" />}
{memo.pinned ? t("common.unpin") : t("common.pin")}
</span>
{props.showPinned && (
<span className="btn" onClick={handleTogglePinMemoBtnClick}>
{memo.pinned ? <Icon.BookmarkMinus className="w-4 h-auto mr-2" /> : <Icon.BookmarkPlus className="w-4 h-auto mr-2" />}
{memo.pinned ? t("common.unpin") : t("common.pin")}
</span>
)}
<span className="btn" onClick={handleEditMemoClick}>
<Icon.Edit3 className="w-4 h-auto mr-2" />
{t("common.edit")}