Skip to content

Commit

Permalink
Add a "Sign up for the beta" button to the homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
MelissaAutumn committed Aug 15, 2024
1 parent 0c69e4c commit 9138f0c
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 3 deletions.
1 change: 1 addition & 0 deletions frontend/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@
"settings": "Settings",
"shareMyLink": "Share my link",
"showSecondaryTimeZone": "Show secondary time zone",
"signUpForBeta": "Sign up for the beta",
"signInWithGoogle": "Sign in with Google",
"signUpWithInviteCode": "Sign up with invite code",
"slotLength": "Booking Duration",
Expand Down
8 changes: 8 additions & 0 deletions frontend/src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ const routes: RouteRecordRaw[] = [
isPublic: true,
},
},
{
path: '/waiting-list',
name: 'join-the-waiting-list',
component: LoginView,
meta: {
isPublic: true,
},
},
{
path: '/post-login/:token',
name: 'post-login',
Expand Down
12 changes: 12 additions & 0 deletions frontend/src/views/HomeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ const enter = () => {
const login = () => {
router.push('/login');
};
const signUp = () => {
router.push('/waiting-list')
};
</script>

<template>
Expand Down Expand Up @@ -47,6 +50,15 @@ const login = () => {
:title="$t('label.continue')"
/>
</div>
<div class="mt-4 mb-4">
<primary-button
v-if="!isAuthenticated"
:label="$t('label.signUpForBeta')"
class="btn-login"
@click="signUp"
:title="$t('label.signUpForBeta')"
/>
</div>
</div>
<div class="w-full">
<!-- Padding top is rounded up aspect ratio percentage (height / width) of image -->
Expand Down
15 changes: 12 additions & 3 deletions frontend/src/views/LoginView.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { inject, ref } from 'vue';
import {inject, onMounted, ref} from 'vue';
import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router';
import {useRoute, useRouter} from 'vue-router';
import { useUserStore } from '@/stores/user-store';
import { dayjsKey, callKey, isPasswordAuthKey, isFxaAuthKey } from "@/keys";
import { BooleanResponse, AuthUrlResponse, Exception, AuthUrl, Error } from "@/models";
Expand All @@ -15,9 +15,11 @@ const user = useUserStore();
const { t } = useI18n();
const call = inject(callKey);
const dj = inject(dayjsKey);
const route = useRoute();
const router = useRouter();
const isPasswordAuth = inject(isPasswordAuthKey);
const isFxaAuth = inject(isFxaAuthKey);
const onlyShowInvite = ref(false);
const showInviteFlow = ref(false);
const isLoading = ref(false);
Expand All @@ -28,6 +30,13 @@ const loginError = ref<string>(null);
const inviteCode = ref('');
const showConfirmEmailScreen = ref(false);
onMounted(() => {
if (route.name === 'join-the-waiting-list') {
showInviteFlow.value = true;
onlyShowInvite.value = true;
}
});
const closeError = () => {
loginError.value = null;
};
Expand Down Expand Up @@ -153,7 +162,7 @@ const login = async () => {
@keydown.enter="isFxaAuth ? login() : null"
/>
</label>
<label class="flex flex-col items-center pl-4" v-if="showInviteFlow">
<label class="flex flex-col items-center pl-4" v-if="showInviteFlow && !onlyShowInvite">
<span class="w-full">
{{ t('label.inviteCode') }}
</span>
Expand Down

0 comments on commit 9138f0c

Please sign in to comment.