Thread viewer for Bluesky
at master 60 lines 1.8 kB view raw
1<script lang="ts"> 2 import { account } from './models/account.svelte.js'; 3 4 import AccountMenu from './components/AccountMenu.svelte'; 5 import Dialogs, { showLoginDialog } from './components/Dialogs.svelte'; 6 import HashtagPage from './pages/HashtagPage.svelte'; 7 import HomeSearch from './components/HomeSearch.svelte'; 8 import LikeStatsPage from './pages/LikeStatsPage.svelte'; 9 import LycanSearchPage from './pages/LycanSearchPage.svelte'; 10 import NotificationsPage from './pages/NotificationsPage.svelte'; 11 import PostingStatsPage from './pages/PostingStatsPage.svelte'; 12 import QuotesPage from './pages/QuotesPage.svelte'; 13 import TangledLink from './components/TangledLink.svelte'; 14 import ThreadPage from './pages/ThreadPage.svelte'; 15 import TimelineSearchPage from './pages/TimelineSearchPage.svelte'; 16 17 let { params }: { params: Record<string, string> } = $props(); 18 19 if (params.page && !account.loggedIn) { 20 showLoginDialog({ showClose: false }); 21 } 22</script> 23 24<AccountMenu /> 25<Dialogs /> 26<TangledLink /> 27 28{#if params.q} 29 <ThreadPage url={params.q} /> 30{:else if params.author && params.post} 31 <ThreadPage author={params.author} rkey={params.post} /> 32{:else if params.quotes} 33 <QuotesPage postURL={params.quotes} /> 34{:else if params.hash} 35 <HashtagPage hashtag={params.hash} /> 36{:else if params.page} 37 {#if account.loggedIn} 38 {@render page()} 39 {/if} 40{:else} 41 <HomeSearch /> 42{/if} 43 44{#snippet page()} 45 {#if params.page == 'notif'} 46 <NotificationsPage /> 47 {:else if params.page == 'posting_stats'} 48 <PostingStatsPage /> 49 {:else if params.page == 'like_stats'} 50 <LikeStatsPage /> 51 {:else if params.page == 'search'} 52 {#if params.mode == 'likes'} 53 <LycanSearchPage lycan={params.lycan} /> 54 {:else} 55 <TimelineSearchPage /> 56 {/if} 57 {:else} 58 <HomeSearch /> 59 {/if} 60{/snippet}