From 3376ae88663e8e007d228e8fd0738fc0d5841fb4 Mon Sep 17 00:00:00 2001 From: Mostafa Osama <31553087+Battarshuck@users.noreply.github.com> Date: Wed, 19 Jul 2023 19:56:36 +0300 Subject: [PATCH] adding message when pressing the "copy to editor" button --- frontend/src/components/frame/Frame.jsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/frame/Frame.jsx b/frontend/src/components/frame/Frame.jsx index a2ef1b1..9dfd570 100644 --- a/frontend/src/components/frame/Frame.jsx +++ b/frontend/src/components/frame/Frame.jsx @@ -54,7 +54,7 @@ const Frame = ({ const dispatch = useDispatch(); const [isFullScreen, setFullScreen] = useState(false); const [isExpand, setExpand] = useState(true); - + const [showCopyPopup, setShowCopyPopup] = useState(false); // const downloadMenu = () => ( // onDownload(e)}> // @@ -69,6 +69,14 @@ const Frame = ({ // // ); + const handleOnClickCopyToEditor = () => { + setShowCopyPopup(true); + setTimeout(() => { + setShowCopyPopup(false); + }, 2000); + dispatch(setCommand(reqString)); + }; + return (
@@ -82,11 +90,12 @@ const Frame = ({ title="copy to editor" icon={faClone} size="s" - onClick={() => dispatch(setCommand(reqString))} + onClick={handleOnClickCopyToEditor} style={{ cursor: 'pointer', }} /> + {showCopyPopup &&
Copied to editor
}
{!isTable && onThick ? (