1
0
mirror of https://github.com/immich-app/immich.git synced 2025-08-09 23:17:29 +02:00

refactor: duplicate button controls (#19143)

This commit is contained in:
Jason Rasmussen
2025-06-12 17:48:53 -04:00
committed by GitHub
parent c9bcae813b
commit 2f3d4e15d2
2 changed files with 18 additions and 18 deletions

View File

@ -23,8 +23,8 @@
<div <div
class="max-w-60 rounded-xl border-4 transition-colors font-semibold text-xs {isSelected class="max-w-60 rounded-xl border-4 transition-colors font-semibold text-xs {isSelected
? 'bg-immich-primary dark:bg-immich-dark-primary border-immich-primary dark:border-immich-dark-primary' ? 'bg-primary border-primary'
: 'bg-gray-200 dark:bg-gray-800 border-gray-200 dark:border-gray-800'}" : 'bg-subtle border-subtle'}"
> >
<div class="relative w-full"> <div class="relative w-full">
<button <button

View File

@ -1,6 +1,5 @@
<script lang="ts"> <script lang="ts">
import { shortcuts } from '$lib/actions/shortcut'; import { shortcuts } from '$lib/actions/shortcut';
import Icon from '$lib/components/elements/icon.svelte';
import Portal from '$lib/components/shared-components/portal/portal.svelte'; import Portal from '$lib/components/shared-components/portal/portal.svelte';
import DuplicateAsset from '$lib/components/utilities-page/duplicates/duplicate-asset.svelte'; import DuplicateAsset from '$lib/components/utilities-page/duplicates/duplicate-asset.svelte';
import { assetViewingStore } from '$lib/stores/asset-viewing.store'; import { assetViewingStore } from '$lib/stores/asset-viewing.store';
@ -117,15 +116,15 @@
<div class="flex flex-wrap gap-y-6 mb-4 px-6 w-full place-content-end justify-between"> <div class="flex flex-wrap gap-y-6 mb-4 px-6 w-full place-content-end justify-between">
<!-- MARK ALL BUTTONS --> <!-- MARK ALL BUTTONS -->
<div class="flex text-xs text-black"> <div class="flex text-xs text-black">
<button <Button class="rounded-s-full" size="small" color="primary" leadingIcon={mdiCheck} onclick={onSelectAll}
type="button" >{$t('select_keep_all')}</Button
class="px-4 py-3 flex place-items-center gap-2 rounded-s-full dark:bg-immich-dark-primary hover:dark:bg-immich-dark-primary/90 bg-immich-primary/25 hover:bg-immich-primary/50"
onclick={onSelectAll}><Icon path={mdiCheck} size="20" />{$t('select_keep_all')}</button
> >
<button <Button
type="button" class="rounded-e-full"
class="px-4 py-3 flex place-items-center gap-2 rounded-e-full dark:bg-immich-dark-primary/50 hover:dark:bg-immich-dark-primary/70 bg-immich-primary hover:bg-immich-primary/80 text-white" size="small"
onclick={onSelectNone}><Icon path={mdiTrashCanOutline} size="20" />{$t('select_trash_all')}</button color="secondary"
leadingIcon={mdiTrashCanOutline}
onclick={onSelectNone}>{$t('select_trash_all')}</Button
> >
</div> </div>
@ -134,32 +133,33 @@
{#if trashCount === 0} {#if trashCount === 0}
<Button <Button
size="small" size="small"
leadingIcon={mdiCheck}
color="primary" color="primary"
class="flex place-items-center rounded-s-full gap-2" class="flex place-items-center rounded-s-full gap-2"
onclick={handleResolve} onclick={handleResolve}
> >
<Icon path={mdiCheck} size="20" />{$t('keep_all')} {$t('keep_all')}
</Button> </Button>
{:else} {:else}
<Button <Button
size="small" size="small"
color="danger" color="danger"
class="flex place-items-center rounded-s-full gap-2 py-3" leadingIcon={mdiTrashCanOutline}
class="rounded-s-full"
onclick={handleResolve} onclick={handleResolve}
> >
<Icon path={mdiTrashCanOutline} size="20" />{trashCount === assets.length {trashCount === assets.length ? $t('trash_all') : $t('trash_count', { values: { count: trashCount } })}
? $t('trash_all')
: $t('trash_count', { values: { count: trashCount } })}
</Button> </Button>
{/if} {/if}
<Button <Button
size="small" size="small"
color="primary" color="primary"
class="flex place-items-center rounded-e-full gap-2" leadingIcon={mdiImageMultipleOutline}
class="rounded-e-full"
onclick={handleStack} onclick={handleStack}
disabled={selectedAssetIds.size !== 1} disabled={selectedAssetIds.size !== 1}
> >
<Icon path={mdiImageMultipleOutline} size="20" />{$t('stack')} {$t('stack')}
</Button> </Button>
</div> </div>
</div> </div>