Add updated date to Terms page + fix responsive
This commit is contained in:
@@ -7,6 +7,7 @@ export const load: PageServerLoad = async () => {
|
||||
const res = await fetchAPI(`query {
|
||||
legal {
|
||||
terms
|
||||
date_updated
|
||||
}
|
||||
}`)
|
||||
|
||||
|
||||
@@ -4,12 +4,17 @@
|
||||
|
||||
<script lang="ts">
|
||||
import type { PageData } from './$types'
|
||||
import dayjs from 'dayjs'
|
||||
import relativeTime from 'dayjs/plugin/relativeTime'
|
||||
// Components
|
||||
import PageTransition from '$components/PageTransition.svelte'
|
||||
import Metas from '$components/Metas.svelte'
|
||||
import Heading from '$components/molecules/Heading.svelte'
|
||||
|
||||
export let data: PageData
|
||||
const { legal } = data
|
||||
|
||||
dayjs.extend(relativeTime)
|
||||
</script>
|
||||
|
||||
<Metas
|
||||
@@ -31,6 +36,12 @@
|
||||
</div>
|
||||
</article>
|
||||
{/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>
|
||||
</section>
|
||||
</PageTransition>
|
||||
Reference in New Issue
Block a user