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 LinkRound from "@assets/icons/link-round.svg?dataurl"
|
||||||
import Icon from "@lib/components/Icon.svelte"
|
import Icon from "@lib/components/Icon.svelte"
|
||||||
import Link from "@lib/components/Link.svelte"
|
import Link from "@lib/components/Link.svelte"
|
||||||
|
import RoomNameWithImage from "@app/components/RoomNameWithImage.svelte"
|
||||||
import {PLATFORM_URL} from "@app/env"
|
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"
|
import {makeRoomPath, makeSpacePath} from "@app/routes"
|
||||||
|
|
||||||
const {
|
const {
|
||||||
|
|
@ -49,8 +50,7 @@
|
||||||
|
|
||||||
<Link {external} {href} class={className}>
|
<Link {external} {href} class={className}>
|
||||||
{#if roomReference}
|
{#if roomReference}
|
||||||
~<span class="text-primary">{displayRelayUrl(roomReference.url)}</span> /
|
<RoomNameWithImage {...roomReference} />
|
||||||
{displayRoom(roomReference.url, roomReference.h)}
|
|
||||||
{:else if relayReference}
|
{:else if relayReference}
|
||||||
<span class="text-primary">{displayRelayUrl(relayReference)}</span>
|
<span class="text-primary">{displayRelayUrl(relayReference)}</span>
|
||||||
{:else}
|
{:else}
|
||||||
|
|
|
||||||
|
|
@ -118,16 +118,18 @@
|
||||||
<Icon icon={GallerySend} />
|
<Icon icon={GallerySend} />
|
||||||
{/if}
|
{/if}
|
||||||
</Button>
|
</Button>
|
||||||
<Tippy
|
<Button
|
||||||
bind:popover
|
disabled={$uploading}
|
||||||
class="join-item h-10 w-10 min-w-10 button button-neutral"
|
onclick={showPopover}
|
||||||
component={ComposeMenu}
|
class="join-item h-10 w-10 min-w-10 button button-neutral">
|
||||||
props={{url, h, onClick: hidePopover}}
|
<Tippy
|
||||||
params={{trigger: "manual", interactive: true}}>
|
bind:popover
|
||||||
<Button disabled={$uploading} onclick={showPopover}>
|
component={ComposeMenu}
|
||||||
|
props={{url, h, onClick: hidePopover}}
|
||||||
|
params={{trigger: "manual", interactive: true}}>
|
||||||
<Icon icon={WidgetAdd} />
|
<Icon icon={WidgetAdd} />
|
||||||
</Button>
|
</Tippy>
|
||||||
</Tippy>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
<div class="chat-editor grow overflow-hidden rounded-box">
|
<div class="chat-editor grow overflow-hidden rounded-box">
|
||||||
<EditorContent {autofocus} {editor} />
|
<EditorContent {autofocus} {editor} />
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
const {url, h, ...props}: Props = $props()
|
const {url, h, ...props}: Props = $props()
|
||||||
</script>
|
</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} />
|
<RoomImage {url} {h} />
|
||||||
<div class="min-w-0 overflow-hidden text-ellipsis">
|
<div class="min-w-0 overflow-hidden text-ellipsis">
|
||||||
<RoomName {url} {h} />
|
<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.
|
// Not a nostr entity; fall through to external url handling.
|
||||||
}
|
}
|
||||||
|
|
||||||
if (/^https?:\/\//i.test(trimmed)) {
|
return {value: ["i", trimmed]}
|
||||||
return {value: ["i", trimmed]}
|
|
||||||
}
|
|
||||||
|
|
||||||
return undefined
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue