Skip to content

Commit

Permalink
Merge pull request #66 from thomasKn/thomas/fv-269-hit-boxes-should-b…
Browse files Browse the repository at this point in the history
…e-44x44

Update quantity selector
  • Loading branch information
thomasKn authored Feb 12, 2024
2 parents ebfbbe4 + 7543b8f commit 5e5d256
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
16 changes: 10 additions & 6 deletions app/components/QuantitySelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ import type {ButtonProps} from './ui/Button';
import {IconButton} from './ui/Button';
export function QuantitySelector(props: {children: React.ReactNode}) {
return (
<div className="flex items-center overflow-hidden rounded border border-border">
{props.children}
</div>
<div className="flex items-center border-border">{props.children}</div>
);
}

Expand All @@ -26,15 +24,21 @@ const QuantityButton = forwardRef<
symbol === 'decrease' && 'Decrease quantity',
symbol === 'increase' && 'Increase quantity',
])}
className={cn(['rounded-none disabled:text-muted-foreground', className])}
className={cn([
'group rounded border disabled:opacity-100',
symbol === 'decrease'
? 'rounded-br-none rounded-tr-none border-r-0'
: 'rounded-bl-none rounded-tl-none border-l-0',
className,
])}
name={cx([
symbol === 'decrease' && 'decrease-quantity',
symbol === 'increase' && 'increase-quantity',
])}
ref={ref}
{...props}
>
<span>
<span className="group-disabled:opacity-40">
{
{
decrease: <>&#8722;</>,
Expand All @@ -50,7 +54,7 @@ QuantityButton.displayName = 'QuantityButton';

function Value(props: {children: React.ReactNode}) {
return (
<div className="min-w-[2.5rem] select-none px-2 text-center">
<div className="flex h-full min-w-[2.5rem] select-none items-center justify-center border-y px-2 text-center">
{props.children}
</div>
);
Expand Down
13 changes: 6 additions & 7 deletions app/components/cart/CartLineItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,12 @@ function ItemRemoveButton({lineId}: {lineId: CartLineFragment['id']}) {
}}
route={cartPath}
>
<div className="overflow-hidden rounded border">
<IconButton className="rounded-none" type="submit">
{/* Todo => add theme content string */}
<span className="sr-only">Remove</span>
<IconRemove aria-hidden="true" />
</IconButton>
</div>
<IconButton className="overflow-hidden rounded border" type="submit">
{/* Todo => add theme content string */}
<span className="sr-only">Remove</span>
<IconRemove aria-hidden="true" />
</IconButton>

<OptimisticInput data={{action: 'remove'}} id={lineId} />
</CartForm>
);
Expand Down

0 comments on commit 5e5d256

Please sign in to comment.