your personal website on atproto - mirror blento.app

Always show all cards options

jycouet bba98f90 f3084a6f

+4 -4
+4 -4
src/lib/cards/BaseCard/BaseEditingCard.svelte
··· 154 154 let changePopoverOpen = $state(false); 155 155 156 156 const changeOptions = $derived( 157 - AllCardDefinitions.filter((def) => def.type !== item.cardType && def.canChange?.(item)) 157 + AllCardDefinitions.filter((def) => def.canChange?.(item)) 158 158 ); 159 159 160 160 function applyChange(def: (typeof AllCardDefinitions)[number]) { ··· 185 185 {#snippet controls()} 186 186 <!-- class="bg-base-100 border-base-200 dark:bg-base-800 dark:border-base-700 absolute -top-3 -left-3 hidden cursor-pointer items-center justify-center rounded-full border p-2 shadow-lg group-focus-within:inline-flex group-hover/card:inline-flex" --> 187 187 {#if canEdit()} 188 - {#if changeOptions.length > 0} 188 + {#if changeOptions.length > 1} 189 189 <div 190 190 class={[ 191 191 'absolute -top-3 -right-3 hidden group-focus-within:inline-flex group-hover/card:inline-flex', ··· 215 215 {/snippet} 216 216 217 217 <div class="flex min-w-36 flex-col gap-1"> 218 - <Label class="mb-2">Change card to</Label> 218 + <Label class="mb-2">Card type</Label> 219 219 {#each changeOptions as changeDef} 220 220 <Button 221 221 class="justify-start" 222 - variant="ghost" 222 + variant={changeDef.type === item.cardType ? 'primary' : 'ghost'} 223 223 onclick={() => applyChange(changeDef)} 224 224 > 225 225 {getChangeLabel(changeDef)}