mirror of
https://git.witchcraft.systems/scientific-witchery/pds-dash.git
synced 2025-06-08 16:04:04 +10:00
I guess we displaying posts now
This commit is contained in:
parent
3f03c12152
commit
19eb695b08
14 changed files with 387 additions and 171 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue