diff options
| author | Adrien Hopkins <[email protected]> | 2025-08-26 10:31:06 -0500 |
|---|---|---|
| committer | Adrien Hopkins <[email protected]> | 2025-08-26 10:31:06 -0500 |
| commit | 8e9ae1dcaccf9d58b29865f296c01c5ace1f581b (patch) | |
| tree | 693cf5013d7692135cf9f113bd038482db3fe21f /src | |
| parent | 78a7f50c06e8c0c5cf0dc7ae5dcf520cc030bcc0 (diff) | |
| download | coinos-ui-8e9ae1dcaccf9d58b29865f296c01c5ace1f581b.tar.gz coinos-ui-8e9ae1dcaccf9d58b29865f296c01c5ace1f581b.zip | |
Determine DM recipient's pubkey
Diffstat (limited to 'src')
| -rw-r--r-- | src/routes/(app)/dm/[recipient]/+page.server.ts | 9 | ||||
| -rw-r--r-- | src/routes/(app)/dm/[recipient]/+page.svelte | 28 |
2 files changed, 20 insertions, 17 deletions
diff --git a/src/routes/(app)/dm/[recipient]/+page.server.ts b/src/routes/(app)/dm/[recipient]/+page.server.ts index e202d8b4..0a320137 100644 --- a/src/routes/(app)/dm/[recipient]/+page.server.ts +++ b/src/routes/(app)/dm/[recipient]/+page.server.ts @@ -1,5 +1,6 @@ -export function load({ params }) { - return { - recipient: params.recipient - }; +import { get } from "$lib/utils"; + +export async function load({ params }) { + const recipient = await get(`/users/${params.recipient}`); + return { recipient }; } diff --git a/src/routes/(app)/dm/[recipient]/+page.svelte b/src/routes/(app)/dm/[recipient]/+page.svelte index c65931f5..aff22eed 100644 --- a/src/routes/(app)/dm/[recipient]/+page.svelte +++ b/src/routes/(app)/dm/[recipient]/+page.svelte @@ -1,22 +1,24 @@ <script lang="ts"> - let { data } = $props(); import Icon from "$comp/Icon.svelte"; + + let { data } = $props(); + const { recipient } = data; </script> <div class="container"> - <a - class="hover:opacity-80" - data-sveltekit-preload-data="false" - href="/{data.recipient}" - > - <Icon icon="arrow-left" style="w-10" /> - </a> + <a + class="hover:opacity-80" + data-sveltekit-preload-data="false" + href="/{data.recipient}" + > + <Icon icon="arrow-left" style="w-10" /> + </a> - <div class="space-y-2 mx-auto space-y-5 lg:max-w-xl xl:max-w-2xl lg:pl-10 mt-5 lg:mt-0"> - <h1 - class="text-5xl font-medium text-left w-full mx-auto lg:mx-0 md:w-[500px]" - >Direct Messages</h1> - <p>You are sending nostr messages to {data.recipient}.</p> + <div class="space-y-2 mx-auto space-y-5 lg:max-w-xl xl:max-w-2xl lg:pl-10 mt-5 lg:mt-0"> + <h1 + class="text-5xl font-medium text-left w-full mx-auto lg:mx-0 md:w-[500px]" + >Direct Messages</h1> + <p><em>Testing Message:</em> You are sending nostr messages to {recipient.username}. Their pubkey is <code>{recipient.pubkey}</code>.</p> <textarea id="message-contents"></textarea> |
