fix: make the entire PhysicalSample card clickable and format date

close #74
This commit is contained in:
Timothée Goguely 2024-12-20 11:46:30 +01:00
parent e500e57810
commit 20a836dc6e

View file

@ -1,7 +1,7 @@
<template> <template>
<div class="card | physical-sample" v-if="step.files.length > 0"> <div class="card | physical-sample" v-if="step.files.length > 0">
<header <header
class="text-center rounded-lg py-32" class="text-center rounded-lg p-32"
:style="'--cover: url(' + step.cover + ')'" :style="'--cover: url(' + step.cover + ')'"
> >
<h3 class="text-lg font-serif"> <h3 class="text-lg font-serif">
@ -9,9 +9,11 @@
step.title step.title
}}</router-link> }}</router-link>
</h3> </h3>
<time class="font-medium text-sm py-8" :datetime="step.date">{{ <time
step.date class="card__date | font-medium text-sm py-8"
}}</time> :datetime="dayjs(step.date).format('YYYY-M-DD')"
>{{ dayjs(step.date).format("DD MMMM YYYY") }}</time
>
<p>{{ step.description }}</p> <p>{{ step.description }}</p>
</header> </header>
<img <img
@ -23,5 +25,8 @@
</div> </div>
</template> </template>
<script setup> <script setup>
import dayjs from "dayjs";
import "dayjs/locale/fr";
const { step } = defineProps({ step: Object }); const { step } = defineProps({ step: Object });
</script> </script>