Skip to content

Commit 7c6e8a0

Browse files
committed
Show author on hover
1 parent c9943c8 commit 7c6e8a0

File tree

2 files changed

+51
-5
lines changed

2 files changed

+51
-5
lines changed

packages/playground/personal-wp/src/components/menu-overlay/index.tsx

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useState, useEffect, useCallback } from 'react';
2-
import { external, trash } from '@wordpress/icons';
2+
import { external, trash, copy } from '@wordpress/icons';
33
import { Icon } from '@wordpress/icons';
44
import { Spinner } from '@wordpress/components';
55
import { logger } from '@php-wasm/logger';
@@ -239,9 +239,6 @@ export function MenuOverlay({ onClose }: MenuOverlayProps) {
239239
href={getAppBlueprintUrl(
240240
app.blueprintUrl
241241
)}
242-
title={getBlueprintPreview(
243-
app.blueprintUrl
244-
)}
245242
>
246243
<span className={css.featureIcon}>
247244
<WordPressIcon />
@@ -267,6 +264,20 @@ export function MenuOverlay({ onClose }: MenuOverlayProps) {
267264
</span>
268265
</span>
269266
</a>
267+
<button
268+
className={css.copyButton}
269+
onClick={(e) => {
270+
e.preventDefault();
271+
navigator.clipboard.writeText(
272+
getBlueprintPreview(
273+
app.blueprintUrl
274+
)
275+
);
276+
}}
277+
title="Copy blueprint"
278+
>
279+
<Icon icon={copy} size={16} />
280+
</button>
270281
{app.isCustom && (
271282
<button
272283
className={css.removeButton}

packages/playground/personal-wp/src/components/menu-overlay/style.module.css

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,12 @@
190190

191191
.author {
192192
color: #6b7280;
193+
opacity: 0;
194+
transition: opacity 0.15s ease;
195+
}
196+
197+
.appRow:hover .author {
198+
opacity: 1;
193199
}
194200

195201
.appRow {
@@ -202,13 +208,42 @@
202208
min-width: 0;
203209
}
204210

211+
.copyButton {
212+
display: flex;
213+
align-items: center;
214+
justify-content: center;
215+
width: 28px;
216+
height: 28px;
217+
background: none;
218+
border: none;
219+
border-radius: 6px;
220+
color: #9ca3af;
221+
cursor: pointer;
222+
flex-shrink: 0;
223+
opacity: 0;
224+
transition: all 0.15s ease;
225+
}
226+
227+
.copyButton svg {
228+
fill: currentColor;
229+
}
230+
231+
.appRow:hover .copyButton {
232+
opacity: 1;
233+
}
234+
235+
.copyButton:hover {
236+
background: rgba(56, 88, 233, 0.15);
237+
color: #3858e9;
238+
}
239+
205240
.removeButton {
206241
display: flex;
207242
align-items: center;
208243
justify-content: center;
209244
width: 28px;
210245
height: 28px;
211-
margin-left: -8px;
246+
margin-left: 4px;
212247
background: none;
213248
border: none;
214249
border-radius: 6px;

0 commit comments

Comments
 (0)