feat: use nested routes for profile

This commit is contained in:
Anthony Fu 2022-11-24 14:18:05 +08:00
parent e81273e944
commit 1ee945447d
12 changed files with 56 additions and 36 deletions

View file

@ -25,7 +25,7 @@ const createdAt = $computed(() => {
</NuxtLink>
</div>
<div flex flex-col>
<CommonRichContent font-bold text-2xl :content="getDisplayName(account)" :emojis="account.emojis" />
<ContentRich font-bold text-2xl :content="getDisplayName(account)" :emojis="account.emojis" />
<p op50>
{{ getAccountHandle(account) }}
</p>
@ -66,13 +66,13 @@ const createdAt = $computed(() => {
</div>
<div flex gap-5>
<NuxtLink :to="`/${getAccountHandle(account)}/`" active-class="text-primary">
<span font-bold>{{ account.statusesCount }}</span> Posts
<span font-bold>{{ account.statusesCount }}</span> <span op50>Posts</span>
</NuxtLink>
<NuxtLink :to="`/${getAccountHandle(account)}/following`" active-class="text-primary">
<span font-bold>{{ account.followingCount }}</span> Following
<span font-bold>{{ account.followingCount }}</span> <span op50>Following</span>
</NuxtLink>
<NuxtLink :to="`/${getAccountHandle(account)}/followers`" active-class="text-primary">
<span font-bold>{{ account.followersCount }}</span> Followers
<span font-bold>{{ account.followersCount }}</span> <span op50>Followers</span>
</NuxtLink>
</div>
</div>

View file

@ -18,7 +18,7 @@ const id = computed(() => fullServer && !account.acct.includes('@') ? `@${accoun
</NuxtLink>
</div>
<NuxtLink flex flex-col :to="link ? getAccountPath(account) : null">
<CommonRichContent font-bold :content="getDisplayName(account)" :emojis="account.emojis" />
<ContentRich font-bold :content="getDisplayName(account)" :emojis="account.emojis" />
<p op35 text-sm>
{{ id }}
</p>

View file

@ -9,6 +9,6 @@ defineProps<{
<template>
<NuxtLink :href="getAccountPath(account)" flex gap-1 items-center>
<AccountAvatar :account="account" w-5 h-5 />
<CommonRichContent :content="getDisplayName(account)" :emojis="account.emojis" />
<ContentRich :content="getDisplayName(account)" :emojis="account.emojis" />
</NuxtLink>
</template>

View file

@ -11,7 +11,7 @@ const { paginator } = defineProps<{
<template #default="{ item }">
<AccountCard
:account="item"
border="b base" p1
border="b base" py2 px4
/>
</template>
</CommonPaginator>