Skip to content

Commit 01369f5

Browse files
committed
copy button improvements
1 parent 0a1fa97 commit 01369f5

File tree

2 files changed

+51
-3
lines changed

2 files changed

+51
-3
lines changed

internal/dev_server/ui/src/App.css

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,16 @@ code.has-override {
216216
transform: translateX(-50%) translateY(100px);
217217
}
218218

219+
/* Dark mode copy notification styling */
220+
@media (prefers-color-scheme: dark) {
221+
.copy-notification {
222+
background-color: var(--lp-color-blue-700, #1d4ed8);
223+
color: var(--lp-color-gray-100, #f3f4f6);
224+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
225+
}
226+
}
227+
228+
219229
/* Streaming toggle button */
220230
.streaming-toggle-button {
221231
margin-bottom: 16px;
@@ -244,3 +254,40 @@ code.has-override {
244254
.streaming-toggle-button:active {
245255
transform: translateY(1px);
246256
}
257+
258+
/* Copy button styling */
259+
.copy-button {
260+
background: none;
261+
border: none;
262+
color: var(--lp-color-blue-600);
263+
cursor: pointer;
264+
text-decoration: underline;
265+
font-size: var(--lp-font-size-200);
266+
padding: 0;
267+
margin: 0;
268+
transition: color 0.2s ease;
269+
}
270+
271+
.copy-button:hover {
272+
color: var(--lp-color-blue-700);
273+
text-decoration: none;
274+
}
275+
276+
.copy-button:active {
277+
color: var(--lp-color-blue-800);
278+
}
279+
280+
/* Dark mode styling for copy button */
281+
@media (prefers-color-scheme: dark) {
282+
.copy-button {
283+
color: var(--lp-color-blue-400);
284+
}
285+
286+
.copy-button:hover {
287+
color: var(--lp-color-blue-300);
288+
}
289+
290+
.copy-button:active {
291+
color: var(--lp-color-blue-200);
292+
}
293+
}

internal/dev_server/ui/src/EventsTable.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ type Props = {
99

1010
const clipboardLink = (linkText: string, value: string, showNotification: (message: string) => void) => {
1111
return (
12-
<a
13-
href="#"
12+
<button
13+
type="button"
14+
className="copy-button"
1415
onClick={(e) => {
1516
e.preventDefault();
1617
navigator.clipboard.writeText(value).then(() => {
@@ -21,7 +22,7 @@ const clipboardLink = (linkText: string, value: string, showNotification: (messa
2122
}}
2223
>
2324
{linkText}
24-
</a>
25+
</button>
2526
);
2627
}
2728

0 commit comments

Comments
 (0)