refactor: ♻️ Rewrite timeline rendering code

This commit is contained in:
Jesse Wierzbinski 2024-06-28 17:05:50 -10:00
parent 091615b04e
commit d6f36eaecf
No known key found for this signature in database
24 changed files with 392 additions and 435 deletions

View file

@ -1,10 +1,10 @@
<template>
<div v-if="loaded" :defer="true" class="mx-auto max-w-2xl w-full pb-72">
<Note v-for="note of context?.ancestors" :note="note" />
<Note v-for="note of context?.ancestors" :element="note" />
<div ref="element" class="first:rounded-t last:rounded-b overflow-hidden">
<Note class="!rounded-none border-2 border-primary-500" v-if="note" :note="note" />
<Note class="!rounded-none border-2 border-primary-500" v-if="note" :element="note" />
</div>
<Note v-for="note of context?.descendants" :note="note" />
<Note v-for="note of context?.descendants" :element="note" />
</div>
<div v-else class="mx-auto max-w-2xl w-full overflow-y-auto">
<Note v-for="_ of 5" :skeleton="true" />

View file

@ -3,7 +3,7 @@
<div class="mx-auto max-w-2xl w-full">
<TimelineScroller>
<AccountProfile :account="account ?? undefined" />
<AccountTimeline :id="accountId" :key="accountId" />
<AccountTimeline v-if="accountId" :id="accountId" :key="accountId" />
</TimelineScroller>
</div>
</ErrorBoundary>

View file

@ -13,7 +13,7 @@
</div>
<TimelineScroller v-else>
<Greeting />
<div class="rounded overflow-hidden ring-1 ring-white/10">
<div class="rounded overflow-hidden">
<Notifications />
</div>
</TimelineScroller>