Working and clean fucking guestbook

This commit is contained in:
2021-08-20 11:58:44 +02:00
parent 28990e0151
commit 2f50ad9d55
20 changed files with 103 additions and 530 deletions

View File

@@ -1,55 +0,0 @@
<template>
<main v-if="guestbook_messages" class="flex flex-col mb-8 px-4 xl:px-64">
<PageTitle class="self-center" title="part.guestbook"/>
<section class="flex flex-col 2xl:flex-row items-center py-8">
<div class="ml-2 text-lg leading-6 text-justify dark:text-gray-400 text-gray-700">
<p>{{ $t('guestbook.description') }}</p>
</div>
</section>
<GuestBookForm />
<section class="flex flex-col py-8">
<div v-for="message in guestbook_messages">
<GuestbookMessage
:message="message.message"
:author="message.user.username"
:date="message.created_at"
/>
</div>
</section>
</main>
</template>
<script lang="ts">
import {defineComponent, useAsync, useContext} from "@nuxtjs/composition-api";
import GuestbookMessage from "@/components/GuestbookMessage.vue";
export default defineComponent({
name: "guestbook",
head() {
return {
title: `${this.$i18n.t('header.guestbook')} - Arthur Danjou`
}
},
setup() {
const { $axios, $sentry, app } = useContext()
const guestbook_messages = useAsync<typeof GuestbookMessage[]>(async () => {
const response = await $axios.get('/api/guestbook', {
headers: {
'Authorization': `Bearer ${process.env.API_TOKEN}`
}
})
if (response.status === 200) {
return response.data.guestbook_messages
} else {
app.error({statusCode: 500})
$sentry.captureEvent(response.data)
}
}, 'guestbook_messages')
return {
guestbook_messages
}
}
})
</script>

View File

@@ -4,19 +4,19 @@
<p class="text-justify text-gray-700 dark:text-gray-400 text-xl my-8">{{ $t('services.description') }}</p>
<div class="flex flex-col justify-around items-center py-10 w-full">
<div class="flex flex-col lg:(flex-row justify-around mb-16) w-full">
<ServicePart>
<GlassIcon />
<ServicePart title="services.1.title" content="services.1.content" >
<CodeIcon />
</ServicePart>
<ServicePart>
<ServicePart title="services.2.title" content="services.2.content">
<NetworkIcon />
</ServicePart>
</div>
<div class="flex flex-col lg:(flex-row justify-around) w-full">
<ServicePart>
<ServicePart title="services.3.title" content="services.3.content">
<SupportIcon />
</ServicePart>
<ServicePart>
<CodeIcon />
<ServicePart title="services.4.title" content="services.4.content">
<GlassIcon />
</ServicePart>
</div>
</div>