|
3 | 3 | import { ChatMessage, MessageInput } from '$lib/fragments';
|
4 | 4 | import { Avatar, Button, Input, Label } from '$lib/ui';
|
5 | 5 | import { InputFile } from '$lib/fragments';
|
6 |
| - import { HugeiconsFreeIcons, Edit01FreeIcons } from '@hugeicons/core-free-icons'; |
| 6 | + import { Edit01FreeIcons } from '@hugeicons/core-free-icons'; |
| 7 | + import {HugeiconsIcon} from "@hugeicons/svelte"; |
7 | 8 | import { goto } from '$app/navigation';
|
8 | 9 | import { page } from '$app/state';
|
9 | 10 | import Settings from '$lib/icons/Settings.svelte';
|
10 | 11 | import { clickOutside } from '$lib/utils';
|
| 12 | + import VerticalDots from '$lib/icons/VerticalDots.svelte'; |
11 | 13 |
|
12 | 14 | let messagesContainer: HTMLDivElement;
|
13 | 15 | let messageValue = $state('');
|
14 |
| - let openMenuId = $state<string | null>(null); |
15 | 16 |
|
16 | 17 | let userId = 'user-1';
|
17 | 18 | let id = page.params.id;
|
18 | 19 |
|
19 |
| - let group = { |
| 20 | + let group = $state({ |
20 | 21 | id: 'group-123',
|
21 | 22 | name: 'Design Team',
|
22 | 23 | avatar: 'https://i.pravatar.cc/150?img=15',
|
|
26 | 27 | { id: 'user-2', name: 'Bob', avatar: 'https://i.pravatar.cc/150?img=2', role: 'admin' },
|
27 | 28 | { id: 'user-3', name: 'Charlie', avatar: 'https://i.pravatar.cc/150?img=3', role: 'member' }
|
28 | 29 | ]
|
29 |
| - }; |
| 30 | + }); |
30 | 31 |
|
31 | 32 | let messages = $state([
|
32 | 33 | {
|
|
71 | 72 | setTimeout(scrollToBottom, 0);
|
72 | 73 | }
|
73 | 74 |
|
74 |
| - // Edit Dialog state and logic |
75 | 75 | let openEditDialog = $state(false);
|
76 | 76 | let groupName = $state(group.name);
|
77 | 77 | let groupDescription = $state(group.description);
|
|
102 | 102 | }
|
103 | 103 | </script>
|
104 | 104 |
|
105 |
| -<!-- Group Header --> |
106 |
| -<section class="flex items-center justify-between gap-4 px-4 py-3 border-b border-gray-200"> |
| 105 | +<section class="flex flex-col md:flex-row items-center justify-between gap-4 px-2 md:px-4 py-3 border-b border-gray-200"> |
107 | 106 | <div class="flex items-center gap-4">
|
108 | 107 | <Avatar src={group.avatar} />
|
109 | 108 | <div>
|
|
124 | 123 | </Button>
|
125 | 124 | <button
|
126 | 125 | onclick={() => (openEditDialog = true)}
|
| 126 | + class="border border-brand-burnt-orange-900 rounded-full p-2" |
127 | 127 | >
|
128 | 128 | <Settings size="24px" color="var(--color-brand-burnt-orange)" />
|
129 | 129 | </button>
|
130 | 130 | </div>
|
131 | 131 | </section>
|
132 | 132 |
|
133 |
| -<!-- Chat Area --> |
134 | 133 | <section class="chat relative px-0">
|
135 | 134 | <div class="h-[calc(100vh-300px)] mt-4 overflow-auto" bind:this={messagesContainer}>
|
136 | 135 | {#each messages as msg (msg.id)}
|
|
152 | 151 | />
|
153 | 152 | </section>
|
154 | 153 |
|
155 |
| -<dialog open={openEditDialog} use:clickOutside={() => openEditDialog = false} onclose={() => (openEditDialog = false)} class="absolute start-[50%] top-[50%] translate-x-[-50%] translate-y-[-50%] p-4" > |
| 154 | +<dialog open={openEditDialog} use:clickOutside={() => openEditDialog = false} onclose={() => (openEditDialog = false)} class="w-full max-w-[300px] z-50 absolute start-[50%] top-[50%] translate-x-[-50%] translate-y-[-50%] p-2 border border-gray-100 rounded-4xl" > |
156 | 155 | <div class="flex flex-col gap-6">
|
157 | 156 | <div>
|
158 | 157 | <InputFile
|
|
166 | 165 | }}
|
167 | 166 | />
|
168 | 167 | {#if groupImageDataUrl}
|
169 |
| - <img |
| 168 | + <Avatar |
| 169 | + class="mt-4" |
170 | 170 | src={groupImageDataUrl}
|
171 | 171 | alt="Group preview"
|
172 |
| - class="mt-2 h-24 w-24 rounded-full object-cover" |
| 172 | + size="lg" |
173 | 173 | />
|
174 | 174 | {/if}
|
175 | 175 | </div>
|
|
0 commit comments