Skip to content

Commit b5b7830

Browse files
committed
fix: address rtl issues, clean up classes, and todos
1 parent 669063c commit b5b7830

File tree

4 files changed

+16
-18
lines changed

4 files changed

+16
-18
lines changed

app/components/BlogPostWrapper.vue

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,6 @@ useSeoMeta({
1313
ogType: 'article',
1414
})
1515
16-
// Hardcoded values for reference/testing
17-
// const BSKY_DID = 'did:plc:jbeaa5kdaladzwq3r7f5xgwe'
18-
// const BSKY_DID = 'did:plc:5ixnpdbogli5f7fbbee5fmuq' // Albie
19-
// const BSKY_POST_ID = '3mcg6svsgsm2k'
20-
// const BSKY_POST_ID = '3mdoijswyz22u'
21-
2216
const slug = computed(() => props.frontmatter?.slug)
2317
2418
// Use Constellation to find the Bluesky post linking to this blog post

app/components/BlueskyComment.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function getHostname(uri: string): string {
5353
v-if="comment.author.avatar"
5454
:src="comment.author.avatar"
5555
:alt="comment.author.displayName || comment.author.handle"
56-
:class="['rounded-full m-0', depth === 0 ? 'w-10 h-10' : 'w-8 h-8']"
56+
:class="['rounded-full', depth === 0 ? 'w-10 h-10' : 'w-8 h-8']"
5757
width="40"
5858
height="40"
5959
loading="lazy"
@@ -123,7 +123,7 @@ function getHostname(uri: string): string {
123123
<img
124124
:src="img.thumb"
125125
:alt="img.alt || 'Embedded image'"
126-
class="rounded-lg max-w-48 max-h-36 object-cover m-0"
126+
class="rounded-lg max-w-48 max-h-36 object-cover"
127127
loading="lazy"
128128
/>
129129
</a>
@@ -141,7 +141,7 @@ function getHostname(uri: string): string {
141141
v-if="comment.embed.external.thumb"
142142
:src="comment.embed.external.thumb"
143143
:alt="comment.embed.external.title"
144-
class="w-20 h-20 rounded object-cover shrink-0 m-0"
144+
class="w-20 h-20 rounded object-cover shrink-0"
145145
loading="lazy"
146146
/>
147147
<div class="min-w-0">
@@ -172,7 +172,7 @@ function getHostname(uri: string): string {
172172

173173
<!-- Nested replies -->
174174
<template v-if="comment.replies.length > 0">
175-
<div v-if="depth < MaxDepth" class="mt-2 pl-2 border-l-2 border-border flex flex-col">
175+
<div v-if="depth < MaxDepth" class="mt-2 ps-2 border-is-2 border-border flex flex-col">
176176
<BlueskyComment
177177
v-for="reply in comment.replies"
178178
:key="reply.uri"

app/components/BlueskyComments.client.vue

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,8 @@ const totalLikes = computed(() => likesInfo.value?.totalLikes || 0)
9696
const { data: likesInfo } = useAsyncData(
9797
`bsky-likes-${props.postUri}`,
9898
async () => {
99-
const encodedUri = encodeURIComponent(props.postUri)
100-
101-
// Default getLikes limit is 50. We use it in conjunction with getPosts
102-
// to show remaining likes
99+
// Default getLikes limit is 50. With 1 <= limit <= 100
100+
// So we use it in conjunction with getPosts to display remaining likes count
103101
const [postData, likesData] = await Promise.all([
104102
$fetch<{ posts: { likeCount?: number }[] }>(`${BSKY_API}app.bsky.feed.getPosts`, {
105103
query: { uris: props.postUri },
@@ -154,7 +152,7 @@ const { data: likesInfo } = useAsyncData(
154152
:href="postUrl"
155153
target="_blank"
156154
rel="noopener noreferrer"
157-
class="link ml-auto"
155+
class="link ms-auto"
158156
>
159157
+{{ totalLikes - likes.length }} more
160158
</a>
@@ -197,7 +195,7 @@ const { data: likesInfo } = useAsyncData(
197195
:href="postUrl"
198196
target="_blank"
199197
rel="noopener noreferrer"
200-
class="link ml-auto"
198+
class="link ms-auto"
201199
>
202200
Reply on Bluesky
203201
</a>

app/composables/useBlogPostBlueskyLink.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ import { NPMX_SITE } from '#shared/utils/constants'
33

44
const BLOG_BACKLINK_TTL_IN_SECONDS = 60 * 5
55

6+
// TODO: Remove did when going live
7+
const TESTING_ROE_DID = 'did:plc:jbeaa5kdaladzwq3r7f5xgwe'
8+
// const TESTING_BACKLINK_URL = 'https://roe.dev/blog/the-golden-thread'
9+
// const NPMX_DID = 'did:plc:u5zp7npt5kpueado77kuihyz'
10+
611
export interface BlogPostBlueskyLink {
712
did: string
813
rkey: string
@@ -16,6 +21,7 @@ export function useBlogPostBlueskyLink(slug: MaybeRefOrGetter<string | null | un
1621
const s = toValue(slug)
1722
if (!s) return null
1823
return `${NPMX_SITE}/blog/${s}`
24+
// return TESTING_BACKLINK_URL
1925
})
2026

2127
return useLazyAsyncData<BlogPostBlueskyLink | null>(
@@ -35,7 +41,7 @@ export function useBlogPostBlueskyLink(slug: MaybeRefOrGetter<string | null | un
3541
1,
3642
undefined,
3743
true,
38-
[['did:plc:jbeaa5kdaladzwq3r7f5xgwe']],
44+
[[TESTING_ROE_DID]],
3945
BLOG_BACKLINK_TTL_IN_SECONDS,
4046
)
4147

@@ -56,7 +62,7 @@ export function useBlogPostBlueskyLink(slug: MaybeRefOrGetter<string | null | un
5662
1,
5763
undefined,
5864
true,
59-
[['did:plc:jbeaa5kdaladzwq3r7f5xgwe']],
65+
[[TESTING_ROE_DID]],
6066
BLOG_BACKLINK_TTL_IN_SECONDS,
6167
)
6268

0 commit comments

Comments
 (0)