diff options
| author | Adam Soltys <[email protected]> | 2024-10-10 00:07:06 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-10-10 12:18:06 -0700 |
| commit | aa5ab97f1b314bd4e7a2358e49572eb1a02baf7b (patch) | |
| tree | 9fb16551ad69418702bac9ec0c14425aa2089e95 /src/routes/(app) | |
| parent | 3b81537518b8ee89848628899eeec9462c8c4bb0 (diff) | |
| download | coinos-ui-aa5ab97f1b314bd4e7a2358e49572eb1a02baf7b.tar.gz coinos-ui-aa5ab97f1b314bd4e7a2358e49572eb1a02baf7b.zip | |
followers
Diffstat (limited to 'src/routes/(app)')
4 files changed, 28 insertions, 20 deletions
diff --git a/src/routes/(app)/[username]/(profile)/+layout.server.ts b/src/routes/(app)/[username]/(profile)/+layout.server.ts index ebb0d6ee..14580694 100644 --- a/src/routes/(app)/[username]/(profile)/+layout.server.ts +++ b/src/routes/(app)/[username]/(profile)/+layout.server.ts @@ -1,6 +1,6 @@ import { get } from "$lib/utils"; - export async function load({ depends, parent }) { +export async function load({ depends, parent }) { depends("app:user"); let { subject, user } = await parent(); @@ -14,13 +14,13 @@ import { get } from "$lib/utils"; console.log("problem fetching follows", e); } - // try { - // subject.followers = await get(`/${subject.pubkey}/followers`); - // } catch (e) { - // console.log("problem fetching followers", e); - // } + try { + subject.followers = await get(`/${subject.pubkey}/followers`); + } catch (e) { + console.log("problem fetching followers", e); + } - subject.followers = []; + // subject.followers = []; if (user) { user.follows = await get(`/${user.pubkey}/follows?tagsonly=true`); } diff --git a/src/routes/(app)/[username]/(profile)/+layout.svelte b/src/routes/(app)/[username]/(profile)/+layout.svelte index 650eab41..550b43cf 100644 --- a/src/routes/(app)/[username]/(profile)/+layout.svelte +++ b/src/routes/(app)/[username]/(profile)/+layout.svelte @@ -2,7 +2,7 @@ import { invalidate } from "$app/navigation"; import { browser } from "$app/environment"; import { hexToUint8Array } from "uint8array-extras"; - import { copy, f, get, post, s, sats, success, fail } from "$lib/utils"; + import { copy, f, get, post, s, sats, success, fail, si } from "$lib/utils"; import Icon from "$comp/Icon.svelte"; import { t } from "$lib/translations"; import { sign, send } from "$lib/nostr"; @@ -105,27 +105,35 @@ <Icon icon="qr" style="w-8 invert my-auto" /> </button> - {#if subject.address} + {#if subject.address || subject.about} <div - class="text-secondary mx-auto text-center lg:mx-0" + class="text-secondary mx-auto text-center lg:mx-0 break-words space-y-1" class:line-clamp-2={!showBio} on:click={toggleBio} on:keydown={toggleBio} > - {subject.address} + <div> + {subject.address || subject.about} + </div> + + {#if subject.website} + <div> + <a href={subject.website} class="underline">{subject.website}</a> + </div> + {/if} </div> {/if} <div> <div class="flex justify-center gap-2"> <a href={`/${subject.pubkey}/follows`} data-sveltekit-preload-data="tap" - ><b>{subject.follows.length}</b> + ><b>{si(subject.follows.length)}</b> <span class="text-secondary">{$t("user.following")}</span></a > <a href={`/${subject.pubkey}/followers`} data-sveltekit-preload-data="tap" - ><b>{subject.followers.length}</b> + ><b>{si(subject.count)}</b> <span class="text-secondary">{$t("user.followers")}</span></a > </div> diff --git a/src/routes/(app)/[username]/(profile)/followers/+page.svelte b/src/routes/(app)/[username]/(profile)/followers/+page.svelte index e087ad42..d1e808d6 100644 --- a/src/routes/(app)/[username]/(profile)/followers/+page.svelte +++ b/src/routes/(app)/[username]/(profile)/followers/+page.svelte @@ -22,9 +22,9 @@ {#if browser} {#if followers.length} <VirtualScroll data={followers} key="pubkey" let:data pageMode={true}> - <a href={`/${data.pubkey}`}> + <a href={`/${data.pubkey}`} data-sveltekit-preload-data="tap"> <div - class="flex border-b last:border-b-0 py-4 text-sm lg:text-lg text-secondary" + class="flex border-b last:border-b-0 py-4 text-2xl text-secondary" :key={data.pubkey} > <div class="mb-auto mr-2"> @@ -38,8 +38,8 @@ <div class="w-full flex pb-1 text-black my-auto"> <div> - {data.display_name || ""} - <span class="text-secondary">@{data.username}</span> + <div>{data.display_name || ""}</div> + <div class="text-secondary text-lg">@{data.name}</div> </div> </div> </div> diff --git a/src/routes/(app)/[username]/(profile)/follows/+page.svelte b/src/routes/(app)/[username]/(profile)/follows/+page.svelte index ff0bdb93..0281add9 100644 --- a/src/routes/(app)/[username]/(profile)/follows/+page.svelte +++ b/src/routes/(app)/[username]/(profile)/follows/+page.svelte @@ -24,7 +24,7 @@ <svelte:window bind:innerWidth={w} /> -<div class="px-3 md:px-0 w-full md:w-[400px] mx-auto space-y-8"> +<div class="px-3 md:px-0 w-full md:w-[400px] mx-auto"> <h1 class="px-3 md:px-0 text-center text-3xl md:text-4xl font-semibold"> {$t("user.following")} </h1> @@ -32,9 +32,9 @@ {#if follows.length} {#if browser} <VirtualScroll data={follows} key="pubkey" let:data pageMode={true}> - <a href={`/${data.pubkey}/follows`} data-sveltekit-preload-data="tap"> + <a href={`/${data.pubkey}`} data-sveltekit-preload-data="tap"> <div - class="flex py-4 text-sm lg:text-lg text-secondary" + class="flex py-4 text-lg text-secondary" :key={data.pubkey} > <div class="mb-auto mr-2"> |
