UX: only show red count in IP lookup when greater than 0 (#30584)

This commit is contained in:
Kris 2025-01-06 11:58:12 -05:00 committed by GitHub
parent 78e8316cf0
commit 1ae341fa38
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 2 deletions

View File

@ -4,6 +4,7 @@ import { action } from "@ember/object";
import { LinkTo } from "@ember/routing";
import { service } from "@ember/service";
import { htmlSafe } from "@ember/template";
import { gt } from "truth-helpers";
import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner";
import DButton from "discourse/components/d-button";
import avatar from "discourse/helpers/avatar";
@ -204,7 +205,12 @@ export default class IpLookup extends Component {
<dt class="other-accounts">
{{i18n "ip_lookup.other_accounts"}}
<span class="count">{{this.totalOthersWithSameIP}}</span>
<span
class="count
{{if (gt this.totalOthersWithSameIP 0) '--nonzero'}}"
>
{{this.totalOthersWithSameIP}}
</span>
{{#if this.otherAccounts}}
<DButton
@action={{this.deleteOtherAccounts}}

View File

@ -472,7 +472,9 @@ $mobile-breakpoint: 700px;
.count {
font-weight: bold;
margin-left: 0.25em;
color: var(--danger);
&.--nonzero {
color: var(--danger);
}
}
}
}