Skip to content

Commit

Permalink
Add copy button to demo site URL (#57)
Browse files Browse the repository at this point in the history
* Add copy button to demo site URL

* Wrap demo site url with CopyTextButton
  • Loading branch information
derekblank committed Apr 29, 2024
1 parent e8abc4d commit 768686e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/components/content-tab-snapshots.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { cx } from '../lib/cx';
import { getIpcApi } from '../lib/get-ipc-api';
import { Badge } from './badge';
import Button from './button';
import { CopyTextButton } from './copy-text-button';
import offlineIcon from './offline-icon';
import ProgressBar from './progress-bar';
import { ScreenshotDemoSite } from './screenshot-demo-site';
Expand Down Expand Up @@ -159,13 +160,13 @@ function SnapshotRow( {
<div className="text-black a8c-subtitle-small demo-site-name">{ selectedSite.name }</div>
<Badge>{ __( 'Demo site' ) }</Badge>
</div>
<Button
className="mt-1 !p-0 h-auto text-a8c-blueberry"
onClick={ () => getIpcApi().openURL( urlWithHTTPS ) }
variant="link"
<CopyTextButton
text={ urlWithHTTPS }
label={ `${ urlWithHTTPS }, ${ __( 'Copy site url to clipboard' ) }` }
copyConfirmation={ __( 'Copied!' ) }
>
{ urlWithHTTPS }
</Button>
</CopyTextButton>
<div className="mt-2 text-a8c-gray-70 whitespace-nowrap overflow-hidden truncate flex-1">
{ sprintf( __( 'Expires in %s' ), countDown ) }
</div>
Expand Down

0 comments on commit 768686e

Please sign in to comment.