diff --git a/apps/frontend/src/components/ui/banner/GeneratedStateErrorsBanner.vue b/apps/frontend/src/components/ui/banner/GeneratedStateErrorsBanner.vue new file mode 100644 index 00000000..6aecf512 --- /dev/null +++ b/apps/frontend/src/components/ui/banner/GeneratedStateErrorsBanner.vue @@ -0,0 +1,38 @@ + + + diff --git a/apps/frontend/src/components/ui/banner/RussiaBanner.vue b/apps/frontend/src/components/ui/banner/RussiaBanner.vue new file mode 100644 index 00000000..59491234 --- /dev/null +++ b/apps/frontend/src/components/ui/banner/RussiaBanner.vue @@ -0,0 +1,69 @@ + + + diff --git a/apps/frontend/src/components/ui/banner/StagingBanner.vue b/apps/frontend/src/components/ui/banner/StagingBanner.vue new file mode 100644 index 00000000..607974ec --- /dev/null +++ b/apps/frontend/src/components/ui/banner/StagingBanner.vue @@ -0,0 +1,47 @@ + + + diff --git a/apps/frontend/src/components/ui/banner/SubscriptionPaymentFailedBanner.vue b/apps/frontend/src/components/ui/banner/SubscriptionPaymentFailedBanner.vue new file mode 100644 index 00000000..a1a38c0d --- /dev/null +++ b/apps/frontend/src/components/ui/banner/SubscriptionPaymentFailedBanner.vue @@ -0,0 +1,39 @@ + + + diff --git a/apps/frontend/src/components/ui/banner/TaxComplianceBanner.vue b/apps/frontend/src/components/ui/banner/TaxComplianceBanner.vue new file mode 100644 index 00000000..b9990cc8 --- /dev/null +++ b/apps/frontend/src/components/ui/banner/TaxComplianceBanner.vue @@ -0,0 +1,49 @@ + + + diff --git a/apps/frontend/src/components/ui/banner/TaxIdMismatchBanner.vue b/apps/frontend/src/components/ui/banner/TaxIdMismatchBanner.vue new file mode 100644 index 00000000..8762d8d1 --- /dev/null +++ b/apps/frontend/src/components/ui/banner/TaxIdMismatchBanner.vue @@ -0,0 +1,43 @@ + + + diff --git a/apps/frontend/src/components/ui/banner/VerifyEmailBanner.vue b/apps/frontend/src/components/ui/banner/VerifyEmailBanner.vue new file mode 100644 index 00000000..a5ee58bc --- /dev/null +++ b/apps/frontend/src/components/ui/banner/VerifyEmailBanner.vue @@ -0,0 +1,103 @@ + + + diff --git a/apps/frontend/src/composables/nuxt-accessors.ts b/apps/frontend/src/composables/nuxt-accessors.ts index ca09ae3a..e841e79d 100644 --- a/apps/frontend/src/composables/nuxt-accessors.ts +++ b/apps/frontend/src/composables/nuxt-accessors.ts @@ -1,7 +1,9 @@ +import type { Cosmetics } from '~/plugins/cosmetics.ts' + export function useTheme() { return useNuxtApp().$theme } export function useCosmetics() { - return useNuxtApp().$cosmetics + return useNuxtApp().$cosmetics as Ref } diff --git a/apps/frontend/src/layouts/default.vue b/apps/frontend/src/layouts/default.vue index b0163720..4b3d9ecb 100644 --- a/apps/frontend/src/layouts/default.vue +++ b/apps/frontend/src/layouts/default.vue @@ -34,187 +34,23 @@ 'modrinth-parent__no-modal-blurs': !cosmetics.advancedRendering, }" > - - - - - - - - - - - - - - - - - + + + - - - - - + - - - - - - - - - - - - - - - + +
{ return !!auth.value.user && status === 'tin-mismatch' }) -const taxBannerMessages = defineMessages({ - title: { - id: 'layout.banner.tax.title', - defaultMessage: 'Tax form required', - }, - description: { - id: 'layout.banner.tax.description', - defaultMessage: - "You've already withdrawn over $600 from Modrinth this year. To comply with tax regulations, you need to complete a tax form. Your withdrawals are paused until this form is submitted.", - }, - action: { - id: 'layout.banner.tax.action', - defaultMessage: 'Complete tax form', - }, -}) - -const tinMismatchBannerMessages = defineMessages({ - title: { - id: 'layout.banner.tin-mismatch.title', - defaultMessage: 'Tax form failed', - }, - description: { - id: 'layout.banner.tin-mismatch.description', - defaultMessage: - "Your withdrawals are temporarily locked because your TIN or SSN didn't match IRS records. Please contact support to reset and resubmit your tax form.", - }, - action: { - id: 'layout.banner.tin-mismatch.action', - defaultMessage: 'Contact support', - }, -}) - -const taxFormModalRef = ref(null) -function openTaxForm(e) { - if (taxFormModalRef.value && taxFormModalRef.value.startTaxForm) { - taxFormModalRef.value.startTaxForm(e) - } -} - const basePopoutId = useId() -async function handleResendEmailVerification() { - try { - await resendVerifyEmail() - addNotification({ - title: 'Verification email sent', - text: 'Please check your inbox for the verification email.', - type: 'success', - }) - } catch (err) { - addNotification({ - title: 'An error occurred', - text: err.data.description, - type: 'error', - }) - } -} - -const verifyEmailBannerMessages = defineMessages({ - title: { - id: 'layout.banner.account-action', - defaultMessage: 'Account action required', - }, - description: { - id: 'layout.banner.verify-email.description', - defaultMessage: - 'For security reasons, Modrinth needs you to verify the email address associated with your account.', - }, - action: { - id: 'layout.banner.verify-email.action', - defaultMessage: 'Re-send verification email', - }, -}) - -const addEmailBannerMessages = defineMessages({ - title: { - id: 'layout.banner.account-action', - defaultMessage: 'Account action required', - }, - description: { - id: 'layout.banner.add-email.description', - defaultMessage: - 'For security reasons, Modrinth needs you to register an email address to your account.', - }, - action: { - id: 'layout.banner.add-email.button', - defaultMessage: 'Visit account settings', - }, -}) - -const subscriptionPaymentFailedBannerMessages = defineMessages({ - title: { - id: 'layout.banner.subscription-payment-failed.title', - defaultMessage: 'Billing action required.', - }, - description: { - id: 'layout.banner.subscription-payment-failed.description', - defaultMessage: - 'One or more subscriptions failed to renew. Please update your payment method to prevent losing access!', - }, - action: { - id: 'layout.banner.subscription-payment-failed.button', - defaultMessage: 'Update billing info', - }, -}) - -const stagingBannerMessages = defineMessages({ - title: { - id: 'layout.banner.staging.title', - defaultMessage: 'You’re viewing Modrinth’s staging environment', - }, - description: { - id: 'layout.banner.staging.description', - defaultMessage: - 'The staging environment is completely separate from the production Modrinth database. This is used for testing and debugging purposes, and may be running in-development versions of the Modrinth backend or frontend newer than the production instance.', - }, -}) - -const failedToBuildBannerMessages = defineMessages({ - title: { - id: 'layout.banner.build-fail.title', - defaultMessage: 'Error generating state from API when building.', - }, - description: { - id: 'layout.banner.build-fail.description', - defaultMessage: - "This deploy of Modrinth's frontend failed to generate state from the API. This may be due to an outage or an error in configuration. Rebuild when the API is available. Error codes: {errors}; Current API URL is: {url}", - }, -}) const navMenuMessages = defineMessages({ home: { @@ -1475,15 +1182,6 @@ function toggleBrowseMenu() { } const { cycle: changeTheme } = useTheme() - -function hideStagingBanner() { - cosmetics.value.hideStagingBanner = true -} - -function hideRussiaCensorshipBanner() { - flags.value.hideRussiaCensorshipBanner = true - saveFeatureFlags() -}