Skip to content

Commit 768686e

Browse files
authored
Add copy button to demo site URL (#57)
* Add copy button to demo site URL * Wrap demo site url with CopyTextButton
1 parent e8abc4d commit 768686e

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

‎src/components/content-tab-snapshots.tsx‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { cx } from '../lib/cx';
1717
import { getIpcApi } from '../lib/get-ipc-api';
1818
import { Badge } from './badge';
1919
import Button from './button';
20+
import { CopyTextButton } from './copy-text-button';
2021
import offlineIcon from './offline-icon';
2122
import ProgressBar from './progress-bar';
2223
import { ScreenshotDemoSite } from './screenshot-demo-site';
@@ -159,13 +160,13 @@ function SnapshotRow( {
159160
<div className="text-black a8c-subtitle-small demo-site-name">{ selectedSite.name }</div>
160161
<Badge>{ __( 'Demo site' ) }</Badge>
161162
</div>
162-
<Button
163-
className="mt-1 !p-0 h-auto text-a8c-blueberry"
164-
onClick={ () => getIpcApi().openURL( urlWithHTTPS ) }
165-
variant="link"
163+
<CopyTextButton
164+
text={ urlWithHTTPS }
165+
label={ `${ urlWithHTTPS }, ${ __( 'Copy site url to clipboard' ) }` }
166+
copyConfirmation={ __( 'Copied!' ) }
166167
>
167168
{ urlWithHTTPS }
168-
</Button>
169+
</CopyTextButton>
169170
<div className="mt-2 text-a8c-gray-70 whitespace-nowrap overflow-hidden truncate flex-1">
170171
{ sprintf( __( 'Expires in %s' ), countDown ) }
171172
</div>

0 commit comments

Comments
 (0)