fix: minor design bug
This commit is contained in:
@@ -17,14 +17,17 @@ export const AmountStepper = ({
|
|||||||
const step = (delta: number) => onChange(Math.max(min, (value || 0) + delta));
|
const step = (delta: number) => onChange(Math.max(min, (value || 0) + delta));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex items-stretch overflow-hidden rounded-2xl border border-solid" style={{ borderColor: "var(--joy-palette-divider)" }}>
|
<div
|
||||||
|
className="flex rounded-2xl border border-solid"
|
||||||
|
style={{ borderColor: "var(--joy-palette-divider)" }}
|
||||||
|
>
|
||||||
<IconButton
|
<IconButton
|
||||||
type="button"
|
type="button"
|
||||||
variant="plain"
|
variant="plain"
|
||||||
size="lg"
|
size="lg"
|
||||||
disabled={value <= min}
|
disabled={value <= min}
|
||||||
onClick={() => step(-1)}
|
onClick={() => step(-1)}
|
||||||
className="transition-transform active:scale-90"
|
className="flex-none transition-transform active:scale-90"
|
||||||
sx={{ borderRadius: 0 }}
|
sx={{ borderRadius: 0 }}
|
||||||
>
|
>
|
||||||
<Minus size={16} />
|
<Minus size={16} />
|
||||||
@@ -32,6 +35,7 @@ export const AmountStepper = ({
|
|||||||
<Input
|
<Input
|
||||||
type="number"
|
type="number"
|
||||||
value={value}
|
value={value}
|
||||||
|
className="grow"
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
const nextValue = Number(e.target.value);
|
const nextValue = Number(e.target.value);
|
||||||
onChange(Number.isNaN(nextValue) ? min : Math.max(min, nextValue));
|
onChange(Number.isNaN(nextValue) ? min : Math.max(min, nextValue));
|
||||||
@@ -51,7 +55,7 @@ export const AmountStepper = ({
|
|||||||
variant="plain"
|
variant="plain"
|
||||||
size="lg"
|
size="lg"
|
||||||
onClick={() => step(1)}
|
onClick={() => step(1)}
|
||||||
className="transition-transform active:scale-90"
|
className="flex-none transition-transform active:scale-90"
|
||||||
sx={{ borderRadius: 0 }}
|
sx={{ borderRadius: 0 }}
|
||||||
>
|
>
|
||||||
<Plus size={16} />
|
<Plus size={16} />
|
||||||
|
|||||||
Reference in New Issue
Block a user