Vincenius / bsky-embed

A web-component to easily embed a bluesky feed.
87 stars 14 forks source link

Bug hunting complete #17

Closed NicoNotAvailable closed 7 months ago

NicoNotAvailable commented 7 months ago

I tried my bost to fix the red errors and added to types to most objects. :D

index.tsx & api.tsx Added types to both consts.

BskyPost.tsx Added type Text to t in Line 41, which is an interface implemented in utils.tsx. Further type'd image in Line 47.

App.tsx Added "types" to option.mode to its corresponding "enums". Added "types" to option.linkTarget to its corresponding "enums".

BskyEmbed.tsx Added conditional type null to modaRef and modalImageRef and changed the dialog ref in the return so it's "not called before it has been assigned" Added a types to e and image in handleModalContent

utils.tsx Implemted interfaces Text and Reason for further descriptions of those variables. I tried to remove any any but post was a bit too abstract, tho i really do want to find a way to un-any post as well 👀 And changed the way the timeDifference is calculated by using current.getTime() - previous.getTime();

Please let me know if anything needs polishing still!

Vincenius commented 7 months ago

Awesome! It looks great - thanks for your support :)