UX: Replace href cancel with DButton (#31138)

This commit is contained in:
Jordan Vidrine 2025-02-03 16:24:53 -06:00 committed by GitHub
parent 0ad05e022f
commit 585c2b9ed3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 26 additions and 25 deletions

View File

@ -239,25 +239,21 @@
/>
{{#if this.site.mobileView}}
<a
href
{{on "click" this.composer.cancel}}
title={{i18n "cancel"}}
class="cancel"
>
{{#if this.composer.canEdit}}
{{d-icon "xmark"}}
<DButton
@action={{this.composer.cancel}}
class="cancel btn-transparent"
@icon={{if this.composer.canEdit "xmark" "trash-can"}}
@preventFocus={{true}}
@title="close"
/>
{{else}}
{{d-icon "trash-can"}}
{{/if}}
</a>
{{else}}
<a
href
{{on "click" this.composer.cancel}}
class="cancel"
role="button"
>{{i18n "close"}}</a>
<DButton
@action={{this.composer.cancel}}
class="cancel btn-transparent"
@preventFocus={{true}}
@title="close"
@label="close"
/>
{{/if}}
{{#if this.site.mobileView}}

View File

@ -214,7 +214,7 @@ acceptance("Composer", function (needs) {
"supports keyboard shortcuts"
);
await click("#reply-control a.cancel");
await click("#reply-control button.cancel");
assert.dom(".d-modal").exists("pops up a confirmation dialog");
await click(".d-modal__footer .discard-draft");
@ -776,7 +776,7 @@ acceptance("Composer", function (needs) {
await visit("/t/topic-with-whisper/960");
await click(".topic-post:nth-of-type(3) button.reply");
await click("#reply-control .save-or-cancel a.cancel");
await click("#reply-control .save-or-cancel button.cancel");
await click(".topic-footer-main-buttons button.create");
await click(".reply-details summary div");
assert

View File

@ -387,16 +387,22 @@ html.composer-open {
.cancel {
align-items: center;
display: flex;
margin-left: 1.25em;
margin-left: 1em;
line-height: normal;
color: var(--primary-high);
transition: color 250ms;
padding: 0;
&:hover,
&:focus {
outline: none;
color: var(--danger);
}
&:active {
background-color: transparent;
background-image: none;
}
}
.preview-template {

View File

@ -435,8 +435,8 @@
}
.btn-transparent {
&,
&.btn-default {
&.btn-default,
&.btn-text {
background: transparent;
border: 0;
color: var(--primary);

View File

@ -94,10 +94,9 @@
margin-left: 6px;
}
.cancel {
.cancel .d-icon {
font-size: 1.4em;
color: var(--primary-low-mid);
margin-left: 0.6em;
padding: 3px 6px;
}
}