mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
fix(web): avoid nesting buttons inside links (#11425)
This commit is contained in:
parent
7bb7f63d57
commit
2e059bfbfd
15 changed files with 216 additions and 96 deletions
|
|
@ -1,5 +1,8 @@
|
|||
<script lang="ts">
|
||||
import CircleIconButton, { type Color } from '$lib/components/elements/buttons/circle-icon-button.svelte';
|
||||
import CircleIconButton, {
|
||||
type Color,
|
||||
type Padding,
|
||||
} from '$lib/components/elements/buttons/circle-icon-button.svelte';
|
||||
import ContextMenu from '$lib/components/shared-components/context-menu/context-menu.svelte';
|
||||
import {
|
||||
getContextMenuPositionFromBoundingRect,
|
||||
|
|
@ -24,7 +27,7 @@
|
|||
export let direction: 'left' | 'right' = 'right';
|
||||
export let color: Color = 'transparent';
|
||||
export let size: string | undefined = undefined;
|
||||
export let padding: string | undefined = undefined;
|
||||
export let padding: Padding | undefined = undefined;
|
||||
/**
|
||||
* Additional classes to apply to the button.
|
||||
*/
|
||||
|
|
@ -114,9 +117,9 @@
|
|||
{padding}
|
||||
{size}
|
||||
{title}
|
||||
ariaControls={menuId}
|
||||
ariaExpanded={isOpen}
|
||||
ariaHasPopup={true}
|
||||
aria-controls={menuId}
|
||||
aria-expanded={isOpen}
|
||||
aria-haspopup={true}
|
||||
class={buttonClass}
|
||||
id={buttonId}
|
||||
on:click={handleClick}
|
||||
|
|
|
|||
|
|
@ -73,14 +73,19 @@
|
|||
<p class="text-sm text-gray-500 dark:text-immich-dark-fg">{$user.email}</p>
|
||||
</div>
|
||||
|
||||
<a href={AppRoute.USER_SETTINGS} on:click={() => dispatch('close')}>
|
||||
<Button color="dark-gray" size="sm" shadow={false} border>
|
||||
<div class="flex place-content-center place-items-center gap-2 px-2">
|
||||
<Icon path={mdiCog} size="18" />
|
||||
{$t('account_settings')}
|
||||
</div>
|
||||
</Button>
|
||||
</a>
|
||||
<Button
|
||||
href={AppRoute.USER_SETTINGS}
|
||||
on:click={() => dispatch('close')}
|
||||
color="dark-gray"
|
||||
size="sm"
|
||||
shadow={false}
|
||||
border
|
||||
>
|
||||
<div class="flex place-content-center place-items-center gap-2 px-2">
|
||||
<Icon path={mdiCog} size="18" />
|
||||
{$t('account_settings')}
|
||||
</div>
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<div class="mb-4 flex flex-col">
|
||||
|
|
|
|||
|
|
@ -60,9 +60,13 @@
|
|||
|
||||
<section class="flex place-items-center justify-end gap-4 max-sm:w-full">
|
||||
{#if $featureFlags.search}
|
||||
<a href={AppRoute.SEARCH} id="search-button" class="ml-4 sm:hidden">
|
||||
<CircleIconButton title={$t('go_to_search')} icon={mdiMagnify} />
|
||||
</a>
|
||||
<CircleIconButton
|
||||
href={AppRoute.SEARCH}
|
||||
id="search-button"
|
||||
class="ml-4 sm:hidden"
|
||||
title={$t('go_to_search')}
|
||||
icon={mdiMagnify}
|
||||
/>
|
||||
{/if}
|
||||
|
||||
<ThemeButton />
|
||||
|
|
|
|||
|
|
@ -37,8 +37,6 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<a href={getProductLink(ImmichProduct.Client)}>
|
||||
<Button fullwidth>{$t('purchase_button_select')}</Button>
|
||||
</a>
|
||||
<Button href={getProductLink(ImmichProduct.Client)} fullwidth>{$t('purchase_button_select')}</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -37,8 +37,6 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<a href={getLicenseLink(ImmichProduct.Server)}>
|
||||
<Button fullwidth>{$t('purchase_button_select')}</Button>
|
||||
</a>
|
||||
<Button href={getLicenseLink(ImmichProduct.Server)} fullwidth>{$t('purchase_button_select')}</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue