@mundogamernetwork/shared-ui 1.13.7 → 1.14.3

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.
@@ -11,6 +11,8 @@ const { performLogout } = useLogout();
11
11
  const runtimeConfig = useRuntimeConfig();
12
12
  const accountsBaseUrl = runtimeConfig.public.mgSharedUi?.accountsBaseUrl || runtimeConfig.public.accountsBaseUrl;
13
13
  const features = runtimeConfig.public.mgSharedUi?.features ?? {};
14
+ const pricingUrl = runtimeConfig.public.mgSharedUi?.pricingUrl || "";
15
+ const { locale } = useI18n();
14
16
 
15
17
  const refDiv = ref<HTMLElement | null>(null);
16
18
  const count = ref(0);
@@ -83,7 +85,18 @@ const handleLogout = async () => {
83
85
  <div v-if="!user?.avatar_url" class="no-avatar-wrapper">
84
86
  <MGIcon icon="profile" />
85
87
  </div>
86
- <img v-else :src="user.avatar_url" width="40" height="40" class="round" />
88
+ <img v-else :src="user.avatar_url" width="40" height="40" class="avatar-img" />
89
+ </div>
90
+
91
+ <div v-if="user?.followers_count !== undefined" class="col p-0 d-flex align-items-center stats">
92
+ <div class="col-6 p-0">
93
+ <span class="stat-value">{{ user?.following_count ?? 0 }}</span>
94
+ <span class="stat-label">{{ $t("account_menu.following") }}</span>
95
+ </div>
96
+ <div class="col-6 p-0">
97
+ <span class="stat-value">{{ user?.followers_count ?? 0 }}</span>
98
+ <span class="stat-label">{{ $t("account_menu.followers") }}</span>
99
+ </div>
87
100
  </div>
88
101
  </div>
89
102
 
@@ -93,25 +106,31 @@ const handleLogout = async () => {
93
106
  </div>
94
107
  </div>
95
108
 
96
- <div v-if="user?.followers_count !== undefined" class="row info-row stats">
97
- <div class="col-6 p-0">
98
- <span class="stat-label">{{ $t("account_menu.following") }}</span>
99
- <span class="stat-value">{{ user?.following_count ?? 0 }}</span>
100
- </div>
101
- <div class="col-6 p-0">
102
- <span class="stat-label">{{ $t("account_menu.followers") }}</span>
103
- <span class="stat-value">{{ user?.followers_count ?? 0 }}</span>
104
- </div>
105
- </div>
106
-
107
109
  <div v-if="features.wallet && user?.coins !== null" class="row info-row">
108
110
  <span class="coins">
109
111
  <MGIcon icon="coin-v2" />
110
- {{ Math.floor(user?.coins ?? 0).toLocaleString() }}
112
+ <span class="coins__currency">MGC</span>
113
+ {{ Math.floor(user?.coins ?? 0).toLocaleString(locale) }}
111
114
  </span>
112
115
  </div>
113
116
 
114
- <div v-if="features.statusOnline" class="row info-row">
117
+ <div v-if="features.gamification !== false" class="row info-row gamification-row">
118
+ <MgXpLevelBar compact :mgc-balance="user?.coins ?? null" :show-balance="false" :locale="locale" />
119
+ </div>
120
+
121
+ <div v-if="pricingUrl" class="row info-row">
122
+ <a :href="pricingUrl" class="plans-pricing-link">
123
+ {{ $t("account_menu.buttons.plans_pricing", "Plans & Pricing") }}
124
+ </a>
125
+ </div>
126
+
127
+ <div class="row info-row">
128
+ <a :href="accountsBaseUrl" target="_blank" class="btn btn-primary-outline mt-3">
129
+ {{ $t("account_menu.buttons.manage_account") }}
130
+ </a>
131
+ </div>
132
+
133
+ <div v-if="features.statusOnline" class="row info-row my-3">
115
134
  <div class="status-toggle">
116
135
  <span>{{ $t("account_menu.buttons.show_online") }}</span>
117
136
  <label class="switch">
@@ -121,12 +140,6 @@ const handleLogout = async () => {
121
140
  </div>
122
141
  </div>
123
142
 
124
- <div class="row info-row">
125
- <a :href="accountsBaseUrl" target="_blank" class="btn btn-primary-outline mt-3">
126
- {{ $t("account_menu.buttons.manage_account") }}
127
- </a>
128
- </div>
129
-
130
143
  <slot name="extra-menu-items" />
131
144
 
132
145
  <div class="row info-row my-3">
@@ -214,8 +227,11 @@ const handleLogout = async () => {
214
227
  }
215
228
  }
216
229
 
217
- .round {
218
- border-radius: 100%;
230
+ // MGN is angular by brand decision — no rounded corners anywhere,
231
+ // avatars included, even where a circular crop is the platform norm
232
+ // elsewhere.
233
+ .avatar-img {
234
+ border-radius: 0;
219
235
  }
220
236
 
221
237
  .no-avatar-wrapper {
@@ -224,7 +240,7 @@ const handleLogout = async () => {
224
240
  justify-content: center;
225
241
  height: 40px;
226
242
  width: 40px;
227
- border-radius: 100%;
243
+ border-radius: 0;
228
244
  background: #555;
229
245
  color: var(--ck-highlight-marker-blue);
230
246
 
@@ -242,18 +258,23 @@ const handleLogout = async () => {
242
258
  }
243
259
 
244
260
  .stats {
245
- margin-top: 8px;
246
-
247
- .stat-label {
248
- font-size: 0.75rem;
249
- color: var(--secondary-info-fg);
261
+ > div {
262
+ display: flex;
263
+ flex-direction: column;
264
+ align-items: center;
250
265
  }
251
266
 
252
267
  .stat-value {
253
268
  font-size: 0.875rem;
254
- font-weight: 500;
269
+ font-weight: 600;
270
+ line-height: 1.25rem;
255
271
  color: var(--active);
256
- margin-left: 4px;
272
+ }
273
+
274
+ .stat-label {
275
+ font-size: 0.75rem;
276
+ line-height: 1rem;
277
+ color: var(--secondary-info-fg);
257
278
  }
258
279
  }
259
280
 
@@ -264,6 +285,40 @@ const handleLogout = async () => {
264
285
  font-size: 0.875rem;
265
286
  color: var(--active);
266
287
  margin-top: 8px;
288
+
289
+ &__currency {
290
+ font-size: 0.7rem;
291
+ opacity: 0.65;
292
+ font-weight: 600;
293
+ text-transform: uppercase;
294
+ }
295
+ }
296
+
297
+ .gamification-row {
298
+ padding-left: 0;
299
+ padding-right: 0;
300
+ margin-top: 4px;
301
+ }
302
+
303
+ .plans-pricing-link {
304
+ display: block;
305
+ width: 100%;
306
+ text-align: center;
307
+ font-size: 0.75rem;
308
+ font-weight: 400;
309
+ // Each platform brands this differently (TV's own fork used a fixed
310
+ // lavender tint of its purple, #d297ff, rather than plain body text) —
311
+ // falling through the same accent tokens MgWalletPlanBadge/MgXpLevelBar
312
+ // use lets every front's real accent take over here without a per-front
313
+ // override.
314
+ color: var(--highlight-color, var(--header-active-fg, var(--active)));
315
+ text-decoration: none;
316
+ padding: 4px 0;
317
+ margin-top: 8px;
318
+
319
+ &:hover {
320
+ text-decoration: underline;
321
+ }
267
322
  }
268
323
 
269
324
  .status-toggle {
package/nuxt.config.ts CHANGED
@@ -123,6 +123,11 @@ export default defineNuxtConfig({
123
123
  agencyBaseUrl: "", // VITE_BASE_URL_AGENCY — used for "create your press kit" CTA link
124
124
  accountsBaseUrl: "", // VITE_BASE_ACCOUNTS_URL
125
125
  networkBaseUrl: "", // VITE_BASE_URL_NETWORK (institutional APIs)
126
+ // Per-platform pricing/plans page. Left empty, the account menu's
127
+ // "Plans & Pricing" link is hidden — set it per front (e.g.
128
+ // `${localePath}/pricing`) since each front's plans page lives at a
129
+ // different route.
130
+ pricingUrl: "",
126
131
  features: {
127
132
  chat: true,
128
133
  notifications: true,
@@ -130,6 +135,9 @@ export default defineNuxtConfig({
130
135
  darkMode: true,
131
136
  search: false,
132
137
  statusOnline: true,
138
+ // Account-menu gamification (level/XP bar). Defaults on; a front
139
+ // with no gamification data for its users can set this to false.
140
+ gamification: true,
133
141
  },
134
142
  languages: ["pt-BR", "en", "es", "de", "ro"],
135
143
  protectedRoutes: [] as string[],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mundogamernetwork/shared-ui",
3
- "version": "1.13.7",
3
+ "version": "1.14.3",
4
4
  "description": "Mundo Gamer Network - Shared UI Layer (Nuxt 3)",
5
5
  "type": "module",
6
6
  "main": "./nuxt.config.ts",