Add updated date to Terms page + fix responsive

This commit is contained in:
2022-09-08 23:52:09 +02:00
parent 8bebfc7e90
commit cc69978c47
3 changed files with 32 additions and 3 deletions

View File

@@ -7,6 +7,7 @@ export const load: PageServerLoad = async () => {
const res = await fetchAPI(`query { const res = await fetchAPI(`query {
legal { legal {
terms terms
date_updated
} }
}`) }`)

View File

@@ -4,12 +4,17 @@
<script lang="ts"> <script lang="ts">
import type { PageData } from './$types' import type { PageData } from './$types'
import dayjs from 'dayjs'
import relativeTime from 'dayjs/plugin/relativeTime'
// Components
import PageTransition from '$components/PageTransition.svelte' import PageTransition from '$components/PageTransition.svelte'
import Metas from '$components/Metas.svelte' import Metas from '$components/Metas.svelte'
import Heading from '$components/molecules/Heading.svelte' import Heading from '$components/molecules/Heading.svelte'
export let data: PageData export let data: PageData
const { legal } = data const { legal } = data
dayjs.extend(relativeTime)
</script> </script>
<Metas <Metas
@@ -31,6 +36,12 @@
</div> </div>
</article> </article>
{/each} {/each}
<footer>
<p class="text-info">
Updated: <time datetime={dayjs(legal.date_updated).format('YYYY-MM-DD')}>{dayjs().to(dayjs(legal.date_updated))}</time>
</p>
</footer>
</div> </div>
</section> </section>
</PageTransition> </PageTransition>

View File

@@ -3,13 +3,22 @@
&__categories { &__categories {
.container { .container {
display: block; display: block;
padding-bottom: clamp(48px, 12vw, 80px);
@include bp (sm) { @include bp (sm) {
display: grid; display: grid;
padding-bottom: clamp(80px, 10vw, 144px);
}
} }
& > * { // Footer
margin-bottom: clamp(40px, 5vw, 72px); footer {
margin-top: 40px;
color: $color-lilas-bright;
@include bp (sm) {
grid-column: 12 / -3;
margin-top: 64px;
} }
} }
} }
@@ -18,7 +27,14 @@
&__section { &__section {
--columns: 16; --columns: 16;
display: block; display: block;
padding: 0 20px;
&:not(:last-of-type) {
margin-bottom: 40px;
@include bp (sm) {
margin-bottom: clamp(40px, 5vw, 72px);
}
}
@include bp (sm) { @include bp (sm) {
display: grid; display: grid;
@@ -47,6 +63,7 @@
} }
.text { .text {
color: $color-tertiary; color: $color-tertiary;
line-height: 1.5;
@include bp (sm) { @include bp (sm) {
grid-column: 6 / -1; grid-column: 6 / -1;