Skip to content

Commit 1c50e19

Browse files
authored
fix: use icons instead of toggles for admin user features view (#19369)
* fix: use icons instead of toggles for admin user features view * fix: use red for X icon
1 parent e61d7f2 commit 1c50e19

File tree

2 files changed

+26
-29
lines changed

2 files changed

+26
-29
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<script lang="ts">
2+
import { Icon, Text } from '@immich/ui';
3+
import { mdiCheck, mdiClose } from '@mdi/js';
4+
5+
interface Props {
6+
title: string;
7+
state: boolean;
8+
}
9+
10+
let { title, state }: Props = $props();
11+
</script>
12+
13+
<div class="flex justify-between items-center">
14+
<Text class="text-sm font-medium">{title}</Text>
15+
<Icon icon={state ? mdiCheck : mdiClose} class={state ? 'text-primary' : 'text-danger'} size="24" />
16+
</div>

web/src/routes/admin/users/[id]/+page.svelte

Lines changed: 10 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,11 @@
2525
CardTitle,
2626
Code,
2727
Container,
28-
Field,
2928
getByteUnitString,
3029
Heading,
3130
HStack,
3231
Icon,
3332
Stack,
34-
Switch,
3533
Text,
3634
} from '@immich/ui';
3735
import {
@@ -50,6 +48,7 @@
5048
} from '@mdi/js';
5149
import { t } from 'svelte-i18n';
5250
import type { PageData } from './$types';
51+
import FeatureSetting from '$lib/components/admin-page/user/feature-setting.svelte';
5352
5453
interface Props {
5554
data: PageData;
@@ -292,33 +291,15 @@
292291
<CardBody>
293292
<div class="px-4 pb-4">
294293
<Stack gap={3}>
295-
<Field readOnly label={$t('email_notifications')}>
296-
<Switch checked={userPreferences.emailNotifications.enabled} color="primary" />
297-
</Field>
298-
<Field readOnly label={$t('folders')}>
299-
<Switch checked={userPreferences.folders.enabled} color="primary" />
300-
</Field>
301-
<Field readOnly label={$t('memories')}>
302-
<Switch checked={userPreferences.memories.enabled} color="primary" />
303-
</Field>
304-
<Field readOnly label={$t('people')}>
305-
<Switch checked={userPreferences.people.enabled} color="primary" />
306-
</Field>
307-
<Field readOnly label={$t('rating')}>
308-
<Switch checked={userPreferences.ratings.enabled} color="primary" />
309-
</Field>
310-
<Field readOnly label={$t('shared_links')}>
311-
<Switch checked={userPreferences.sharedLinks.enabled} color="primary" />
312-
</Field>
313-
<Field readOnly label={$t('show_supporter_badge')}>
314-
<Switch checked={userPreferences.purchase.showSupportBadge} color="primary" />
315-
</Field>
316-
<Field readOnly label={$t('tags')}>
317-
<Switch checked={userPreferences.tags.enabled} color="primary" />
318-
</Field>
319-
<Field readOnly label={$t('gcast_enabled')}>
320-
<Switch checked={userPreferences.cast.gCastEnabled} color="primary" />
321-
</Field>
294+
<FeatureSetting title={$t('email_notifications')} state={userPreferences.emailNotifications.enabled} />
295+
<FeatureSetting title={$t('folders')} state={userPreferences.folders.enabled} />
296+
<FeatureSetting title={$t('memories')} state={userPreferences.memories.enabled} />
297+
<FeatureSetting title={$t('people')} state={userPreferences.people.enabled} />
298+
<FeatureSetting title={$t('rating')} state={userPreferences.ratings.enabled} />
299+
<FeatureSetting title={$t('shared_links')} state={userPreferences.sharedLinks.enabled} />
300+
<FeatureSetting title={$t('show_supporter_badge')} state={userPreferences.purchase.showSupportBadge} />
301+
<FeatureSetting title={$t('tags')} state={userPreferences.tags.enabled} />
302+
<FeatureSetting title={$t('gcast_enabled')} state={userPreferences.cast.gCastEnabled} />
322303
</Stack>
323304
</div>
324305
</CardBody>

0 commit comments

Comments
 (0)