Allow pinning anything, fix a few display bugs
This commit is contained in:
parent
c2684497f9
commit
b8f64a5f49
4 changed files with 16 additions and 18 deletions
|
|
@ -4,8 +4,9 @@
|
|||
import LinkRound from "@assets/icons/link-round.svg?dataurl"
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
import Link from "@lib/components/Link.svelte"
|
||||
import RoomNameWithImage from "@app/components/RoomNameWithImage.svelte"
|
||||
import {PLATFORM_URL} from "@app/env"
|
||||
import {displayRoom, isRoomId, splitRoomId} from "@app/groups"
|
||||
import {isRoomId, splitRoomId} from "@app/groups"
|
||||
import {makeRoomPath, makeSpacePath} from "@app/routes"
|
||||
|
||||
const {
|
||||
|
|
@ -49,8 +50,7 @@
|
|||
|
||||
<Link {external} {href} class={className}>
|
||||
{#if roomReference}
|
||||
~<span class="text-primary">{displayRelayUrl(roomReference.url)}</span> /
|
||||
{displayRoom(roomReference.url, roomReference.h)}
|
||||
<RoomNameWithImage {...roomReference} />
|
||||
{:else if relayReference}
|
||||
<span class="text-primary">{displayRelayUrl(relayReference)}</span>
|
||||
{:else}
|
||||
|
|
|
|||
|
|
@ -118,16 +118,18 @@
|
|||
<Icon icon={GallerySend} />
|
||||
{/if}
|
||||
</Button>
|
||||
<Tippy
|
||||
bind:popover
|
||||
class="join-item h-10 w-10 min-w-10 button button-neutral"
|
||||
component={ComposeMenu}
|
||||
props={{url, h, onClick: hidePopover}}
|
||||
params={{trigger: "manual", interactive: true}}>
|
||||
<Button disabled={$uploading} onclick={showPopover}>
|
||||
<Button
|
||||
disabled={$uploading}
|
||||
onclick={showPopover}
|
||||
class="join-item h-10 w-10 min-w-10 button button-neutral">
|
||||
<Tippy
|
||||
bind:popover
|
||||
component={ComposeMenu}
|
||||
props={{url, h, onClick: hidePopover}}
|
||||
params={{trigger: "manual", interactive: true}}>
|
||||
<Icon icon={WidgetAdd} />
|
||||
</Button>
|
||||
</Tippy>
|
||||
</Tippy>
|
||||
</Button>
|
||||
</div>
|
||||
<div class="chat-editor grow overflow-hidden rounded-box">
|
||||
<EditorContent {autofocus} {editor} />
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
const {url, h, ...props}: Props = $props()
|
||||
</script>
|
||||
|
||||
<div class="flex min-w-0 items-center gap-2 {props.class}">
|
||||
<div class="inline-flex min-w-0 items-center gap-2 {props.class}">
|
||||
<RoomImage {url} {h} />
|
||||
<div class="min-w-0 overflow-hidden text-ellipsis">
|
||||
<RoomName {url} {h} />
|
||||
|
|
|
|||
|
|
@ -209,9 +209,5 @@ export const referenceToPin = (reference: string): Partial<Pin> | undefined => {
|
|||
// Not a nostr entity; fall through to external url handling.
|
||||
}
|
||||
|
||||
if (/^https?:\/\//i.test(trimmed)) {
|
||||
return {value: ["i", trimmed]}
|
||||
}
|
||||
|
||||
return undefined
|
||||
return {value: ["i", trimmed]}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue