feat: /public/local timeline and timeline header (#3)
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
This commit is contained in:
parent
cf22ca25bf
commit
a17d3276d3
7 changed files with 87 additions and 14 deletions
18
pages/public/index.vue
Normal file
18
pages/public/index.vue
Normal file
|
@ -0,0 +1,18 @@
|
|||
<script setup lang="ts">
|
||||
const masto = await useMasto()
|
||||
const { data: timelines } = await useAsyncData('timelines-public', () => masto.timelines.fetchPublic().then(r => r.value))
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<MainContent>
|
||||
<template #title>
|
||||
<div i-ri:earth-fill h-6 mr-1 /><span>Federated Timeline</span>
|
||||
</template>
|
||||
<template #actions>
|
||||
<div color-gray i-ri:equalizer-fill mr-1 h-6 />
|
||||
</template>
|
||||
<slot>
|
||||
<TimelineList :timelines="timelines" />
|
||||
</slot>
|
||||
</MainContent>
|
||||
</template>
|
23
pages/public/local.vue
Normal file
23
pages/public/local.vue
Normal file
|
@ -0,0 +1,23 @@
|
|||
<script setup lang="ts">
|
||||
const token = useCookie('nuxtodon-token')
|
||||
const router = useRouter()
|
||||
if (!token.value)
|
||||
router.replace('/public')
|
||||
|
||||
const masto = await useMasto()
|
||||
const { data: timelines } = await useAsyncData('timelines-home', () => masto.timelines.fetchPublic({ local: true }).then(r => r.value))
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<MainContent>
|
||||
<template #title>
|
||||
<div i-ri:group-fill h-6 mr-1 /><span>Local timeline</span>
|
||||
</template>
|
||||
<template #actions>
|
||||
<div color-gray i-ri:equalizer-fill mr-1 h-6 />
|
||||
</template>
|
||||
<slot>
|
||||
<TimelineList :timelines="timelines" />
|
||||
</slot>
|
||||
</MainContent>
|
||||
</template>
|
Loading…
Add table
Add a link
Reference in a new issue