mirror of
https://github.com/elk-zone/elk
synced 2024-11-27 14:28:10 +09:00
feat: add not found for user pages
This commit is contained in:
parent
ae6552fee0
commit
a473cc2de5
8
components/common/CommonNotFound.vue
Normal file
8
components/common/CommonNotFound.vue
Normal file
@ -0,0 +1,8 @@
|
||||
<template>
|
||||
<div flex="~ col" items-center>
|
||||
<div i-ri:forbid-line text-10 mt10 mb2 />
|
||||
<div text-lg>
|
||||
<slot>Not found</slot>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
@ -29,9 +29,7 @@ const { data: context } = await useAsyncData(`${id}-context`, () => masto.status
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
Status not found
|
||||
</div>
|
||||
</template>
|
||||
<CommonNotFound v-else>
|
||||
Status not found
|
||||
</CommonNotFound>
|
||||
</template>
|
||||
|
@ -2,13 +2,19 @@
|
||||
const params = useRoute().params
|
||||
const user = $computed(() => params.user as string)
|
||||
|
||||
const { data: account } = await useAsyncData(`${user}:info`, () => masto.accounts.lookup({ acct: user }))
|
||||
const paginator = masto.accounts.getFollowersIterable(account.value!.id!, {})
|
||||
const { data: account } = $(await useAsyncData(`${user}:info`, () => masto.accounts.lookup({ acct: user })))
|
||||
const paginator = account ? masto.accounts.getFollowersIterable(account!.id!, {}) : null
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<AccountHeader :account="account" />
|
||||
</div>
|
||||
<AccountPaginator :paginator="paginator" />
|
||||
<template v-if="account">
|
||||
<div>
|
||||
<AccountHeader :account="account" />
|
||||
</div>
|
||||
<AccountPaginator :paginator="paginator" />
|
||||
</template>
|
||||
|
||||
<CommonNotFound v-else>
|
||||
Account @{{ params.user }} not found
|
||||
</CommonNotFound>
|
||||
</template>
|
||||
|
@ -2,13 +2,19 @@
|
||||
const params = useRoute().params
|
||||
const user = $computed(() => params.user as string)
|
||||
|
||||
const { data: account } = await useAsyncData(`${user}:info`, () => masto.accounts.lookup({ acct: user }))
|
||||
const paginator = masto.accounts.getFollowingIterable(account.value!.id!, {})
|
||||
const { data: account } = $(await useAsyncData(`${user}:info`, () => masto.accounts.lookup({ acct: user })))
|
||||
const paginator = account ? masto.accounts.getFollowingIterable(account!.id!, {}) : null
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<AccountHeader :account="account" />
|
||||
</div>
|
||||
<AccountPaginator :paginator="paginator" />
|
||||
<template v-if="account">
|
||||
<div>
|
||||
<AccountHeader :account="account" />
|
||||
</div>
|
||||
<AccountPaginator :paginator="paginator" />
|
||||
</template>
|
||||
|
||||
<CommonNotFound v-else>
|
||||
Account @{{ params.user }} not found
|
||||
</CommonNotFound>
|
||||
</template>
|
||||
|
@ -19,9 +19,15 @@ const paginator = $computed(() => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<AccountHeader :account="account" />
|
||||
</div>
|
||||
<CommonTabs v-model="tab" :options="tabNames" />
|
||||
<TimelinePaginator :key="tab" :paginator="paginator" />
|
||||
<template v-if="account">
|
||||
<div>
|
||||
<AccountHeader :account="account" />
|
||||
</div>
|
||||
<CommonTabs v-model="tab" :options="tabNames" />
|
||||
<TimelinePaginator :key="tab" :paginator="paginator" />
|
||||
</template>
|
||||
|
||||
<CommonNotFound v-else>
|
||||
Account @{{ params.user }} not found
|
||||
</CommonNotFound>
|
||||
</template>
|
||||
|
Loading…
Reference in New Issue
Block a user