feat: use immich ui components for dialog component (#16839)

This commit is contained in:
Jason Rasmussen 2025-03-14 09:37:56 -04:00 committed by GitHub
parent b778a86c99
commit 8ad95b368b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 7 additions and 8 deletions

View File

@ -32,7 +32,7 @@
<ConfirmDialog <ConfirmDialog
title={$t('restore_user')} title={$t('restore_user')}
confirmText={$t('continue')} confirmText={$t('continue')}
confirmColor="green" confirmColor="success"
onConfirm={handleRestoreUser} onConfirm={handleRestoreUser}
{onCancel} {onCancel}
> >

View File

@ -69,7 +69,7 @@
prompt={$t('editor_close_without_save_prompt')} prompt={$t('editor_close_without_save_prompt')}
cancelText={$t('no')} cancelText={$t('no')}
cancelColor="secondary" cancelColor="secondary"
confirmColor="red" confirmColor="danger"
confirmText={$t('close')} confirmText={$t('close')}
onCancel={() => { onCancel={() => {
$showCancelConfirmDialog = false; $showCancelConfirmDialog = false;

View File

@ -1,9 +1,8 @@
<script lang="ts"> <script lang="ts">
import FullScreenModal from '../full-screen-modal.svelte'; import FullScreenModal from '../full-screen-modal.svelte';
import Button from '../../elements/buttons/button.svelte';
import type { Color } from '$lib/components/elements/buttons/button.svelte';
import { t } from 'svelte-i18n'; import { t } from 'svelte-i18n';
import type { Snippet } from 'svelte'; import type { Snippet } from 'svelte';
import { Button, type Color } from '@immich/ui';
interface Props { interface Props {
title?: string; title?: string;
@ -24,7 +23,7 @@
title = $t('confirm'), title = $t('confirm'),
prompt = $t('are_you_sure_to_do_this'), prompt = $t('are_you_sure_to_do_this'),
confirmText = $t('confirm'), confirmText = $t('confirm'),
confirmColor = 'red', confirmColor = 'danger',
cancelText = $t('cancel'), cancelText = $t('cancel'),
cancelColor = 'secondary', cancelColor = 'secondary',
hideCancelButton = false, hideCancelButton = false,
@ -49,11 +48,11 @@
{#snippet stickyBottom()} {#snippet stickyBottom()}
{#if !hideCancelButton} {#if !hideCancelButton}
<Button color={cancelColor} fullwidth onclick={onCancel}> <Button shape="round" color={cancelColor} fullWidth onclick={onCancel}>
{cancelText} {cancelText}
</Button> </Button>
{/if} {/if}
<Button color={confirmColor} fullwidth onclick={handleConfirm} {disabled}> <Button shape="round" color={confirmColor} fullWidth onclick={handleConfirm} {disabled}>
{confirmText} {confirmText}
</Button> </Button>
{/snippet} {/snippet}

View File

@ -155,7 +155,7 @@
onConfirm={() => (shouldShowPasswordResetSuccess = false)} onConfirm={() => (shouldShowPasswordResetSuccess = false)}
onCancel={() => (shouldShowPasswordResetSuccess = false)} onCancel={() => (shouldShowPasswordResetSuccess = false)}
hideCancelButton={true} hideCancelButton={true}
confirmColor="green" confirmColor="success"
> >
{#snippet promptSnippet()} {#snippet promptSnippet()}
<div class="flex flex-col gap-4"> <div class="flex flex-col gap-4">