mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
refactor(web): migrate away from event dispatcher (#12802)
This commit is contained in:
parent
cfc575d89c
commit
94fc1f213a
18 changed files with 76 additions and 123 deletions
|
|
@ -1,9 +1,8 @@
|
|||
<script lang="ts">
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
import FullScreenModal from './full-screen-modal.svelte';
|
||||
import { mdiInformationOutline } from '@mdi/js';
|
||||
import Icon from '../elements/icon.svelte';
|
||||
import { t } from 'svelte-i18n';
|
||||
import Icon from '../elements/icon.svelte';
|
||||
import FullScreenModal from './full-screen-modal.svelte';
|
||||
|
||||
interface Shortcuts {
|
||||
general: ExplainedShortcut[];
|
||||
|
|
@ -16,6 +15,8 @@
|
|||
info?: string;
|
||||
}
|
||||
|
||||
export let onClose: () => void;
|
||||
|
||||
export let shortcuts: Shortcuts = {
|
||||
general: [
|
||||
{ key: ['←', '→'], action: $t('previous_or_next_photo') },
|
||||
|
|
@ -33,12 +34,9 @@
|
|||
{ key: ['Del'], action: $t('trash_delete_asset'), info: $t('shift_to_permanent_delete') },
|
||||
],
|
||||
};
|
||||
const dispatch = createEventDispatcher<{
|
||||
close: void;
|
||||
}>();
|
||||
</script>
|
||||
|
||||
<FullScreenModal title={$t('keyboard_shortcuts')} width="auto" onClose={() => dispatch('close')}>
|
||||
<FullScreenModal title={$t('keyboard_shortcuts')} width="auto" {onClose}>
|
||||
<div class="grid grid-cols-1 gap-4 px-4 pb-4 md:grid-cols-2">
|
||||
{#if shortcuts.general.length > 0}
|
||||
<div class="p-4">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue