Browse Source

Fixed comment box formatting and search term

master
silberengel 7 months ago
parent
commit
d6c5e5d1a3
  1. 14
      src/lib/components/CommentBox.svelte
  2. 4
      src/lib/components/EventSearch.svelte

14
src/lib/components/CommentBox.svelte

@ -622,22 +622,22 @@
</Alert> </Alert>
{/if} {/if}
<div class="flex justify-end items-center gap-4"> <div class="flex flex-col sm:flex-row justify-end items-end sm:items-center gap-4">
{#if userProfile} {#if userProfile}
<div class="flex items-center gap-2 text-sm"> <div class="flex items-center gap-2 text-sm min-w-0 flex-shrink">
{#if userProfile.picture} {#if userProfile.picture}
<img <img
src={userProfile.picture} src={userProfile.picture}
alt={userProfile.name || "Profile"} alt={userProfile.name || "Profile"}
class="w-8 h-8 rounded-full object-cover" class="w-8 h-8 rounded-full object-cover flex-shrink-0"
onerror={(e) => (e.target as HTMLImageElement).style.display = 'none'} onerror={(e) => (e.target as HTMLImageElement).style.display = 'none'}
/> />
{:else} {:else}
<div class="w-8 h-8 rounded-full bg-gray-300 dark:bg-gray-600 flex items-center justify-center"> <div class="w-8 h-8 rounded-full bg-gray-300 dark:bg-gray-600 flex items-center justify-center flex-shrink-0">
<UserOutline class="w-4 h-4 text-gray-600 dark:text-gray-300" /> <UserOutline class="w-4 h-4 text-gray-600 dark:text-gray-300" />
</div> </div>
{/if} {/if}
<span class="text-gray-900 dark:text-gray-100"> <span class="text-gray-900 dark:text-gray-100 truncate">
{userProfile.displayName || {userProfile.displayName ||
userProfile.name || userProfile.name ||
"anon"} "anon"}
@ -646,8 +646,8 @@
{/if} {/if}
<Button <Button
onclick={() => handleSubmit()} onclick={() => handleSubmit()}
disabled={isSubmitting || !content.trim() || !$userStore.pubkey} disabled={isSubmitting || !content.trim() || !$userStore.pubkey}
class="w-full md:w-auto" class="w-auto min-w-[120px]"
> >
{#if !$userStore.pubkey} {#if !$userStore.pubkey}
Not Signed In Not Signed In

4
src/lib/components/EventSearch.svelte

@ -361,7 +361,7 @@
return; return;
} }
if (type === "event") { if (type === "event" || type === "id") {
console.log("EventSearch: Processing event ID search:", term); console.log("EventSearch: Processing event ID search:", term);
// URL navigation is now handled in handleSearchEvent // URL navigation is now handled in handleSearchEvent
await handleEventSearch(term); await handleEventSearch(term);
@ -491,6 +491,8 @@
handleSearchBySubscription("t", activeSearchValue); handleSearchBySubscription("t", activeSearchValue);
} else if (activeSearchType === "n") { } else if (activeSearchType === "n") {
handleSearchBySubscription("n", activeSearchValue); handleSearchBySubscription("n", activeSearchValue);
} else if (activeSearchType === "id") {
handleEventSearch(activeSearchValue);
} }
// Note: "q" (generic) searches are not processed here since they're // Note: "q" (generic) searches are not processed here since they're
// unstructured queries that don't require actual search execution // unstructured queries that don't require actual search execution

Loading…
Cancel
Save