From 24ed6f0ee2465e1545ccb4e25ef0759e25391a8a Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Mon, 20 Mar 2023 00:30:42 -0700 Subject: [PATCH] Better pair editor delete button --- src-web/components/core/Checkbox.tsx | 2 +- src-web/components/core/IconButton.tsx | 2 +- src-web/components/core/PairEditor.tsx | 92 +++++++++++++------------- 3 files changed, 49 insertions(+), 47 deletions(-) diff --git a/src-web/components/core/Checkbox.tsx b/src-web/components/core/Checkbox.tsx index 77062c8d..d77cae18 100644 --- a/src-web/components/core/Checkbox.tsx +++ b/src-web/components/core/Checkbox.tsx @@ -18,7 +18,7 @@ export function Checkbox({ checked, onChange, className, disabled }: Props) { onCheckedChange={onChange} className={classnames( className, - 'w-5 h-5 border border-gray-200 rounded', + 'flex-shrink-0 w-5 h-5 border border-gray-200 rounded', 'focus:border-focus', 'disabled:opacity-disabled', 'outline-none', diff --git a/src-web/components/core/IconButton.tsx b/src-web/components/core/IconButton.tsx index 7eee4df6..0a0908f5 100644 --- a/src-web/components/core/IconButton.tsx +++ b/src-web/components/core/IconButton.tsx @@ -47,7 +47,7 @@ const _IconButton = forwardRef(function IconButton( onClick={handleClick} className={classnames( className, - 'text-gray-700 hover:text-gray-1000', + 'flex-shrink-0 text-gray-700 hover:text-gray-1000', '!px-0', size === 'md' && 'w-9', size === 'sm' && 'w-8', diff --git a/src-web/components/core/PairEditor.tsx b/src-web/components/core/PairEditor.tsx index e4c428bd..7feea6d2 100644 --- a/src-web/components/core/PairEditor.tsx +++ b/src-web/components/core/PairEditor.tsx @@ -10,6 +10,7 @@ import type { GenericCompletionConfig } from './Editor/genericCompletion'; import { Icon } from './Icon'; import { IconButton } from './IconButton'; import { Input } from './Input'; +import { HStack } from './Stacks'; export type PairEditorProps = { pairs: Pair[]; @@ -235,65 +236,66 @@ const FormRow = memo(function FormRow({
{!isLast ? (
) : ( - + )} - - - - {onDelete ? ( - + - ) : ( - - )} + + + +
); });