Tweak navigation to improve white labeled instances

This commit is contained in:
Jon Staab
2025-05-13 10:14:20 -07:00
parent 42295159a0
commit 18fc895fcb
7 changed files with 42 additions and 38 deletions
+4
View File
@@ -388,6 +388,10 @@ progress[value]::-webkit-progress-value {
@apply w-full md:left-[18.5rem] md:w-[calc(100%-18.5rem-var(--sair))]; @apply w-full md:left-[18.5rem] md:w-[calc(100%-18.5rem-var(--sair))];
} }
.cw-full {
@apply w-full md:left-[4rem] md:w-[calc(100%-4rem-var(--sair))];
}
.cb { .cb {
@apply md:bottom-sai bottom-[calc(var(--saib)+3.5rem)]; @apply md:bottom-sai bottom-[calc(var(--saib)+3.5rem)];
} }
+15 -20
View File
@@ -5,35 +5,30 @@
import CardButton from "@lib/components/CardButton.svelte" import CardButton from "@lib/components/CardButton.svelte"
import MenuSpacesItem from "@app/components/MenuSpacesItem.svelte" import MenuSpacesItem from "@app/components/MenuSpacesItem.svelte"
import SpaceAdd from "@app/components/SpaceAdd.svelte" import SpaceAdd from "@app/components/SpaceAdd.svelte"
import {userRoomsByUrl, PLATFORM_RELAY} from "@app/state" import {userRoomsByUrl} from "@app/state"
import {pushModal} from "@app/modal" import {pushModal} from "@app/modal"
const addSpace = () => pushModal(SpaceAdd) const addSpace = () => pushModal(SpaceAdd)
</script> </script>
<div class="column menu gap-2"> <div class="column menu gap-2">
{#if PLATFORM_RELAY} {#if $userRoomsByUrl.size > 0}
<MenuSpacesItem url={PLATFORM_RELAY} />
<Divider />
{:else if $userRoomsByUrl.size > 0}
{#each $userRoomsByUrl.keys() as url (url)} {#each $userRoomsByUrl.keys() as url (url)}
<MenuSpacesItem {url} /> <MenuSpacesItem {url} />
{/each} {/each}
<Divider /> <Divider />
{/if} {/if}
{#if !PLATFORM_RELAY} <Button onclick={addSpace}>
<Button onclick={addSpace}> <CardButton>
<CardButton> {#snippet icon()}
{#snippet icon()} <div><Icon icon="login-2" size={7} /></div>
<div><Icon icon="login-2" size={7} /></div> {/snippet}
{/snippet} {#snippet title()}
{#snippet title()} <div>Add a space</div>
<div>Add a space</div> {/snippet}
{/snippet} {#snippet info()}
{#snippet info()} <div>Join or create a new space</div>
<div>Join or create a new space</div> {/snippet}
{/snippet} </CardButton>
</CardButton> </Button>
</Button>
{/if}
</div> </div>
+7 -7
View File
@@ -10,7 +10,7 @@
import Link from "@lib/components/Link.svelte" import Link from "@lib/components/Link.svelte"
import Profile from "@app/components/Profile.svelte" import Profile from "@app/components/Profile.svelte"
import ProfileInfo from "@app/components/ProfileInfo.svelte" import ProfileInfo from "@app/components/ProfileInfo.svelte"
import {makeChatPath} from "@app/routes" import {pubkeyLink} from "@app/state"
type Props = { type Props = {
pubkey: string pubkey: string
@@ -37,9 +37,9 @@
<div class="card2 bg-alt col-2 shadow-xl"> <div class="card2 bg-alt col-2 shadow-xl">
<div class="flex justify-between"> <div class="flex justify-between">
<Profile {pubkey} {url} /> <Profile {pubkey} {url} />
<Link class="btn btn-primary hidden sm:flex" href={makeChatPath([pubkey])}> <Link external href={pubkeyLink(pubkey)} class="btn btn-primary hidden sm:flex">
<Icon icon="letter" /> <Icon icon="user-circle" />
Start a Chat See Complete Profile
</Link> </Link>
</div> </div>
<ProfileInfo {pubkey} {url} /> <ProfileInfo {pubkey} {url} />
@@ -48,8 +48,8 @@
Last active {formatTimestampRelative($events[0].created_at)} Last active {formatTimestampRelative($events[0].created_at)}
</div> </div>
{/if} {/if}
<Link class="btn btn-primary sm:hidden" href={makeChatPath([pubkey])}> <Link external href={pubkeyLink(pubkey)} class="btn btn-primary sm:hidden">
<Icon icon="letter" /> <Icon icon="user-circle" />
Start a Chat See Complete Profile
</Link> </Link>
</div> </div>
+12 -5
View File
@@ -1,4 +1,5 @@
<script lang="ts"> <script lang="ts">
import type {Snippet} from "svelte"
import {page} from "$app/stores" import {page} from "$app/stores"
import {goto} from "$app/navigation" import {goto} from "$app/navigation"
import {splitAt} from "@welshman/lib" import {splitAt} from "@welshman/lib"
@@ -16,8 +17,9 @@
import {pushModal} from "@app/modal" import {pushModal} from "@app/modal"
import {makeSpacePath} from "@app/routes" import {makeSpacePath} from "@app/routes"
import {notifications} from "@app/notifications" import {notifications} from "@app/notifications"
interface Props {
children?: import("svelte").Snippet type Props = {
children?: Snippet
} }
const {children}: Props = $props() const {children}: Props = $props()
@@ -118,9 +120,14 @@
notification={$notifications.has("/chat")}> notification={$notifications.has("/chat")}>
<Avatar icon="letter" class="!h-10 !w-10" /> <Avatar icon="letter" class="!h-10 !w-10" />
</PrimaryNavItem> </PrimaryNavItem>
<PrimaryNavItem title="Spaces" onclick={showSpacesMenu} notification={anySpaceNotifications}> {#if !PLATFORM_RELAY}
<Avatar icon="settings-minimalistic" class="!h-10 !w-10" /> <PrimaryNavItem
</PrimaryNavItem> title="Spaces"
onclick={showSpacesMenu}
notification={anySpaceNotifications}>
<Avatar icon="settings-minimalistic" class="!h-10 !w-10" />
</PrimaryNavItem>
{/if}
</div> </div>
<PrimaryNavItem title="Settings" onclick={showSettingsMenu}> <PrimaryNavItem title="Settings" onclick={showSettingsMenu}>
<Avatar icon="settings" src={$userProfile?.picture} class="!h-10 !w-10" /> <Avatar icon="settings" src={$userProfile?.picture} class="!h-10 !w-10" />
+2 -4
View File
@@ -14,9 +14,7 @@
{@render props.input?.()} {@render props.input?.()}
</div> </div>
</div> </div>
<div class="scroll-container overflow-auto"> <div class="scroll-container content-sizing overflow-auto pt-2">
<div class="content-sizing"> {@render props.content?.()}
{@render props.content?.()}
</div>
</div> </div>
</div> </div>
+1 -1
View File
@@ -52,7 +52,7 @@
{/snippet} {/snippet}
</CardButton> </CardButton>
</Link> </Link>
<Link href="/people"> <Link href="/chat">
<CardButton> <CardButton>
{#snippet icon()} {#snippet icon()}
<div><Icon icon="chat-round" size={7} /></div> <div><Icon icon="chat-round" size={7} /></div>
+1 -1
View File
@@ -28,7 +28,7 @@
}) })
</script> </script>
<Page> <Page class="cw-full">
<ContentSearch> <ContentSearch>
{#snippet input()} {#snippet input()}
<label class="row-2 input input-bordered"> <label class="row-2 input input-bordered">