Skip to content

Commit e65d92f

Browse files
committed
refac
1 parent f3c8c70 commit e65d92f

File tree

2 files changed

+44
-62
lines changed

2 files changed

+44
-62
lines changed

src/lib/components/channel/Messages/Message/UserStatusLinkPreview.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
export let sideOffset = 6;
1515
1616
let user = null;
17-
1817
onMount(async () => {
1918
if (id) {
2019
user = await getUserById(localStorage.token, id).catch((error) => {

src/lib/components/workspace/common/AccessControl.svelte

Lines changed: 44 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
<div>
106106
<select
107107
id="models"
108-
class="outline-hidden bg-transparent text-sm font-medium rounded-lg block w-fit pr-10 max-w-full placeholder-gray-400"
108+
class="outline-hidden bg-transparent text-sm font-medium block w-fit pr-10 max-w-full placeholder-gray-400"
109109
value={accessControl !== null ? 'private' : 'public'}
110110
on:change={(e) => {
111111
if (e.target.value === 'public') {
@@ -155,63 +155,13 @@
155155
</div>
156156
</div>
157157

158-
<div class="mb-1">
159-
<div class="flex w-full">
160-
<div class="flex flex-1 items-center">
161-
<div class="w-full px-0.5">
162-
<select
163-
class="outline-hidden bg-transparent text-sm rounded-lg block w-full pr-10 max-w-full
164-
{selectedGroupId ? '' : 'text-gray-500'}
165-
dark:placeholder-gray-500"
166-
bind:value={selectedGroupId}
167-
on:change={() => {
168-
if (selectedGroupId !== '') {
169-
accessControl.read.group_ids = [
170-
...(accessControl?.read?.group_ids ?? []),
171-
selectedGroupId
172-
];
173-
174-
selectedGroupId = '';
175-
onChange(accessControl);
176-
}
177-
}}
178-
>
179-
<option class=" text-gray-700" value="" disabled selected
180-
>{$i18n.t('Select a group')}</option
181-
>
182-
{#each groups.filter((group) => !(accessControl?.read?.group_ids ?? []).includes(group.id)) as group}
183-
<option class=" text-gray-700" value={group.id}>{group.name}</option>
184-
{/each}
185-
</select>
186-
</div>
187-
<!-- <div>
188-
<Tooltip content={$i18n.t('Add Group')}>
189-
<button
190-
class=" p-1 rounded-xl bg-transparent dark:hover:bg-white/5 hover:bg-black/5 transition font-medium text-sm flex items-center space-x-1"
191-
type="button"
192-
on:click={() => {}}
193-
>
194-
<Plus className="size-3.5" />
195-
</button>
196-
</Tooltip>
197-
</div> -->
198-
</div>
199-
</div>
200-
</div>
201-
202-
<hr class=" border-gray-100 dark:border-gray-700/10 mt-1.5 mb-2.5 w-full" />
203-
204-
<div class="flex flex-col gap-2 mb-1 px-0.5">
205-
{#if accessGroups.length > 0}
158+
{#if accessGroups.length > 0}
159+
<div class="flex flex-col gap-1.5 mb-2 px-0.5 mx-0.5">
206160
{#each accessGroups as group}
207-
<div class="flex items-center gap-3 justify-between text-xs w-full transition">
208-
<div class="flex items-center gap-1.5 w-full font-medium">
209-
<div>
210-
<UserCircleSolid className="size-4" />
211-
</div>
212-
161+
<div class="flex items-center gap-3 justify-between text-sm w-full transition">
162+
<div class="flex items-center gap-1.5 w-full">
213163
<div>
214-
{group.name}
164+
{group.name} <span class="text-xs text-gray-500">{group?.member_count}</span>
215165
</div>
216166
</div>
217167

@@ -260,13 +210,46 @@
260210
</div>
261211
</div>
262212
{/each}
263-
{:else}
264-
<div class="flex items-center justify-center">
265-
<div class="text-gray-500 text-xs text-center py-2 px-10">
266-
{$i18n.t('No groups with access, add a group to grant access')}
213+
</div>
214+
{/if}
215+
216+
<!-- <div class="flex items-center justify-center">
217+
<div class="text-gray-500 text-xs text-center py-2 px-10">
218+
{$i18n.t('No groups with access, add a group to grant access')}
219+
</div>
220+
</div> -->
221+
222+
<div class="mb-1">
223+
<div class="flex w-full">
224+
<div class="flex flex-1 items-center">
225+
<div class="w-full px-0.5">
226+
<select
227+
class="outline-hidden bg-transparent text-sm rounded-lg block w-full pr-10 max-w-full
228+
{selectedGroupId ? '' : 'text-gray-500'}
229+
dark:placeholder-gray-500"
230+
bind:value={selectedGroupId}
231+
on:change={() => {
232+
if (selectedGroupId !== '') {
233+
accessControl.read.group_ids = [
234+
...(accessControl?.read?.group_ids ?? []),
235+
selectedGroupId
236+
];
237+
238+
selectedGroupId = '';
239+
onChange(accessControl);
240+
}
241+
}}
242+
>
243+
<option class=" text-gray-700" value="" disabled selected
244+
>{$i18n.t('Select a group')}</option
245+
>
246+
{#each groups.filter((group) => !(accessControl?.read?.group_ids ?? []).includes(group.id)) as group}
247+
<option class=" text-gray-700" value={group.id}>{group.name}</option>
248+
{/each}
249+
</select>
267250
</div>
268251
</div>
269-
{/if}
252+
</div>
270253
</div>
271254
</div>
272255
</div>

0 commit comments

Comments
 (0)