@mundogamernetwork/shared-ui 1.13.7 → 1.14.4
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.
- package/components/ui/MgHeaderUIUser.vue +94 -33
- package/nuxt.config.ts +8 -0
- package/package.json +1 -1
|
@@ -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="
|
|
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
|
-
|
|
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.
|
|
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">
|
|
@@ -142,8 +155,14 @@ const handleLogout = async () => {
|
|
|
142
155
|
<style scoped lang="scss">
|
|
143
156
|
.ui-config-user {
|
|
144
157
|
position: absolute;
|
|
145
|
-
|
|
146
|
-
width
|
|
158
|
+
// A fixed width, not width:100%. This is position:absolute, so a
|
|
159
|
+
// percentage width resolves against the nearest positioned ancestor —
|
|
160
|
+
// every real host's profile-icon <li> (32px, position:relative for its
|
|
161
|
+
// own reasons), not the header. width:100% + max-width collapsed the
|
|
162
|
+
// whole dropdown to a 32px sliver pinned off in the corner; nothing
|
|
163
|
+
// caught it before because no front actually rendered this component
|
|
164
|
+
// until the account-menu unification wired all twelve of them to it.
|
|
165
|
+
width: 240px;
|
|
147
166
|
padding: 1rem 0;
|
|
148
167
|
background-color: var(--header-ui-config-bg);
|
|
149
168
|
border: 1px solid var(--header-ui-config-border);
|
|
@@ -154,7 +173,7 @@ const handleLogout = async () => {
|
|
|
154
173
|
transition: all ease 0.5s;
|
|
155
174
|
|
|
156
175
|
&:not(.signed-in) {
|
|
157
|
-
|
|
176
|
+
width: 340px;
|
|
158
177
|
}
|
|
159
178
|
|
|
160
179
|
&__option {
|
|
@@ -214,8 +233,11 @@ const handleLogout = async () => {
|
|
|
214
233
|
}
|
|
215
234
|
}
|
|
216
235
|
|
|
217
|
-
|
|
218
|
-
|
|
236
|
+
// MGN is angular by brand decision — no rounded corners anywhere,
|
|
237
|
+
// avatars included, even where a circular crop is the platform norm
|
|
238
|
+
// elsewhere.
|
|
239
|
+
.avatar-img {
|
|
240
|
+
border-radius: 0;
|
|
219
241
|
}
|
|
220
242
|
|
|
221
243
|
.no-avatar-wrapper {
|
|
@@ -224,7 +246,7 @@ const handleLogout = async () => {
|
|
|
224
246
|
justify-content: center;
|
|
225
247
|
height: 40px;
|
|
226
248
|
width: 40px;
|
|
227
|
-
border-radius:
|
|
249
|
+
border-radius: 0;
|
|
228
250
|
background: #555;
|
|
229
251
|
color: var(--ck-highlight-marker-blue);
|
|
230
252
|
|
|
@@ -242,18 +264,23 @@ const handleLogout = async () => {
|
|
|
242
264
|
}
|
|
243
265
|
|
|
244
266
|
.stats {
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
color: var(--secondary-info-fg);
|
|
267
|
+
> div {
|
|
268
|
+
display: flex;
|
|
269
|
+
flex-direction: column;
|
|
270
|
+
align-items: center;
|
|
250
271
|
}
|
|
251
272
|
|
|
252
273
|
.stat-value {
|
|
253
274
|
font-size: 0.875rem;
|
|
254
|
-
font-weight:
|
|
275
|
+
font-weight: 600;
|
|
276
|
+
line-height: 1.25rem;
|
|
255
277
|
color: var(--active);
|
|
256
|
-
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.stat-label {
|
|
281
|
+
font-size: 0.75rem;
|
|
282
|
+
line-height: 1rem;
|
|
283
|
+
color: var(--secondary-info-fg);
|
|
257
284
|
}
|
|
258
285
|
}
|
|
259
286
|
|
|
@@ -264,6 +291,40 @@ const handleLogout = async () => {
|
|
|
264
291
|
font-size: 0.875rem;
|
|
265
292
|
color: var(--active);
|
|
266
293
|
margin-top: 8px;
|
|
294
|
+
|
|
295
|
+
&__currency {
|
|
296
|
+
font-size: 0.7rem;
|
|
297
|
+
opacity: 0.65;
|
|
298
|
+
font-weight: 600;
|
|
299
|
+
text-transform: uppercase;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.gamification-row {
|
|
304
|
+
padding-left: 0;
|
|
305
|
+
padding-right: 0;
|
|
306
|
+
margin-top: 4px;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.plans-pricing-link {
|
|
310
|
+
display: block;
|
|
311
|
+
width: 100%;
|
|
312
|
+
text-align: center;
|
|
313
|
+
font-size: 0.75rem;
|
|
314
|
+
font-weight: 400;
|
|
315
|
+
// Each platform brands this differently (TV's own fork used a fixed
|
|
316
|
+
// lavender tint of its purple, #d297ff, rather than plain body text) —
|
|
317
|
+
// falling through the same accent tokens MgWalletPlanBadge/MgXpLevelBar
|
|
318
|
+
// use lets every front's real accent take over here without a per-front
|
|
319
|
+
// override.
|
|
320
|
+
color: var(--highlight-color, var(--header-active-fg, var(--active)));
|
|
321
|
+
text-decoration: none;
|
|
322
|
+
padding: 4px 0;
|
|
323
|
+
margin-top: 8px;
|
|
324
|
+
|
|
325
|
+
&:hover {
|
|
326
|
+
text-decoration: underline;
|
|
327
|
+
}
|
|
267
328
|
}
|
|
268
329
|
|
|
269
330
|
.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[],
|