Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add copy button to demo site URL #57

Merged
merged 2 commits into from
Apr 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading