Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
fd98add6
Commit
fd98add6
authored
May 26, 2024
by
Timothy J. Baek
Browse files
refac: styling
Co-Authored-By:
Jun Siang Cheah
<
me@jscheah.me
>
parent
242d4f0c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
33 deletions
+29
-33
src/lib/components/chat/Chat.svelte
src/lib/components/chat/Chat.svelte
+21
-19
src/lib/components/common/Banner.svelte
src/lib/components/common/Banner.svelte
+7
-8
src/routes/(app)/+layout.svelte
src/routes/(app)/+layout.svelte
+1
-6
No files found.
src/lib/components/chat/Chat.svelte
View file @
fd98add6
...
@@ -1008,8 +1008,9 @@
...
@@ -1008,8 +1008,9 @@
/>
/>
{#if $banners.length > 0}
{#if $banners.length > 0}
<div class="flex flex-col gap-1">
<div class="absolute top-16 w-full {$showSidebar ? '
md
:
max
-
w
-[
calc
(
100
%-
260
px
)]
' : ''}">
{#each $banners as banner}
<div class=" flex flex-col gap-1 w-full">
{#each $banners.filter( (b) => (b.dismissible ? !JSON.parse(localStorage.getItem('
dismissedBannerIds
') ?? '
[]
').includes(b.id) : true) ) as banner}
<Banner
<Banner
{banner}
{banner}
on:dismiss={(e) => {
on:dismiss={(e) => {
...
@@ -1028,6 +1029,7 @@
...
@@ -1028,6 +1029,7 @@
/>
/>
{/each}
{/each}
</div>
</div>
</div>
{/if}
{/if}
<div class="flex flex-col flex-auto">
<div class="flex flex-col flex-auto">
...
...
src/lib/components/common/Banner.svelte
View file @
fd98add6
...
@@ -36,17 +36,17 @@
...
@@ -36,17 +36,17 @@
});
});
</script>
</script>
{#if
mount
ed}
{#if
!dismiss
ed}
{#if
!dismiss
ed}
{#if
mount
ed}
<div
<div
class=" top-0 left-0 right-0 p-2 mx-4 px-3 flex justify-center items-center relative rounded-xl border dark:border-gray-8
0
0 text-gray-800 dark:text-gary-100 bg-white dark:bg-gray-900 backdrop-blur-xl"
class=" top-0 left-0 right-0 p-2 mx-4 px-3 flex justify-center items-center relative rounded-xl border
border-gray-100
dark:border-gray-8
5
0 text-gray-800 dark:text-gary-100 bg-white dark:bg-gray-900 backdrop-blur-xl
z-40
"
transition:fade={{ delay: 0, duration: 300 }}
transition:fade={{ delay:
10
0, duration: 300 }}
>
>
<div class=" flex flex-col md:flex-row md:items-center flex-1 text-sm w-fit gap-1.5">
<div class=" flex flex-col md:flex-row md:items-center flex-1 text-sm w-fit gap-1.5">
<div class="flex justify-between self-start">
<div class="flex justify-between self-start">
<div
<div
class=" text-xs font-black {classNames[banner.type] ??
class=" text-xs font-black {classNames[banner.type] ??
classNames['info']} w-fit px-2 rounded uppercase"
classNames['info']} w-fit px-2 rounded uppercase
line-clamp-1 mr-0.5
"
>
>
{banner.type}
{banner.type}
</div>
</div>
...
@@ -110,14 +110,13 @@
...
@@ -110,14 +110,13 @@
</div>
</div>
</div>
</div>
{/if}
{/if}
<div class="flex
h-full justify
-start">
<div class="flex
self
-start">
{#if banner.dismissible}
{#if banner.dismissible}
<button
<button
on:click={() => {
on:click={() => {
dismiss(banner.id);
dismiss(banner.id);
}}
}}
class="mt-[-2.5px] ml-1.5 mr-1 text-gray-400 dark:hover:text-white h-2 mb-auto"
class=" -mt-[3px] ml-1.5 mr-1 text-gray-400 dark:hover:text-white h-1">×</button
>×</button
>
>
{/if}
{/if}
</div>
</div>
...
...
src/routes/(app)/+layout.svelte
View file @
fd98add6
...
@@ -85,12 +85,7 @@
...
@@ -85,12 +85,7 @@
documents.set(await getDocs(localStorage.token));
documents.set(await getDocs(localStorage.token));
})(),
})(),
(async () => {
(async () => {
let _banners = await getBanners(localStorage.token);
banners.set(await getBanners(localStorage.token));
const dismissedBannerIds = JSON.parse(localStorage.getItem('dismissedBannerIds') ?? '[]');
_banners = _banners.filter((banner) =>
banner.dismissible ? !dismissedBannerIds.includes(banner.id) : true
);
banners.set(_banners);
})(),
})(),
(async () => {
(async () => {
tags.set(await getAllChatTags(localStorage.token));
tags.set(await getAllChatTags(localStorage.token));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment