chore: add "copy link" for each memo (#1474)

This commit is contained in:
HappyZ
2023-04-05 16:12:12 -07:00
committed by GitHub
parent f48d91539e
commit 609366da6e
18 changed files with 26 additions and 1 deletions

View File

@ -65,6 +65,11 @@ const Memo: React.FC<Props> = (props: Props) => {
toast.success(t("message.succeed-copy-content"));
};
const handleCopyLink = () => {
copy(`${window.location.origin}/m/${memo.id}`);
toast.success(t("message.succeed-copy-link"));
};
const handleTogglePinMemoBtnClick = async () => {
try {
if (memo.pinned) {
@ -233,6 +238,9 @@ const Memo: React.FC<Props> = (props: Props) => {
<span className="btn" onClick={handleCopyContent}>
{t("memo.copy")}
</span>
<span className="btn" onClick={handleCopyLink}>
{t("memo.copy-link")}
</span>
<span className="btn" onClick={handleViewMemoDetailPage}>
{t("memo.view-detail")}
</span>