1
0
mirror of https://github.com/immich-app/immich.git synced 2024-11-27 09:21:05 +02:00

feat(web): Left hand navigation with A/D (#11907)

This commit is contained in:
Carles Albàs Boix 2024-08-19 19:07:18 +02:00 committed by GitHub
parent bc31b7c06c
commit ca52cbace1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 4 deletions

View File

@ -1,5 +1,5 @@
<script lang="ts">
import { shortcut } from '$lib/actions/shortcut';
import { shortcuts } from '$lib/actions/shortcut';
import Icon from '$lib/components/elements/icon.svelte';
import { mdiChevronRight } from '@mdi/js';
import { t } from 'svelte-i18n';
@ -8,7 +8,12 @@
export let onNextAsset: () => void;
</script>
<svelte:window use:shortcut={{ shortcut: { key: 'ArrowRight' }, onShortcut: onNextAsset }} />
<svelte:window
use:shortcuts={[
{ shortcut: { key: 'ArrowRight' }, onShortcut: onNextAsset },
{ shortcut: { key: 'd' }, onShortcut: onNextAsset },
]}
/>
<NavigationArea onClick={onNextAsset} label={$t('view_next_asset')}>
<Icon path={mdiChevronRight} size="36" ariaHidden />

View File

@ -1,5 +1,5 @@
<script lang="ts">
import { shortcut } from '$lib/actions/shortcut';
import { shortcuts } from '$lib/actions/shortcut';
import Icon from '$lib/components/elements/icon.svelte';
import { mdiChevronLeft } from '@mdi/js';
import { t } from 'svelte-i18n';
@ -8,7 +8,12 @@
export let onPreviousAsset: () => void;
</script>
<svelte:window use:shortcut={{ shortcut: { key: 'ArrowLeft' }, onShortcut: onPreviousAsset }} />
<svelte:window
use:shortcuts={[
{ shortcut: { key: 'ArrowLeft' }, onShortcut: onPreviousAsset },
{ shortcut: { key: 'a' }, onShortcut: onPreviousAsset },
]}
/>
<NavigationArea onClick={onPreviousAsset} label={$t('view_previous_asset')}>
<Icon path={mdiChevronLeft} size="36" ariaHidden />