27
27
</div >
28
28
</div >
29
29
<div ref =" main_page" class =" layout" :class =" { 'expanded-mobile-nav': isBrowseMenuOpen }" >
30
- <div
30
+ <PagewideBanner
31
31
v-if =" auth.user && !auth.user.email_verified && route.path !== '/auth/verify-email'"
32
- class = " email-nag "
32
+ variant = " warning "
33
33
>
34
- <template v-if =" auth .user .email " >
35
- <span >{{ formatMessage(verifyEmailBannerMessages.title) }}</span >
36
- <button class =" btn" @click =" resendVerifyEmail" >
34
+ <template #title >
35
+ <span >
36
+ {{
37
+ auth?.user?.email
38
+ ? formatMessage(verifyEmailBannerMessages.title)
39
+ : formatMessage(addEmailBannerMessages.title)
40
+ }}
41
+ </span >
42
+ </template >
43
+ <template #description >
44
+ <span >
45
+ {{
46
+ auth?.user?.email
47
+ ? formatMessage(verifyEmailBannerMessages.description)
48
+ : formatMessage(addEmailBannerMessages.description)
49
+ }}
50
+ </span >
51
+ </template >
52
+ <template #actions >
53
+ <button v-if =" auth?.user?.email" class =" btn" @click =" resendVerifyEmail" >
37
54
{{ formatMessage(verifyEmailBannerMessages.action) }}
38
55
</button >
39
- </template >
40
- <template v-else >
41
- <span >{{ formatMessage(addEmailBannerMessages.title) }}</span >
42
- <nuxt-link class =" btn" to =" /settings/account" >
56
+ <nuxt-link v-else class =" btn" to =" /settings/account" >
43
57
<SettingsIcon aria-hidden =" true" />
44
58
{{ formatMessage(addEmailBannerMessages.action) }}
45
59
</nuxt-link >
46
60
</template >
47
- </div >
48
- <div
61
+ </PagewideBanner >
62
+ <PagewideBanner
49
63
v-if ="
50
- user &&
51
- user.subscriptions &&
52
64
user.subscriptions.some((x) => x.status === 'payment-failed') &&
53
65
route.path !== '/settings/billing'
54
66
"
55
- class = " email-nag "
67
+ variant = " error "
56
68
>
57
- <span >{{ formatMessage(subscriptionPaymentFailedBannerMessages.title) }}</span >
58
- <nuxt-link class =" btn" to =" /settings/billing" >
59
- <SettingsIcon aria-hidden =" true" />
60
- {{ formatMessage(subscriptionPaymentFailedBannerMessages.action) }}
61
- </nuxt-link >
62
- </div >
63
- <div
69
+ <template #title >
70
+ <span >{{ formatMessage(subscriptionPaymentFailedBannerMessages.title) }}</span >
71
+ </template >
72
+ <template #description >
73
+ <span >{{ formatMessage(subscriptionPaymentFailedBannerMessages.description) }}</span >
74
+ </template >
75
+ <template #actions >
76
+ <nuxt-link class =" btn" to =" /settings/billing" >
77
+ <SettingsIcon aria-hidden =" true" />
78
+ {{ formatMessage(subscriptionPaymentFailedBannerMessages.action) }}
79
+ </nuxt-link >
80
+ </template >
81
+ </PagewideBanner >
82
+ <PagewideBanner
64
83
v-if ="
65
84
config.public.apiBaseUrl.startsWith('https://staging-api.modrinth.com') &&
66
85
!cosmetics.hideStagingBanner
67
86
"
68
- class = " site-banner site-banner-- warning [ & >*]:z-[6] "
87
+ variant = " warning"
69
88
>
70
- <div class =" site-banner__title" >
71
- <IssuesIcon aria-hidden =" true" />
89
+ <template #title >
72
90
<span >{{ formatMessage(stagingBannerMessages.title) }}</span >
73
- </div >
74
- <div class = " site-banner__description " >
91
+ </template >
92
+ <template # description >
75
93
{{ formatMessage(stagingBannerMessages.description) }}
76
- </div >
77
- <div class =" site-banner__actions" >
78
- <Button transparent icon-only :action =" hideStagingBanner" aria-label =" Close banner"
79
- ><XIcon aria-hidden =" true"
80
- /></Button >
81
- </div >
82
- </div >
83
- <div
84
- v-if =" generatedStateErrors && generatedStateErrors.length > 0"
85
- class =" site-banner site-banner--warning [& >*]:z-[6]"
86
- >
87
- <div class =" site-banner__title" >
88
- <IssuesIcon aria-hidden =" true" />
94
+ </template >
95
+ <template #actions_right >
96
+ <Button transparent icon-only aria-label =" Close" @click =" hideStagingBanner" >
97
+ <XIcon aria-hidden =" true" />
98
+ </Button >
99
+ </template >
100
+ </PagewideBanner >
101
+ <PagewideBanner v-if =" generatedStateErrors?.length" variant =" error" >
102
+ <template #title >
89
103
<span >{{ formatMessage(failedToBuildBannerMessages.title) }}</span >
90
- </div >
91
- <div class = " site-banner__description " >
104
+ </template >
105
+ <template # description >
92
106
{{
93
107
formatMessage(failedToBuildBannerMessages.description, {
94
108
errors: generatedStateErrors,
95
109
url: config.public.apiBaseUrl,
96
110
})
97
111
}}
98
- </div >
99
- </div >
112
+ </template >
113
+ </PagewideBanner >
100
114
<header
101
115
class =" experimental-styles-within desktop-only relative z-[5] mx-auto grid max-w-[1280px] grid-cols-[1fr_auto] items-center gap-2 px-6 py-4 lg:grid-cols-[auto_1fr_auto]"
102
116
>
@@ -692,7 +706,14 @@ import {
692
706
GitHubIcon ,
693
707
ScaleIcon ,
694
708
} from " @modrinth/assets" ;
695
- import { Button , ButtonStyled , OverflowMenu , Avatar , commonMessages } from " @modrinth/ui" ;
709
+ import {
710
+ Button ,
711
+ ButtonStyled ,
712
+ OverflowMenu ,
713
+ PagewideBanner ,
714
+ Avatar ,
715
+ commonMessages ,
716
+ } from " @modrinth/ui" ;
696
717
import { isAdmin , isStaff } from " @modrinth/utils" ;
697
718
import { errors as generatedStateErrors } from " ~/generated/state.json" ;
698
719
@@ -720,8 +741,13 @@ const basePopoutId = useId();
720
741
721
742
const verifyEmailBannerMessages = defineMessages ({
722
743
title: {
723
- id: " layout.banner.verify-email.title" ,
724
- defaultMessage: " For security purposes, please verify your email address on Modrinth." ,
744
+ id: " layout.banner.account-action" ,
745
+ defaultMessage: " Account action required" ,
746
+ },
747
+ description: {
748
+ id: " layout.banner.verify-email.description" ,
749
+ defaultMessage:
750
+ " For security reasons, Modrinth needs you to verify the email address associated with your account." ,
725
751
},
726
752
action: {
727
753
id: " layout.banner.verify-email.action" ,
@@ -731,8 +757,13 @@ const verifyEmailBannerMessages = defineMessages({
731
757
732
758
const addEmailBannerMessages = defineMessages ({
733
759
title: {
734
- id: " layout.banner.add-email.title" ,
735
- defaultMessage: " For security purposes, please enter your email on Modrinth." ,
760
+ id: " layout.banner.account-action" ,
761
+ defaultMessage: " Account action required" ,
762
+ },
763
+ description: {
764
+ id: " layout.banner.add-email.description" ,
765
+ defaultMessage:
766
+ " For security reasons, Modrinth needs you to register an email address to your account." ,
736
767
},
737
768
action: {
738
769
id: " layout.banner.add-email.button" ,
@@ -743,8 +774,12 @@ const addEmailBannerMessages = defineMessages({
743
774
const subscriptionPaymentFailedBannerMessages = defineMessages ({
744
775
title: {
745
776
id: " layout.banner.subscription-payment-failed.title" ,
777
+ defaultMessage: " Billing action required." ,
778
+ },
779
+ description: {
780
+ id: " layout.banner.subscription-payment-failed.description" ,
746
781
defaultMessage:
747
- " Your subscription failed to renew. Please update your payment method to prevent losing access. " ,
782
+ " One or more subscriptions failed to renew. Please update your payment method to prevent losing access! " ,
748
783
},
749
784
action: {
750
785
id: " layout.banner.subscription-payment-failed.button" ,
@@ -755,7 +790,7 @@ const subscriptionPaymentFailedBannerMessages = defineMessages({
755
790
const stagingBannerMessages = defineMessages ({
756
791
title: {
757
792
id: " layout.banner.staging.title" ,
758
- defaultMessage: " You’re viewing Modrinth’s staging environment. " ,
793
+ defaultMessage: " You’re viewing Modrinth’s staging environment" ,
759
794
},
760
795
description: {
761
796
id: " layout.banner.staging.description" ,
@@ -1347,72 +1382,6 @@ const footerLinks = [
1347
1382
}
1348
1383
}
1349
1384
1350
- .email - nag {
1351
- z- index: 6 ;
1352
- position: relative;
1353
- background- color: var (-- color- raised- bg);
1354
- width: 100 % ;
1355
- display: flex;
1356
- align- items: center;
1357
- justify- content: center;
1358
- gap: 1rem ;
1359
- padding: 0 .5rem 1rem ;
1360
- }
1361
-
1362
- .site - banner-- warning {
1363
- // On some pages, there's gradient backgrounds that seep underneath
1364
- // the banner, so we need to add a solid color underlay.
1365
- background- color: black;
1366
- border- bottom: 2px solid var (-- color- red);
1367
- display: grid;
1368
- gap: 0 .5rem ;
1369
- grid- template: " title actions" " description actions" ;
1370
- padding- block: var (-- gap- xl);
1371
- padding- inline: max (calc ((100 % - 80rem ) / 2 + var (-- gap- md)), var (-- gap- xl));
1372
- z- index: 4 ;
1373
- position: relative;
1374
-
1375
- & :: before {
1376
- content: " " ;
1377
- position: absolute;
1378
- top: 0 ;
1379
- left: 0 ;
1380
- right: 0 ;
1381
- bottom: 0 ;
1382
- background- color: var (-- color- red- bg);
1383
- z- index: 5 ;
1384
- }
1385
-
1386
- .site - banner__title {
1387
- grid- area: title;
1388
- display: flex;
1389
- gap: 0 .5rem ;
1390
- align- items: center;
1391
- font- weight: bold;
1392
- font- size: var (-- font- size- md);
1393
- color: var (-- color- contrast);
1394
-
1395
- svg {
1396
- color: var (-- color- red);
1397
- width: 1 .5rem ;
1398
- height: 1 .5rem ;
1399
- flex- shrink: 0 ;
1400
- }
1401
- }
1402
-
1403
- .site - banner__description {
1404
- grid- area: description;
1405
- }
1406
-
1407
- .site - banner__actions {
1408
- grid- area: actions;
1409
- }
1410
-
1411
- a {
1412
- color: var (-- color- red);
1413
- }
1414
- }
1415
-
1416
1385
@media (max - width : 1200px ) {
1417
1386
.app - btn {
1418
1387
display: none;
0 commit comments