Skip to content

Commit

Permalink
rename prop
Browse files Browse the repository at this point in the history
  • Loading branch information
emildohlenhansen committed Aug 21, 2023
1 parent 0612ab8 commit 005a038
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions packages/spor-react/src/input/NumericStepper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type NumericStepperProps = {
/** Whether the stepper is disabled or not */
isDisabled?: boolean;
/** Whether to show input field or not */
withoutInput?: boolean;
withInput?: boolean;
} & Omit<BoxProps, "onChange">;
/** A simple stepper component for integer values
*
Expand Down Expand Up @@ -67,7 +67,7 @@ export function NumericStepper({
minValue = 0,
maxValue = 99,
isDisabled,
withoutInput,
withInput = true,
...boxProps
}: NumericStepperProps) {
const { t } = useTranslation();
Expand All @@ -90,22 +90,7 @@ export function NumericStepper({
visibility={value <= minValue ? "hidden" : "visible"}
isDisabled={formControlProps.disabled}
/>
{withoutInput ? (
<chakra.text
fontSize="sm"
fontWeight="bold"
width="3ch"
marginX={1}
paddingX={1}
textAlign="center"
color={textColor}
transition="box-shadow .1s ease-out"
visibility={value === 0 ? "hidden" : "visible"}
aria-label={value.toString()}
>
{value}
</chakra.text>
) : (
{withInput ? (
<chakra.input
type="number"
min={minValue}
Expand All @@ -114,7 +99,7 @@ export function NumericStepper({
value={value}
{...formControlProps}
id={value !== 0 ? formControlProps.id : undefined}
fontSize="sm"
fontSize="sm"
fontWeight="bold"
width="3ch"
marginX={1}
Expand Down Expand Up @@ -154,6 +139,21 @@ export function NumericStepper({
onChange(numericInput);
}}
/>
) : (
<chakra.text
fontSize="sm"
fontWeight="bold"
width="3ch"
marginX={1}
paddingX={1}
textAlign="center"
color={textColor}
transition="box-shadow .1s ease-out"
visibility={value === 0 ? "hidden" : "visible"}
aria-label={value.toString()}
>
{value}
</chakra.text>
)}
<VerySmallButton
icon={<AddIcon color="white" />}
Expand Down

0 comments on commit 005a038

Please sign in to comment.