|
6 | 6 | import { page } from '$app/state';
|
7 | 7 | import Settings from '$lib/icons/Settings.svelte';
|
8 | 8 | import { clickOutside } from '$lib/utils';
|
| 9 | + import { Pen01FreeIcons } from '@hugeicons/core-free-icons'; |
| 10 | + import {HugeiconsIcon} from "@hugeicons/svelte" |
9 | 11 |
|
10 | 12 | let messagesContainer: HTMLDivElement;
|
11 | 13 | let messageValue = $state('');
|
|
153 | 155 | class="w-[90vw] md:max-w-[30vw] z-50 absolute start-[50%] top-[50%] translate-x-[-50%] translate-y-[-50%] p-4 border border-gray-400 rounded-3xl bg-white shadow-xl"
|
154 | 156 | >
|
155 | 157 | <div class="flex flex-col gap-6">
|
156 |
| - <div> |
| 158 | + <!-- Group Avatar with Edit Icon --> |
| 159 | + <div class="relative w-[96px] h-[96px] self-center"> |
| 160 | + <img |
| 161 | + src={groupImageDataUrl || '/images/avatar-placeholder.png'} |
| 162 | + alt="Group Avatar" |
| 163 | + class="w-full h-full object-cover rounded-full border border-gray-300" |
| 164 | + /> |
157 | 165 | {#if canEdit}
|
158 |
| - <InputFile |
159 |
| - bind:files={groupImageFiles} |
| 166 | + <!-- Hidden file input trigger --> |
| 167 | + <input |
| 168 | + type="file" |
160 | 169 | accept="image/*"
|
161 |
| - label="Upload Group Avatar" |
162 |
| - cancelLabel="Remove" |
163 |
| - oncancel={() => { |
164 |
| - groupImageDataUrl = ''; |
165 |
| - groupImageFiles = undefined; |
| 170 | + class="hidden" |
| 171 | + id="group-avatar-input" |
| 172 | + onchange={(e) => { |
| 173 | + const files = (e.target as HTMLInputElement).files; |
| 174 | + if (files && files[0]) { |
| 175 | + groupImageFiles = files; |
| 176 | + } |
166 | 177 | }}
|
167 | 178 | />
|
168 |
| - {/if} |
169 |
| - {#if groupImageDataUrl} |
170 |
| - <Avatar class="mt-4" src={groupImageDataUrl} alt="Group preview" size="lg" /> |
| 179 | + <label for="group-avatar-input" class="absolute bottom-0 right-0 bg-brand-burnt-orange border border-brand-burnt-orange rounded-full p-1 shadow cursor-pointer"> |
| 180 | + <HugeiconsIcon icon={Pen01FreeIcons} color="white"/> |
| 181 | + </label> |
171 | 182 | {/if}
|
172 | 183 | </div>
|
173 | 184 |
|
|
180 | 191 | {/if}
|
181 | 192 | </div>
|
182 | 193 |
|
| 194 | + <!-- Group Description --> |
183 | 195 | <div>
|
184 | 196 | <Label>Description</Label>
|
185 | 197 | {#if canEdit}
|
|
190 | 202 | </div>
|
191 | 203 |
|
192 | 204 | <hr class="text-grey" />
|
| 205 | + |
193 | 206 | <div class="flex items-center gap-2">
|
194 | 207 | <Button size="sm" variant="primary" callback={() => {(openEditDialog = false)}}>Cancel</Button>
|
195 | 208 | {#if canEdit}
|
|
198 | 211 | </div>
|
199 | 212 | </div>
|
200 | 213 | </dialog>
|
| 214 | + |
0 commit comments