-
- {#if animated}
- {#if i === 0}
-

- {:else}
-

- {/if}
- {:else if i === 0}
-
{status.status}
- {:else}
-
{status.status}
- {/if}
-
- {#if i < allStatuses.length - 1}
-
- {/if}
+
+
+
+
+ {#if loading}
+
+
+
+ {:else if posts.length === 0}
+
-
- {#if profile}
-
{profile.displayName || profile.handle}
- {:else}
-
{status.did.slice(0, 20)}...
+ {#each posts as feedPost, i (feedPost.post?.uri ? `${feedPost.post.uri}-${i}` : i)}
+ {#if feedPost.post}
+ {@const { postData, embeds } = blueskyPostToPostData(feedPost.post, 'https://bsky.app', feedPost.reason, feedPost.reply)}
+
+
{
+ if ((e.target as HTMLElement).closest('a, button')) return;
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ const record = feedPost.post.record as any;
+ const isReply = !!record?.reply?.root;
+ if (isReply) {
+ const rootUri = record.reply.root.uri as string;
+ const [, , rootDid, , rootRkey] = rootUri.split('/');
+ const clickedRkey = feedPost.post.uri.split('/').pop();
+ goto(`/p/${rootDid}/post/${rootRkey}?highlight=${feedPost.post.author.handle}/${clickedRkey}`);
+ } else {
+ const rkey = feedPost.post.uri.split('/').pop();
+ goto(`/p/${feedPost.post.author.handle}/post/${rkey}`);
+ }
+ }}
>
- {/if}
-
·
-
-
-
+
goto(`/p/${handle}`)}
+ actions={user.did
+ ? {
+ reply: {
+ count: postData.replyCount
+ },
+ repost: {
+ count: postData.repostCount
+ },
+ like: {
+ count: getLikeCount(feedPost.post.uri, postData.likeCount ?? 0),
+ active: isLiked(feedPost.post.uri, feedPost.post.viewer?.like),
+ onclick: () => handleLike(feedPost.post.uri, feedPost.post.cid, feedPost.post.viewer?.like)
+ }
+ }
+ : {
+ reply: {
+ count: postData.replyCount
+ },
+ repost: {
+ count: postData.repostCount
+ }
+ }}
+ />
+
+ {/if}
+ {/each}
-
- {/each}
-
- {/if}
+
+ {#if loadingMore}
+
+
+
+ {/if}
+
+ {#if !cursor && posts.length > 0}
+
You've reached the end
+ {/if}
+
+
+ {/if}
+
+
diff --git a/src/routes/blobs/+page.server.ts b/src/routes/blobs/+page.server.ts
deleted file mode 100644
index 9068059..0000000
--- a/src/routes/blobs/+page.server.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-import type { PageServerLoad } from './$types';
-
-export const load: PageServerLoad = async ({ locals }) => {
- if (!locals.client || !locals.did)
- return {
- blobs: [] as { rkey: string; blob: { $type: 'blob'; ref: { $link: string }; mimeType: string; size: number }; createdAt: string }[]
- };
-
- try {
- const blobResponse = await locals.client.get('com.atproto.repo.listRecords', {
- params: {
- repo: locals.did,
- collection: 'social.atmo.test.blob',
- limit: 20
- }
- });
-
- const blobs = blobResponse.ok
- ? blobResponse.data.records.map((r) => {
- const value = r.value as {
- blob: { $type: 'blob'; ref: { $link: string }; mimeType: string; size: number };
- createdAt: string;
- };
- return {
- rkey: r.uri.split('/').pop()!,
- blob: value.blob,
- createdAt: value.createdAt
- };
- })
- : [];
-
- return { blobs };
- } catch {
- return { blobs: [] };
- }
-};
diff --git a/src/routes/blobs/+page.svelte b/src/routes/blobs/+page.svelte
deleted file mode 100644
index 206270a..0000000
--- a/src/routes/blobs/+page.svelte
+++ /dev/null
@@ -1,95 +0,0 @@
-
-
-
-
blob upload
-
-
back to home
-
- {#if !user.isLoggedIn}
-
not logged in
-
- {/if}
-
- {#if user.isLoggedIn}
-
signed in as
-
-
-
-
{user.profile?.displayName || user.profile?.handle}
-
-
-
-
-
- {#if uploading}
- uploading...
- {/if}
-
-
- {#if data.blobs.length > 0}
-
Uploaded blobs:
-
- {#each data.blobs as blob (blob.rkey)}
-
-

-
-
-
-
- {/each}
-
- {/if}
-
-
-
- {/if}
-
diff --git a/src/routes/p/[actor]/+page.svelte b/src/routes/p/[actor]/+page.svelte
new file mode 100644
index 0000000..cc644d7
--- /dev/null
+++ b/src/routes/p/[actor]/+page.svelte
@@ -0,0 +1,55 @@
+
+
+
+
+ {#if loading}
+
+
+
+ {:else if error}
+
+ {:else if profile}
+
+ {/if}
+
+
diff --git a/src/routes/p/[actor]/post/[rkey]/+page.svelte b/src/routes/p/[actor]/post/[rkey]/+page.svelte
new file mode 100644
index 0000000..e9d2a62
--- /dev/null
+++ b/src/routes/p/[actor]/post/[rkey]/+page.svelte
@@ -0,0 +1,227 @@
+
+
+
+
+ {#if loading}
+
+
+
+ {:else if error}
+
+ {:else if postView}
+ {@const { postData, embeds } = blueskyPostToPostData(postView)}
+
+
handleLike(postView.uri, postView.cid, postView.viewer?.like)
+ }
+ }
+ : {
+ reply: { count: postData.replyCount },
+ repost: { count: postData.repostCount }
+ }}
+ />
+
+
+ {#if loadingComments}
+
+
+
+ {:else if comments.length > 0}
+
+
+
+ {/if}
+ {/if}
+
+