|
|
|
@ -1,4 +1,3 @@
|
|
|
|
|
import copy from "copy-to-clipboard";
|
|
|
|
|
import dayjs from "dayjs";
|
|
|
|
|
import { useEffect, useState } from "react";
|
|
|
|
|
import { useTranslation } from "react-i18next";
|
|
|
|
@ -7,9 +6,7 @@ import { memoService } from "../services";
|
|
|
|
|
import { UNKNOWN_ID } from "../helpers/consts";
|
|
|
|
|
import { useAppSelector } from "../store";
|
|
|
|
|
import useLoading from "../hooks/useLoading";
|
|
|
|
|
import Icon from "../components/Icon";
|
|
|
|
|
import toastHelper from "../components/Toast";
|
|
|
|
|
import Dropdown from "../components/common/Dropdown";
|
|
|
|
|
import MemoContent from "../components/MemoContent";
|
|
|
|
|
import MemoResources from "../components/MemoResources";
|
|
|
|
|
import "../less/memo-detail.less";
|
|
|
|
@ -48,11 +45,6 @@ const MemoDetail = () => {
|
|
|
|
|
}
|
|
|
|
|
}, [location]);
|
|
|
|
|
|
|
|
|
|
const handleCopyContent = () => {
|
|
|
|
|
copy(state.memo.content);
|
|
|
|
|
toastHelper.success(t("message.succeed-copy-content"));
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<section className="page-wrapper memo-detail">
|
|
|
|
|
<div className="page-container">
|
|
|
|
@ -87,20 +79,6 @@ const MemoDetail = () => {
|
|
|
|
|
@{state.memo.creator.nickname || state.memo.creator.username}
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
<Dropdown
|
|
|
|
|
trigger={<Icon.MoreHorizontal className="ml-2 w-4 h-auto cursor-pointer text-gray-500" />}
|
|
|
|
|
actionsClassName="!w-32"
|
|
|
|
|
actions={
|
|
|
|
|
<>
|
|
|
|
|
<button
|
|
|
|
|
className="w-full flex flex-row justify-start items-center px-3 whitespace-nowrap text-sm text-left leading-8 cursor-pointer rounded hover:bg-gray-100"
|
|
|
|
|
onClick={handleCopyContent}
|
|
|
|
|
>
|
|
|
|
|
{t("memo.copy")}
|
|
|
|
|
</button>
|
|
|
|
|
</>
|
|
|
|
|
}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<MemoContent className="memo-content" content={state.memo.content} onMemoContentClick={() => undefined} />
|
|
|
|
|
<MemoResources resourceList={state.memo.resourceList} />
|
|
|
|
|