aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2025-01-23 12:22:26 -0800
committerAdam Soltys <[email protected]>2025-01-23 12:22:26 -0800
commitb685dc5d29141087c991bf022970beb27c8c079f (patch)
tree768fb9d97068705191a7cc7ed9e0146babeb2b8f
parenteaf9b3fa08282d89e3e40fefeccd83904185f8a2 (diff)
downloadcoinos-ui-b685dc5d29141087c991bf022970beb27c8c079f.tar.gz
coinos-ui-b685dc5d29141087c991bf022970beb27c8c079f.zip
follows
-rw-r--r--src/components/Media.svelte4
-rw-r--r--src/routes/(app)/[username]/(profile)/+layout.server.ts16
-rw-r--r--src/routes/(app)/[username]/(profile)/+layout.svelte38
-rw-r--r--src/routes/(app)/[username]/(profile)/followers/+page.svelte6
-rw-r--r--src/routes/(app)/[username]/(profile)/follows/+page.server.js3
5 files changed, 34 insertions, 33 deletions
diff --git a/src/components/Media.svelte b/src/components/Media.svelte
index aff4cf39..c2a79a2b 100644
--- a/src/components/Media.svelte
+++ b/src/components/Media.svelte
@@ -20,8 +20,8 @@
<a href={value.url}>{value.url.replace(/https?:\/\/(www\.)?/, "")}</a>
</audio>
{:else}
- <a href={value.url}>
- {value.url.replace(/https?:\/\/(www\.)?/, "")}
+ <a href={value.url} class="underline">
+ link
</a>
{/if}
</div>
diff --git a/src/routes/(app)/[username]/(profile)/+layout.server.ts b/src/routes/(app)/[username]/(profile)/+layout.server.ts
index 8600039e..d714ce76 100644
--- a/src/routes/(app)/[username]/(profile)/+layout.server.ts
+++ b/src/routes/(app)/[username]/(profile)/+layout.server.ts
@@ -7,17 +7,15 @@ export async function load({ depends, parent }) {
const rates = await getRates();
const { subject, user } = await parent();
- // const { follows, followers } = await get(`/${subject.pubkey}/count`);
+ const { follows, followers } = await get(`/${subject.pubkey}/count`);
let followList = new Promise((r) => r([]));
- // if (user)
- // followList = get(`/${user.pubkey}/follows?pubkeysOnly=true`).catch(
- // () => [],
- // );
- //
+ if (user)
+ followList = get(`/${user.pubkey}/follows?pubkeysOnly=true`).catch(
+ () => [],
+ );
- const follows = [];
- const followers = [];
- // const followList = [];
+ // const follows = [];
+ // const followers = [];
return { follows, followers, followList, rate: rates[subject.currency] };
}
diff --git a/src/routes/(app)/[username]/(profile)/+layout.svelte b/src/routes/(app)/[username]/(profile)/+layout.svelte
index a219a487..9536d330 100644
--- a/src/routes/(app)/[username]/(profile)/+layout.svelte
+++ b/src/routes/(app)/[username]/(profile)/+layout.svelte
@@ -125,7 +125,7 @@
<iconify-icon noobserver icon="ph:qr-code-bold" width="32"
></iconify-icon>
</div>
- <a href={`/${n}/notes`}>
+ <a href={`/${subject.pubkey}/notes`}>
<iconify-icon noobserver icon="ph:note-bold" width="32"></iconify-icon>
</a>
</button>
@@ -149,24 +149,24 @@
</div>
{/if}
- <!-- <div> -->
- <!-- <div class="flex justify-center gap-2"> -->
- <!-- <a -->
- <!-- href={`/${subject.pubkey}/follows`} -->
- <!-- data-sveltekit-preload-data="tap" -->
- <!-- rel="nofollow" -->
- <!-- ><b>{si(follows, 0, 0)}</b> -->
- <!-- <span class="text-secondary">{$t("user.following")}</span></a -->
- <!-- > -->
- <!-- <a -->
- <!-- href={`/${subject.pubkey}/followers`} -->
- <!-- data-sveltekit-preload-data="tap" -->
- <!-- rel="nofollow" -->
- <!-- ><b>{si(followers, 0, 0)}</b> -->
- <!-- <span class="text-secondary">{$t("user.followers")}</span></a -->
- <!-- > -->
- <!-- </div> -->
- <!-- </div> -->
+ <div>
+ <div class="flex justify-center gap-2">
+ <a
+ href={`/${subject.pubkey}/follows`}
+ data-sveltekit-preload-data="tap"
+ rel="nofollow"
+ ><b>{si(follows, 0, 0)}</b>
+ <span class="text-secondary">{$t("user.following")}</span></a
+ >
+ <a
+ href={`/${subject.pubkey}/followers`}
+ data-sveltekit-preload-data="tap"
+ rel="nofollow"
+ ><b>{si(followers, 0, 0)}</b>
+ <span class="text-secondary">{$t("user.followers")}</span></a
+ >
+ </div>
+ </div>
{#if showDetails}
<div class="space-y-5 pb-20">
diff --git a/src/routes/(app)/[username]/(profile)/followers/+page.svelte b/src/routes/(app)/[username]/(profile)/followers/+page.svelte
index 62f05a0a..28b4c6f0 100644
--- a/src/routes/(app)/[username]/(profile)/followers/+page.svelte
+++ b/src/routes/(app)/[username]/(profile)/followers/+page.svelte
@@ -39,8 +39,10 @@
<div class="w-full flex pb-1 text-black my-auto">
<div>
- <div>{data.display || ""}</div>
- <div class="text-secondary text-lg">@{data.username}</div>
+ <div>{data.display || data.display_name || ""}</div>
+ <div class="text-secondary text-base">
+ @{data.username || data.name}
+ </div>
</div>
</div>
</div>
diff --git a/src/routes/(app)/[username]/(profile)/follows/+page.server.js b/src/routes/(app)/[username]/(profile)/follows/+page.server.js
index 9fbe37a3..946f2c1f 100644
--- a/src/routes/(app)/[username]/(profile)/follows/+page.server.js
+++ b/src/routes/(app)/[username]/(profile)/follows/+page.server.js
@@ -3,6 +3,7 @@ import { get } from "$lib/utils";
export async function load({ depends, parent }) {
depends("app:user");
const { subject } = await parent();
- const follows = get(`/${subject.pubkey}/follows`).catch(() => []);
+ const follows = await get(`/${subject.pubkey}/follows`);
+
return { follows };
}