@mundogamernetwork/shared-ui 1.16.8 → 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,24 +125,44 @@ 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="user?.followers_count !== undefined" class="col p-0 d-flex align-items-center stats">
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>
134
155
  </div>
135
156
 
157
+ <!--
158
+ Optional, empty by default — a host with a user-type/role concept
159
+ (jobs-frontend's "Employer"/plan tier, formerly rendered by its own
160
+ now-deleted local HeaderUIUser fork) fills this via
161
+ <template #user-subtitle>; hosts without one render nothing here,
162
+ same as today.
163
+ -->
164
+ <slot name="user-subtitle" />
165
+
136
166
  <div v-if="features.wallet && user?.coins !== null" class="row info-row">
137
167
  <span class="coins">
138
168
  <MGIcon icon="coin-v2" />
@@ -277,6 +307,14 @@ const handleToggleOnline = () => {
277
307
  font-weight: 400;
278
308
  font-size: 0.875rem;
279
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
+ }
280
318
  }
281
319
 
282
320
  .stats {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mundogamernetwork/shared-ui",
3
- "version": "1.16.8",
3
+ "version": "1.16.10",
4
4
  "description": "Mundo Gamer Network - Shared UI Layer (Nuxt 3)",
5
5
  "type": "module",
6
6
  "main": "./nuxt.config.ts",