File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change 11import { useState , useEffect , useCallback } from 'react' ;
2- import { external , trash , copy } from '@wordpress/icons' ;
2+ import { external , trash , copy , check } from '@wordpress/icons' ;
33import { Icon } from '@wordpress/icons' ;
44import { Spinner } from '@wordpress/components' ;
55import { logger } from '@php-wasm/logger' ;
@@ -98,6 +98,7 @@ export function MenuOverlay({ onClose }: MenuOverlayProps) {
9898 const [ showDeleteButton , setShowDeleteButton ] = useState ( false ) ;
9999 const [ isDeleting , setIsDeleting ] = useState ( false ) ;
100100 const [ showRecoveryButton , setShowRecoveryButton ] = useState ( false ) ;
101+ const [ copiedAppPath , setCopiedAppPath ] = useState < string | null > ( null ) ;
101102
102103 const handlePaste = useCallback (
103104 ( e : ClipboardEvent ) => {
@@ -290,10 +291,22 @@ export function MenuOverlay({ onClose }: MenuOverlayProps) {
290291 app . blueprintUrl
291292 )
292293 ) ;
294+ setCopiedAppPath ( app . path ) ;
295+ setTimeout (
296+ ( ) => setCopiedAppPath ( null ) ,
297+ 2000
298+ ) ;
293299 } }
294300 title = "Copy blueprint"
295301 >
296- < Icon icon = { copy } size = { 16 } />
302+ < Icon
303+ icon = {
304+ copiedAppPath === app . path
305+ ? check
306+ : copy
307+ }
308+ size = { 16 }
309+ />
297310 </ button >
298311 { app . isCustom && (
299312 < button
You can’t perform that action at this time.
0 commit comments