Skip to content

Commit 92e61c5

Browse files
authored
fix(filesharing): inline cancel button, fit responsive QR to parent (#222)
* fix(filesharing): inline cancel button inside upload progress box * fix(decrypt): keep responsive Yivi QR inside its parent card
1 parent d5f0df1 commit 92e61c5

2 files changed

Lines changed: 43 additions & 11 deletions

File tree

src/lib/components/filesharing/SendButton.svelte

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,17 @@
364364
stroke-width="3"
365365
></circle>
366366
</svg>
367-
{$_('filesharing.encryptPanel.sending')}
367+
<span class="upload-info-label">
368+
{$_('filesharing.encryptPanel.sending')}
369+
</span>
370+
<button
371+
type="button"
372+
class="cancel-upload-btn"
373+
onclick={onCancelUpload}
374+
disabled={encryptState.selfAborted}
375+
>
376+
{$_('filesharing.cancel')}
377+
</button>
368378
</div>
369379
{#if $retryStatus}
370380
<p class="retry-status" role="status">
@@ -377,14 +387,6 @@
377387
</p>
378388
{/if}
379389
</div>
380-
<button
381-
type="button"
382-
class="crypt-btn crypt-btn-secondary cancel-upload-btn"
383-
onclick={onCancelUpload}
384-
disabled={encryptState.selfAborted}
385-
>
386-
{$_('filesharing.cancel')}
387-
</button>
388390
{:else}
389391
<!-- Normal button -->
390392
<button
@@ -671,9 +673,36 @@
671673
stroke: var(--pg-text);
672674
}
673675
676+
.upload-info-label {
677+
flex: 1;
678+
}
679+
674680
.cancel-upload-btn {
675-
align-self: flex-start;
676-
margin-top: 0.25rem;
681+
all: unset;
682+
box-sizing: border-box;
683+
font-family: var(--pg-font-family);
684+
font-size: var(--pg-font-size-sm);
685+
font-weight: var(--pg-font-weight-medium);
686+
color: var(--pg-on-primary);
687+
background: var(--pg-input-error);
688+
border-radius: var(--pg-border-radius-sm);
689+
padding: 0.4rem 0.9rem;
690+
cursor: pointer;
691+
transition: background 0.2s ease;
692+
}
693+
694+
.cancel-upload-btn:hover:not(:disabled) {
695+
background: color-mix(in srgb, var(--pg-input-error) 85%, black);
696+
}
697+
698+
.cancel-upload-btn:focus-visible {
699+
outline: 2px solid var(--pg-primary);
700+
outline-offset: 2px;
701+
}
702+
703+
.cancel-upload-btn:disabled {
704+
opacity: 0.6;
705+
cursor: not-allowed;
677706
}
678707
679708
.retry-status {

src/lib/components/filesharing/YiviQRCode.svelte

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@
8888
}
8989
9090
.yivi-qr-container.responsive {
91+
width: 100%;
92+
max-width: 330px;
93+
aspect-ratio: 1 / 1;
9194
height: auto;
9295
min-height: 200px;
9396
}

0 commit comments

Comments
 (0)