mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
refac: navbar styling
This commit is contained in:
parent
170361c27e
commit
a57a01a598
@ -2,7 +2,16 @@
|
|||||||
import { getContext } from 'svelte';
|
import { getContext } from 'svelte';
|
||||||
import { toast } from 'svelte-sonner';
|
import { toast } from 'svelte-sonner';
|
||||||
|
|
||||||
import { WEBUI_NAME, chatId, modelfiles, settings, showSettings, showSidebar } from '$lib/stores';
|
import {
|
||||||
|
WEBUI_NAME,
|
||||||
|
chatId,
|
||||||
|
mobile,
|
||||||
|
modelfiles,
|
||||||
|
settings,
|
||||||
|
showSettings,
|
||||||
|
showSidebar,
|
||||||
|
user
|
||||||
|
} from '$lib/stores';
|
||||||
|
|
||||||
import { slide } from 'svelte/transition';
|
import { slide } from 'svelte/transition';
|
||||||
import ShareChatModal from '../chat/ShareChatModal.svelte';
|
import ShareChatModal from '../chat/ShareChatModal.svelte';
|
||||||
@ -10,6 +19,7 @@
|
|||||||
import Tooltip from '../common/Tooltip.svelte';
|
import Tooltip from '../common/Tooltip.svelte';
|
||||||
import Menu from './Navbar/Menu.svelte';
|
import Menu from './Navbar/Menu.svelte';
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/stores';
|
||||||
|
import UserMenu from './Sidebar/UserMenu.svelte';
|
||||||
|
|
||||||
const i18n = getContext('i18n');
|
const i18n = getContext('i18n');
|
||||||
|
|
||||||
@ -155,6 +165,29 @@
|
|||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
|
||||||
|
{#if !$mobile && $user !== undefined}
|
||||||
|
<UserMenu
|
||||||
|
role={$user.role}
|
||||||
|
on:show={(e) => {
|
||||||
|
if (e.detail === 'archived-chat') {
|
||||||
|
// showArchivedChatsModal = true;
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
class=" flex rounded-xl p-1.5 w-full hover:bg-gray-100 dark:hover:bg-gray-850 transition"
|
||||||
|
>
|
||||||
|
<div class=" self-center">
|
||||||
|
<img
|
||||||
|
src={$user.profile_image_url}
|
||||||
|
class=" size-6 object-cover rounded-full"
|
||||||
|
alt="User profile"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</button>
|
||||||
|
</UserMenu>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,6 +1,15 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { goto } from '$app/navigation';
|
import { goto } from '$app/navigation';
|
||||||
import { user, chats, settings, showSettings, chatId, tags, showSidebar } from '$lib/stores';
|
import {
|
||||||
|
user,
|
||||||
|
chats,
|
||||||
|
settings,
|
||||||
|
showSettings,
|
||||||
|
chatId,
|
||||||
|
tags,
|
||||||
|
showSidebar,
|
||||||
|
mobile
|
||||||
|
} from '$lib/stores';
|
||||||
import { onMount, getContext } from 'svelte';
|
import { onMount, getContext } from 'svelte';
|
||||||
|
|
||||||
const i18n = getContext('i18n');
|
const i18n = getContext('i18n');
|
||||||
@ -703,6 +712,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{#if $mobile}
|
||||||
<div class="px-2.5">
|
<div class="px-2.5">
|
||||||
<!-- <hr class=" border-gray-900 mb-1 w-full" /> -->
|
<!-- <hr class=" border-gray-900 mb-1 w-full" /> -->
|
||||||
|
|
||||||
@ -735,6 +745,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
<slot name="content">
|
<slot name="content">
|
||||||
<DropdownMenu.Content
|
<DropdownMenu.Content
|
||||||
class="w-full max-w-[240px] rounded-lg p-1 py-1 border border-gray-850 z-50 bg-gray-850 text-white text-sm"
|
class="w-full max-w-[240px] rounded-lg p-1 py-1 border border-gray-300/30 dark:border-gray-700/50 z-50 bg-gray-850 text-white text-sm"
|
||||||
sideOffset={8}
|
sideOffset={8}
|
||||||
side="bottom"
|
side="bottom"
|
||||||
align="start"
|
align="start"
|
||||||
|
Loading…
Reference in New Issue
Block a user