I guess we displaying posts now

This commit is contained in:
ari 2025-04-20 00:42:56 -04:00
parent 3f03c12152
commit 19eb695b08
No known key found for this signature in database
14 changed files with 387 additions and 171 deletions

View file

@ -1,6 +1,6 @@
import { simpleFetchHandler, XRPC } from "@atcute/client";
import "@atcute/bluesky/lexicons";
// import { ComAtprotoRepoListRecords } from "@atcute/client/lexicons";
// import { ComAtprotoRepoListRecords.Record } from "@atcute/client/lexicons";
// import { AppBskyFeedPost } from "@atcute/client/lexicons";
// import { AppBskyActorDefs } from "@atcute/client/lexicons";
@ -11,6 +11,7 @@ interface AccountMetadata {
}
class Post {
authorDid: string;
authorAvatarCid: string | null;
displayName : string;
text: string;
timestamp: number;
@ -18,12 +19,11 @@ class Post {
quotingDid: string | null;
replyingDid: string | null;
imagesLinksCid: string[] | null;
imagesAltText: string[] | null;
videosLinkCid: string | null;
videosLinksUrls: string[] | null;
constructor(record: ComAtprotoRepoListRecords.Record, account : AccountMetadata) {
this.authorDid = account.did;
this.authorAvatarCid = account.avatarCid;
this.displayName = account.displayName;
const post = record.value as AppBskyFeedPost.Record;
this.timenotstamp = post.createdAt;
@ -42,7 +42,6 @@ class Post {
this.imagesLinksCid = post.embed.images.map((imageRecord) =>
imageRecord.image.ref.$link
);
this.imagesAltText = post.embed.images.map((imageRecord) => imageRecord.alt || "no alt text :(")
break;
case "app.bsky.embed.video":
this.videosLinkCid = post.embed.video.ref.$link;
@ -57,12 +56,11 @@ class Post {
this.imagesLinksCid = post.embed.media.images.map((imageRecord) =>
imageRecord.image.ref.$link
);
this.imagesAltText = post.embed.images.map((imageRecord) => imageRecord.alt || "no alt text :(")
break;
case "app.bsky.embed.video":
this.videosLinkCid = post.embed.media.video.ref.$link;
break;
}
break;