nicer toast after upload

Massimo Melina committed Jan 16, 2025 at 19:53 UTC 6490a458cbb7ec740e297dfdf4f3e02ba87fee5e
2 files changed +13 -7
frontend/src/index.scss
+8 -3
@@ -16,9 +16,9 @@
16 --button-text: #eaeaea;
17 --focus-color: #468;
18 --separator: " – "; // fallback
19 - --success: #8c8;
20 - --warning: #cc8;
21 - --error: #c88;
19 + --success: #7c7;
20 + --warning: #cc7;
21 + --error: #c77;
22 @supports (content: "" / "") {
23 --separator: " – " / ""; // skip for screen-reader
24 }
@@ -555,6 +555,11 @@ form label+input { margin-top: .2em; }
555
556 .unauthorized { text-align: center }
557
558 +.toast-content {
559 + a { color: var(--bg); text-decoration: underline; }
560 + .horiz-sep { display: none }
561 +}
562 +
563 #clipBar {
564 position: sticky; bottom: 0;
565 background: var(--bg);
frontend/src/upload.ts
+5 -4
@@ -208,11 +208,12 @@ export function UploadStatus({ snapshot, ...props }: { snapshot?: INTERNAL_Snaps
208 const msgDone = done.length > 0 && t('upload_finished', { n: done.length, size: formatBytes(doneByte) }, "{n} finished ({size})")
209 const msgSkipped = skipped.length > 0 && t('upload_skipped', { n: skipped.length }, "{n} skipped")
210 const msgErrors = errors.length > 0 && t('upload_errors', { n: errors.length }, "{n} failed")
211 - const s = [msgDone, msgSkipped, msgErrors].filter(Boolean).join(' – ')
212 - if (!s) return null
211 + const msg = [msgDone, msgSkipped, msgErrors].filter(Boolean).join(' – ')
212 + if (!msg) return null
213 + const sep = h('span', { className: 'horiz-sep' }, ' – ')
214 return h('div', { style: { ...props } },
214 - s, ' – ', h(Btn, { label: t`Show details`, asText: true, onClick: showDetails }),
215 - ' – ', h(Btn, {
215 + msg, sep, h(Btn, { label: t`Show details`, asText: true, onClick: showDetails }),
216 + sep, h(Btn, {
217 label: t('copy_links', "Copy links"),
218 asText: true,
219 successFeedback: true,