diff --git a/web/src/components/MemoCardDialog.tsx b/web/src/components/MemoCardDialog.tsx index 7b89fc2d0..410cb7b57 100644 --- a/web/src/components/MemoCardDialog.tsx +++ b/web/src/components/MemoCardDialog.tsx @@ -1,3 +1,4 @@ +import copy from "copy-to-clipboard"; import { useState, useEffect, useCallback } from "react"; import { editorStateService, memoService, userService } from "../services"; import { useAppSelector } from "../store"; @@ -109,6 +110,16 @@ const MemoCardDialog: React.FC = (props: Props) => { setMemo(memo); }, []); + const handleCopyMemoLinkBtnClick = () => { + if (memo.visibility === "PRIVATE") { + toastHelper.error("This memo is private only."); + return; + } + + copy(`${window.location.origin}/explore?memoId=${memo.id}`); + toastHelper.success("Copied"); + }; + const handleEditMemoBtnClick = () => { props.destroy(); editorStateService.setEditMemoWithId(memo.id); @@ -152,6 +163,9 @@ const MemoCardDialog: React.FC = (props: Props) => {
<> +