mirror of
https://github.com/immich-app/immich.git
synced 2025-12-20 01:11:46 +03:00
chore: migrate away from event dispatcher (#12820)
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
import SettingSwitch from '$lib/components/shared-components/settings/setting-switch.svelte';
|
||||
import type { MapSettings } from '$lib/stores/preferences.store';
|
||||
import { Duration } from 'luxon';
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
import { t } from 'svelte-i18n';
|
||||
import { fly } from 'svelte/transition';
|
||||
import Button from '../elements/buttons/button.svelte';
|
||||
@@ -12,19 +11,15 @@
|
||||
import DateInput from '../elements/date-input.svelte';
|
||||
|
||||
export let settings: MapSettings;
|
||||
export let onClose: () => void;
|
||||
export let onSave: (settings: MapSettings) => void;
|
||||
|
||||
let customDateRange = !!settings.dateAfter || !!settings.dateBefore;
|
||||
|
||||
const dispatch = createEventDispatcher<{
|
||||
close: void;
|
||||
save: MapSettings;
|
||||
}>();
|
||||
|
||||
const handleClose = () => dispatch('close');
|
||||
</script>
|
||||
|
||||
<FullScreenModal title={$t('map_settings')} onClose={handleClose}>
|
||||
<FullScreenModal title={$t('map_settings')} {onClose}>
|
||||
<form
|
||||
on:submit|preventDefault={() => dispatch('save', settings)}
|
||||
on:submit|preventDefault={() => onSave(settings)}
|
||||
class="flex flex-col gap-4 text-immich-primary dark:text-immich-dark-primary"
|
||||
id="map-settings-form"
|
||||
>
|
||||
@@ -108,7 +103,7 @@
|
||||
{/if}
|
||||
</form>
|
||||
<svelte:fragment slot="sticky-bottom">
|
||||
<Button color="gray" size="sm" fullwidth on:click={handleClose}>{$t('cancel')}</Button>
|
||||
<Button color="gray" size="sm" fullwidth on:click={onClose}>{$t('cancel')}</Button>
|
||||
<Button type="submit" size="sm" fullwidth form="map-settings-form">{$t('save')}</Button>
|
||||
</svelte:fragment>
|
||||
</FullScreenModal>
|
||||
|
||||
Reference in New Issue
Block a user