A platform for community discussion. Free, open, simple.
UX: only show red count in IP lookup when greater than 0 (#30584)
Kris1ae341fa3851
diff --git a/app/assets/javascripts/admin/addon/components/ip-lookup.gjs b/app/assets/javascripts/admin/addon/components/ip-lookup.gjsindex 154550e91de..eb5690e1923 100644--- a/app/assets/javascripts/admin/addon/components/ip-lookup.gjs+++ b/app/assets/javascripts/admin/addon/components/ip-lookup.gjs@@ -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}}diff --git a/app/assets/stylesheets/common/admin/admin_base.scss b/app/assets/stylesheets/common/admin/admin_base.scssindex 73f547f40bf..1a93aa429ac 100644--- a/app/assets/stylesheets/common/admin/admin_base.scss+++ b/app/assets/stylesheets/common/admin/admin_base.scss@@ -472,7 +472,9 @@ $mobile-breakpoint: 700px;.count {font-weight: bold;margin-left: 0.25em;- color: var(--danger);+ &.--nonzero {+ color: var(--danger);+ }}}}