From dc746ca93b4c4f3fc1146dea019c10deedea9d74 Mon Sep 17 00:00:00 2001 From: Coracle-Bot Date: Wed, 9 Sep 2026 21:43:17 +0000 Subject: [PATCH] Split HomeInboxItem into one component per conversation kind --- src/app/components/HomeInboxItem.svelte | 86 +++++-------------- src/app/components/HomeInboxItemCard.svelte | 47 ++++++++++ src/app/components/HomeInboxItemChat.svelte | 37 ++++++++ src/app/components/HomeInboxItemRoom.svelte | 28 ++++++ .../components/HomeInboxItemSpaceChat.svelte | 26 ++++++ 5 files changed, 158 insertions(+), 66 deletions(-) create mode 100644 src/app/components/HomeInboxItemCard.svelte create mode 100644 src/app/components/HomeInboxItemChat.svelte create mode 100644 src/app/components/HomeInboxItemRoom.svelte create mode 100644 src/app/components/HomeInboxItemSpaceChat.svelte diff --git a/src/app/components/HomeInboxItem.svelte b/src/app/components/HomeInboxItem.svelte index 2269324a..8eee9bd3 100644 --- a/src/app/components/HomeInboxItem.svelte +++ b/src/app/components/HomeInboxItem.svelte @@ -1,14 +1,7 @@ - - {#if url} - - {:else} - - {/if} -
-
- - {#if url} - {#if h} - - {:else} - Chat - {/if} - {:else if others.length === 0} - Note to self - {:else} - - {#if others.length > 1} - and {others.length - 1} {others.length > 2 ? "others" : "other"} - {/if} - {/if} - - - {#if url} - - {:else} - direct message - {/if} - -
-
- - {#if event.pubkey === $user.pubkey} - You: - {:else} - : - {/if} - -
- -
-
-
-
- {formatTimestamp(event.created_at)} - -
- +{#if conversation.url && conversation.h} + +{:else if conversation.url} + +{:else} + +{/if} diff --git a/src/app/components/HomeInboxItemCard.svelte b/src/app/components/HomeInboxItemCard.svelte new file mode 100644 index 00000000..8e4ce216 --- /dev/null +++ b/src/app/components/HomeInboxItemCard.svelte @@ -0,0 +1,47 @@ + + + + {@render icon()} +
+
+ {@render title()} + {@render subtitle()} +
+
+ + {#if event.pubkey === $user.pubkey} + You: + {:else} + : + {/if} + +
+ +
+
+
+
+ {formatTimestamp(event.created_at)} + +
+ diff --git a/src/app/components/HomeInboxItemChat.svelte b/src/app/components/HomeInboxItemChat.svelte new file mode 100644 index 00000000..865be043 --- /dev/null +++ b/src/app/components/HomeInboxItemChat.svelte @@ -0,0 +1,37 @@ + + + + {#snippet icon()} + + {/snippet} + {#snippet title()} + {#if others.length > 0} + + {#if others.length > 1} + and {others.length - 1} {others.length > 2 ? "others" : "other"} + {/if} + {:else} + Note to self + {/if} + {/snippet} + {#snippet subtitle()} + direct message + {/snippet} + diff --git a/src/app/components/HomeInboxItemRoom.svelte b/src/app/components/HomeInboxItemRoom.svelte new file mode 100644 index 00000000..d2b03762 --- /dev/null +++ b/src/app/components/HomeInboxItemRoom.svelte @@ -0,0 +1,28 @@ + + + + {#snippet icon()} + + {/snippet} + {#snippet title()} + + {/snippet} + {#snippet subtitle()} + + {/snippet} + diff --git a/src/app/components/HomeInboxItemSpaceChat.svelte b/src/app/components/HomeInboxItemSpaceChat.svelte new file mode 100644 index 00000000..d693b679 --- /dev/null +++ b/src/app/components/HomeInboxItemSpaceChat.svelte @@ -0,0 +1,26 @@ + + + + {#snippet icon()} + + {/snippet} + {#snippet title()} + Chat + {/snippet} + {#snippet subtitle()} + + {/snippet} +