mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-04 04:30:04 +00:00
[style] apply review feedback: simplify conditional logic
Simplify conditional class logic in FormSelectButton.vue per review suggestion: - Combine cursor classes into single ternary - Combine background classes into nested ternary with !disabled guard
This commit is contained in:
@@ -15,14 +15,11 @@
|
||||
'flex-1 h-6 px-5 py-[5px] rounded flex justify-center items-center gap-1 transition-all duration-150 ease-in-out',
|
||||
'bg-transparent border-none',
|
||||
'text-center text-xs font-normal',
|
||||
{
|
||||
'bg-interface-menu-component-surface-selected':
|
||||
isSelected(option) && !disabled,
|
||||
'hover:bg-interface-menu-component-surface-hovered':
|
||||
!isSelected(option) && !disabled,
|
||||
'opacity-50 cursor-not-allowed': disabled,
|
||||
'cursor-pointer': !disabled
|
||||
},
|
||||
disabled ? 'opacity-50 cursor-not-allowed' : 'cursor-pointer',
|
||||
!disabled &&
|
||||
(isSelected(option)
|
||||
? 'bg-interface-menu-component-surface-selected'
|
||||
: 'hover:bg-interface-menu-component-surface-hovered'),
|
||||
isSelected(option) && !disabled ? 'text-primary' : 'text-secondary'
|
||||
)
|
||||
"
|
||||
|
||||
Reference in New Issue
Block a user