File tree Expand file tree Collapse file tree
frontend/src/components/frame Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ const Frame = ({
5454 const dispatch = useDispatch ( ) ;
5555 const [ isFullScreen , setFullScreen ] = useState ( false ) ;
5656 const [ isExpand , setExpand ] = useState ( true ) ;
57-
57+ const [ showCopyPopup , setShowCopyPopup ] = useState ( false ) ;
5858 // const downloadMenu = () => (
5959 // <Menu onClick={(e) => onDownload(e)}>
6060 // <Menu.Item key="png">
@@ -69,6 +69,14 @@ const Frame = ({
6969 // </Menu>
7070 // );
7171
72+ const handleOnClickCopyToEditor = ( ) => {
73+ setShowCopyPopup ( true ) ;
74+ setTimeout ( ( ) => {
75+ setShowCopyPopup ( false ) ;
76+ } , 2000 ) ;
77+ dispatch ( setCommand ( reqString ) ) ;
78+ } ;
79+
7280 return (
7381 < div className = { `${ styles . Frame } ${ isFullScreen ? styles . FullScreen : '' } ` } >
7482 < div className = { styles . FrameHeader } >
@@ -82,11 +90,12 @@ const Frame = ({
8290 title = "copy to editor"
8391 icon = { faClone }
8492 size = "s"
85- onClick = { ( ) => dispatch ( setCommand ( reqString ) ) }
93+ onClick = { handleOnClickCopyToEditor }
8694 style = { {
8795 cursor : 'pointer' ,
8896 } }
8997 />
98+ { showCopyPopup && < div > Copied to editor</ div > }
9099 </ div >
91100 < div className = { styles . ButtonArea } >
92101 { ! isTable && onThick ? (
You can’t perform that action at this time.
0 commit comments