tangled
alpha
login
or
join now
leaflet.pub
/
leaflet
289
fork
atom
a tool for shared writing and social publishing
289
fork
atom
overview
issues
28
pulls
pipelines
handle standalone doc comments
awarm.space
3 months ago
833eeb06
ca0b0c1f
+27
-9
3 changed files
expand all
collapse all
unified
split
app
(home-pages)
notifications
CommentNotication.tsx
MentionNotification.tsx
ReplyNotification.tsx
+9
-3
app/(home-pages)/notifications/CommentNotication.tsx
···
27
27
props.commentData.bsky_profiles?.handle ||
28
28
"Someone";
29
29
const pubRecord = props.commentData.documents?.documents_in_publications[0]
30
30
-
?.publications?.record as PubLeafletPublication.Record;
31
31
-
let rkey = new AtUri(props.commentData.documents?.uri!).rkey;
30
30
+
?.publications?.record as PubLeafletPublication.Record | undefined;
31
31
+
let docUri = new AtUri(props.commentData.documents?.uri!);
32
32
+
let rkey = docUri.rkey;
33
33
+
let did = docUri.host;
34
34
+
35
35
+
const href = pubRecord
36
36
+
? `https://${pubRecord.base_path}/${rkey}?interactionDrawer=comments`
37
37
+
: `/p/${did}/${rkey}?interactionDrawer=comments`;
32
38
33
39
return (
34
40
<Notification
35
41
timestamp={props.commentData.indexed_at}
36
36
-
href={`https://${pubRecord.base_path}/${rkey}?interactionDrawer=comments`}
42
42
+
href={href}
37
43
icon={<CommentTiny />}
38
44
actionText={<>{displayName} commented on your post</>}
39
45
content={
+9
-3
app/(home-pages)/notifications/MentionNotification.tsx
···
11
11
const displayName = author.displayName || author.handle || "Someone";
12
12
const docRecord = props.document.data as PubLeafletDocument.Record;
13
13
const pubRecord = props.document.documents_in_publications[0]?.publications
14
14
-
?.record as PubLeafletPublication.Record;
15
15
-
const rkey = new AtUri(props.document.uri).rkey;
14
14
+
?.record as PubLeafletPublication.Record | undefined;
15
15
+
const docUri = new AtUri(props.document.uri);
16
16
+
const rkey = docUri.rkey;
17
17
+
const did = docUri.host;
16
18
const postText = postView.record?.text || "";
17
19
20
20
+
const href = pubRecord
21
21
+
? `https://${pubRecord.base_path}/${rkey}`
22
22
+
: `/p/${did}/${rkey}`;
23
23
+
18
24
return (
19
25
<Notification
20
26
timestamp={props.created_at}
21
21
-
href={`https://${pubRecord.base_path}/${rkey}`}
27
27
+
href={href}
22
28
icon={<QuoteTiny />}
23
29
actionText={<>{displayName} quoted your post</>}
24
30
content={
+9
-3
app/(home-pages)/notifications/ReplyNotification.tsx
···
34
34
props.parentData?.bsky_profiles?.handle ||
35
35
"Someone";
36
36
37
37
-
let rkey = new AtUri(props.commentData.documents?.uri!).rkey;
37
37
+
let docUri = new AtUri(props.commentData.documents?.uri!);
38
38
+
let rkey = docUri.rkey;
39
39
+
let did = docUri.host;
38
40
const pubRecord = props.commentData.documents?.documents_in_publications[0]
39
39
-
?.publications?.record as PubLeafletPublication.Record;
41
41
+
?.publications?.record as PubLeafletPublication.Record | undefined;
42
42
+
43
43
+
const href = pubRecord
44
44
+
? `https://${pubRecord.base_path}/${rkey}?interactionDrawer=comments`
45
45
+
: `/p/${did}/${rkey}?interactionDrawer=comments`;
40
46
41
47
return (
42
48
<Notification
43
49
timestamp={props.commentData.indexed_at}
44
44
-
href={`https://${pubRecord.base_path}/${rkey}?interactionDrawer=comments`}
50
50
+
href={href}
45
51
icon={<ReplyTiny />}
46
52
actionText={`${displayName} replied to your comment`}
47
53
content={