Initial commit
This commit is contained in:
28
layouts/default.vue
Normal file
28
layouts/default.vue
Normal file
@@ -0,0 +1,28 @@
|
||||
<template>
|
||||
<v-app dark>
|
||||
<v-app-bar fixed app>
|
||||
<v-toolbar-title v-text="title" />
|
||||
</v-app-bar>
|
||||
<v-main>
|
||||
<v-container fill-height>
|
||||
<Nuxt />
|
||||
</v-container>
|
||||
</v-main>
|
||||
<v-footer :absolute="!fixed" app>
|
||||
<span>© {{ new Date().getFullYear() }}</span>
|
||||
</v-footer>
|
||||
<ToastComponent />
|
||||
</v-app>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'DefaultLayout',
|
||||
data() {
|
||||
return {
|
||||
fixed: false,
|
||||
title: 'IU Quiz App',
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
14
layouts/empty.vue
Normal file
14
layouts/empty.vue
Normal file
@@ -0,0 +1,14 @@
|
||||
<template>
|
||||
<v-app>
|
||||
<v-main>
|
||||
<Nuxt />
|
||||
</v-main>
|
||||
</v-app>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'EmptyLayout',
|
||||
layout: 'empty'
|
||||
}
|
||||
</script>
|
||||
43
layouts/error.vue
Normal file
43
layouts/error.vue
Normal file
@@ -0,0 +1,43 @@
|
||||
<template>
|
||||
<v-app dark>
|
||||
<h1 v-if="error.statusCode === 404">
|
||||
{{ pageNotFound }}
|
||||
</h1>
|
||||
<h1 v-else>
|
||||
{{ otherError }}
|
||||
</h1>
|
||||
<NuxtLink to="/"> Home page </NuxtLink>
|
||||
</v-app>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'EmptyLayout',
|
||||
layout: 'empty',
|
||||
props: {
|
||||
error: {
|
||||
type: Object,
|
||||
default: null,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pageNotFound: '404 Not Found',
|
||||
otherError: 'An error occurred',
|
||||
}
|
||||
},
|
||||
head() {
|
||||
const title =
|
||||
this.error.statusCode === 404 ? this.pageNotFound : this.otherError
|
||||
return {
|
||||
title,
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
h1 {
|
||||
font-size: 20px;
|
||||
}
|
||||
</style>
|
||||
58
layouts/unverified.vue
Normal file
58
layouts/unverified.vue
Normal file
@@ -0,0 +1,58 @@
|
||||
<template>
|
||||
<v-app>
|
||||
<v-main>
|
||||
<v-container fill-height>
|
||||
<v-card max-width="500px" class="mx-auto">
|
||||
<v-card-title>
|
||||
Verifiziere deine E-Mail-Adresse!
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
<p>Wir haben eine E-Mail an deine E-Mail-Adresse <strong>{{ userEmail }}</strong> geschickt.
|
||||
Folge dem Link in der E-Mail, um dein Konto zu verifizieren.</p>
|
||||
<p>Solltest du keine E-Mail erhalten haben, wirf einen Blick in deinen Spam-Ordner.</p>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn depressed color="primary" :loading="loading" @click="sendVerificationEmail">E-Mail erneut senden</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-container>
|
||||
</v-main>
|
||||
<ToastComponent />
|
||||
</v-app>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { sendEmailVerification } from 'firebase/auth'
|
||||
|
||||
export default {
|
||||
name: 'UnverifiedLayout',
|
||||
layout: 'unverified',
|
||||
data () {
|
||||
return {
|
||||
loading: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
userEmail () {
|
||||
return this.$auth.currentUser.email
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
sendVerificationEmail () {
|
||||
this.loading = true
|
||||
|
||||
sendEmailVerification(this.$auth.currentUser)
|
||||
.then(() => {
|
||||
// Email verification sent!
|
||||
this.loading = false
|
||||
this.$toast({
|
||||
content: 'Erfolg! Folge dem Link in der E-Mail, die wir dir gerade geschickt haben, um deine Registrierung abzuschließen!',
|
||||
color: 'success',
|
||||
timeout: -1
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user