+11
-5
src/lib/AccountComponent.svelte
+11
-5
src/lib/AccountComponent.svelte
···
3
3
const { account }: { account: AccountMetadata } = $props();
4
4
import { Config } from "../../config";
5
5
</script>
6
-
<div id="accountContainer">
6
+
7
+
<a id="link" href="{Config.FRONTEND_URL}/profile/{account.did}">
8
+
<div id="accountContainer">
7
9
{#if account.avatarCid}
8
10
<img
9
11
id="avatar"
···
11
13
src="{Config.PDS_URL}/xrpc/com.atproto.sync.getBlob?did={account.did}&cid={account.avatarCid}"
12
14
/>
13
15
{/if}
14
-
<div id="accountName">{account.displayName || account.did}</div>
15
-
</div>
16
+
<div id="accountName">
17
+
{account.displayName || account.handle || account.did}
18
+
</div>
19
+
</div>
20
+
</a>
21
+
16
22
<style>
17
23
#accountContainer {
18
24
display: flex;
···
28
34
#accountName {
29
35
margin-left: 10px;
30
36
font-size: 0.9em;
31
-
37
+
32
38
/* replace overflow with ellipsis */
33
39
overflow: hidden;
34
40
text-overflow: ellipsis;
···
40
46
height: 50px;
41
47
border-radius: 50%;
42
48
}
43
-
</style>
49
+
</style>
+12
-3
src/lib/PostComponent.svelte
+12
-3
src/lib/PostComponent.svelte
···
1
1
<script lang="ts">
2
2
import { Post } from "./pdsfetch";
3
-
import { Config } from "../../config"
3
+
import { Config } from "../../config";
4
4
let { post }: { post: Post } = $props();
5
5
</script>
6
6
···
13
13
alt="avatar of {post.displayName}"
14
14
/>
15
15
{/if}
16
-
<div id="headerText">{post.displayName} | {post.authorHandle} | {post.timenotstamp}</div>
16
+
<div id="headerText">
17
+
<a href="{Config.FRONTEND_URL}/profile/{post.authorDid}"
18
+
>{post.displayName} ( {post.authorHandle} )</a
19
+
>
20
+
|
21
+
<a href="{Config.FRONTEND_URL}/profile/{post.authorDid}/post/{post.cid}"
22
+
>{post.timenotstamp}</a
23
+
>
24
+
</div>
17
25
</div>
18
26
<div id="postContent">
19
-
<p>{post.text}</p>
20
27
{#if post.replyingUri}
21
28
<a
22
29
id="replyingText"
···
24
31
.replyingUri.rkey}">replying to {post.replyingUri.repo}</a
25
32
>
26
33
{/if}
34
+
<p>{post.text}</p>
35
+
27
36
{#if post.quotingUri}
28
37
<a
29
38
id="quotingText"
+2
src/lib/pdsfetch.ts
+2
src/lib/pdsfetch.ts
···
31
31
class Post {
32
32
authorDid: string;
33
33
authorAvatarCid: string | null;
34
+
postCid: string;
34
35
authorHandle: string;
35
36
displayName: string;
36
37
text: string;
···
45
46
record: ComAtprotoRepoListRecords.Record,
46
47
account: AccountMetadata,
47
48
) {
49
+
this.postCid = record.cid;
48
50
this.authorDid = account.did;
49
51
this.authorAvatarCid = account.avatarCid;
50
52
this.authorHandle = account.handle;