feat(web,a11y): standardize base modal (#8388)

* consistent headings
* remove escape key handler
* add aria attributes
This commit is contained in:
Ben Basten 2024-04-02 15:05:02 +00:00 committed by GitHub
parent 28e8e539f6
commit f7afc0334e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 53 additions and 86 deletions

View file

@ -143,20 +143,16 @@
handleError(error, 'Failed to edit shared link');
}
};
const getTitle = () => {
if (editingLink) {
return 'Edit link';
}
return 'Create link to share';
};
</script>
<BaseModal on:close={() => dispatch('close')} on:escape={() => dispatch('escape')}>
<svelte:fragment slot="title">
<span class="flex place-items-center gap-2">
<Icon path={mdiLink} size={24} />
{#if editingLink}
<p class="font-medium text-immich-fg dark:text-immich-dark-fg">Edit link</p>
{:else}
<p class="font-medium text-immich-fg dark:text-immich-dark-fg">Create link to share</p>
{/if}
</span>
</svelte:fragment>
<BaseModal id="create-shared-link-modal" title={getTitle()} icon={mdiLink} on:close>
<section class="mx-6 mb-6">
{#if shareType === SharedLinkType.Album}
{#if !editingLink}