refac: pinned collapsible styling

This commit is contained in:
Timothy J. Baek committed 2024-10-14 21:15:36 -07:00
1 parent 2afc5f3339
commit 4c7651c113
2 files changed
+9 -5

No files matched your search

+3 -2
View File
@@ -7,12 +7,13 @@
export let open = false;
export let className = '';
export let buttonClassName = 'w-fit';
export let title = null;
</script>
<div class={className}>
{#if title !== null}
<button class="w-fit" on:click={() => (open = !open)}>
<button class={buttonClassName} on:click={() => (open = !open)}>
<div class=" w-fit font-medium transition flex items-center justify-between gap-2">
<div>
{title}
@@ -28,7 +29,7 @@
</div>
</button>
{:else}
<button on:click={() => (open = !open)}>
<button class={buttonClassName} on:click={() => (open = !open)}>
<div
class="flex items-center gap-2 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 transition"
>
+6 -3
View File
@@ -52,6 +52,7 @@
import ChevronDown from '../icons/ChevronDown.svelte';
import ChevronUp from '../icons/ChevronUp.svelte';
import ChevronRight from '../icons/ChevronRight.svelte';
import Collapsible from '../common/Collapsible.svelte';
const BREAKPOINT = 768;
@@ -507,7 +508,8 @@
{#if !search && $pinnedChats.length > 0}
<div class=" pb-2 flex flex-col space-y-1">
<div class="">
<div class="px-2">
<Collapsible className="w-full" buttonClassName="w-full">
<div class="px-2 w-full">
<button
class="w-full py-1 px-1.5 rounded-md flex items-center gap-1 text-xs text-gray-500 dark:text-gray-500 font-medium hover:bg-gray-100 dark:hover:bg-gray-900 transition"
on:click={() => {
@@ -529,7 +531,7 @@
</button>
</div>
{#if showPinnedChat}
<div slot="content">
<div class="pl-2 mt-1 flex flex-col overflow-y-auto scrollbar-hidden">
{#each $pinnedChats as chat, idx}
<ChatItem
@@ -557,7 +559,8 @@
/>
{/each}
</div>
{/if}
</div>
</Collapsible>
</div>
</div>
{/if}