@mundogamernetwork/shared-ui 1.16.9 → 1.16.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -12,6 +12,16 @@ const authStore = useAuthStore();
|
|
|
12
12
|
const { user, signedIn, showOnline } = storeToRefs(authStore);
|
|
13
13
|
const { performLogout } = useLogout();
|
|
14
14
|
|
|
15
|
+
// Each stat renders independently — a host that only has a "following"
|
|
16
|
+
// concept (e.g. jobs-frontend's "companies followed", with no reverse
|
|
17
|
+
// "who follows me" on a job board) still gets its one number shown,
|
|
18
|
+
// instead of being gated behind the pair like before. When a host has
|
|
19
|
+
// neither, hasStats is false and the row is repurposed below instead of
|
|
20
|
+
// sitting half-empty next to the avatar.
|
|
21
|
+
const hasFollowingCount = computed(() => user.value?.following_count !== undefined);
|
|
22
|
+
const hasFollowersCount = computed(() => user.value?.followers_count !== undefined);
|
|
23
|
+
const hasStats = computed(() => hasFollowingCount.value || hasFollowersCount.value);
|
|
24
|
+
|
|
15
25
|
const runtimeConfig = useRuntimeConfig();
|
|
16
26
|
const accountsBaseUrl = runtimeConfig.public.mgSharedUi?.accountsBaseUrl || runtimeConfig.public.accountsBaseUrl;
|
|
17
27
|
const supportUrl = `${accountsBaseUrl}/account/support/new`;
|
|
@@ -115,19 +125,30 @@ const handleToggleOnline = () => {
|
|
|
115
125
|
<img v-else :src="user.avatar_url" width="40" height="40" class="avatar-img" />
|
|
116
126
|
</div>
|
|
117
127
|
|
|
118
|
-
<div v-if="
|
|
119
|
-
<div class="col-6 p-0">
|
|
128
|
+
<div v-if="hasStats" class="col p-0 d-flex align-items-center stats">
|
|
129
|
+
<div v-if="hasFollowingCount" class="col-6 p-0">
|
|
120
130
|
<span class="stat-value">{{ user?.following_count ?? 0 }}</span>
|
|
121
131
|
<span class="stat-label">{{ $t("account_menu.following") }}</span>
|
|
122
132
|
</div>
|
|
123
|
-
<div class="col-6 p-0">
|
|
133
|
+
<div v-if="hasFollowersCount" class="col-6 p-0">
|
|
124
134
|
<span class="stat-value">{{ user?.followers_count ?? 0 }}</span>
|
|
125
135
|
<span class="stat-label">{{ $t("account_menu.followers") }}</span>
|
|
126
136
|
</div>
|
|
127
137
|
</div>
|
|
138
|
+
|
|
139
|
+
<!--
|
|
140
|
+
No following/followers concept on this host (e.g.
|
|
141
|
+
agency, token, club — nothing plausible found for
|
|
142
|
+
either count) — rather than leave this space reserved
|
|
143
|
+
and blank next to the avatar, show the username here
|
|
144
|
+
instead of in its own row below.
|
|
145
|
+
-->
|
|
146
|
+
<div v-else class="col p-0 d-flex align-items-center">
|
|
147
|
+
<span class="username username--inline">{{ user?.nickname || user?.name }}</span>
|
|
148
|
+
</div>
|
|
128
149
|
</div>
|
|
129
150
|
|
|
130
|
-
<div class="row info-row">
|
|
151
|
+
<div v-if="hasStats" class="row info-row">
|
|
131
152
|
<div class="col p-0 d-flex flex-column">
|
|
132
153
|
<span class="username">{{ user?.nickname || user?.name }}</span>
|
|
133
154
|
</div>
|
|
@@ -286,6 +307,14 @@ const handleToggleOnline = () => {
|
|
|
286
307
|
font-weight: 400;
|
|
287
308
|
font-size: 0.875rem;
|
|
288
309
|
color: var(--active);
|
|
310
|
+
|
|
311
|
+
// Sits beside the avatar instead of its own row below (no
|
|
312
|
+
// following/followers stats to fill that space) — no top
|
|
313
|
+
// margin needed, it's vertically centered by the flex row
|
|
314
|
+
// it's already in.
|
|
315
|
+
&--inline {
|
|
316
|
+
margin-top: 0;
|
|
317
|
+
}
|
|
289
318
|
}
|
|
290
319
|
|
|
291
320
|
.stats {
|