Files
AstralRinth/apps/frontend/src/pages/auth/welcome.vue
Prospector c39bb78e38 App redesign (#2946)
* Start of app redesign

* format

* continue progress

* Content page nearly done

* Fix recursion issues with content page

* Fix update all alignment

* Discover page progress

* Settings progress

* Removed unlocked-size hack that breaks web

* Revamp project page, refactor web project page to share code with app, fixed loading bar, misc UI/UX enhancements, update ko-fi logo, update arrow icons, fix web issues caused by floating-vue migration, fix tooltip issues, update web tooltips, clean up web hydration issues

* Ads + run prettier

* Begin auth refactor, move common messages to ui lib, add i18n extraction to all apps, begin Library refactor

* fix ads not hiding when plus log in

* rev lockfile changes/conflicts

* Fix sign in page

* Add generated

* (mostly) Data driven search

* Fix search mobile issue

* profile fixes

* Project versions page, fix typescript on UI lib and misc fixes

* Remove unused gallery component

* Fix linkfunction err

* Search filter controls at top, localization for locked filters

* Fix provided filter names

* Fix navigating from instance browse to main browse

* Friends frontend (#2995)

* Friends system frontend

* (almost) finish frontend

* finish friends, fix lint

* Fix lint

---------

Signed-off-by: Geometrically <18202329+Geometrically@users.noreply.github.com>

* Refresh macOS app icon

* Update web search UI more

* Fix link opens

* Fix frontend build

---------

Signed-off-by: Geometrically <18202329+Geometrically@users.noreply.github.com>
Co-authored-by: Jai A <jaiagr+gpg@pm.me>
Co-authored-by: Geometrically <18202329+Geometrically@users.noreply.github.com>
2024-12-11 19:54:18 -08:00

98 lines
2.6 KiB
Vue

<template>
<div>
<h1>{{ formatMessage(messages.welcomeLongTitle) }}</h1>
<section class="auth-form">
<p>
{{ formatMessage(messages.welcomeDescription) }}
</p>
<Checkbox
v-model="subscribe"
class="subscribe-btn"
:label="formatMessage(messages.subscribeCheckbox)"
:description="formatMessage(messages.subscribeCheckbox)"
/>
<button class="btn btn-primary continue-btn centered-btn" @click="continueSignUp">
{{ formatMessage(commonMessages.continueButton) }} <RightArrowIcon />
</button>
<p>
<IntlFormatted :message-id="messages.tosLabel">
<template #terms-link="{ children }">
<NuxtLink to="/legal/terms" class="text-link">
<component :is="() => children" />
</NuxtLink>
</template>
<template #privacy-policy-link="{ children }">
<NuxtLink to="/legal/privacy" class="text-link">
<component :is="() => children" />
</NuxtLink>
</template>
</IntlFormatted>
</p>
</section>
</div>
</template>
<script setup>
import { Checkbox, commonMessages } from "@modrinth/ui";
import { RightArrowIcon } from "@modrinth/assets";
const { formatMessage } = useVIntl();
const messages = defineMessages({
subscribeCheckbox: {
id: "auth.welcome.checkbox.subscribe",
defaultMessage: "Subscribe to updates about Modrinth",
},
tosLabel: {
id: "auth.welcome.label.tos",
defaultMessage:
"By creating an account, you have agreed to Modrinth's <terms-link>Terms</terms-link> and <privacy-policy-link>Privacy Policy</privacy-policy-link>.",
},
welcomeDescription: {
id: "auth.welcome.description",
defaultMessage:
"Thank you for creating an account. You can now follow and create projects, receive updates about your favorite projects, and more!",
},
welcomeLongTitle: {
id: "auth.welcome.long-title",
defaultMessage: "Welcome to Modrinth!",
},
welcomeTitle: {
id: "auth.welcome.title",
defaultMessage: "Welcome",
},
});
useHead({
title: () => `${formatMessage(messages.welcomeTitle)} - Modrinth`,
});
const subscribe = ref(true);
async function continueSignUp() {
const route = useRoute();
await useAuth(route.query.authToken);
await useUser();
if (subscribe.value) {
try {
await useBaseFetch("auth/email/subscribe", {
method: "POST",
});
} catch {
/* empty */
}
}
if (route.query.redirect) {
await navigateTo(route.query.redirect);
} else {
await navigateTo("/dashboard");
}
}
</script>