Skip to content

Commit

Permalink
fix: Updates error
Browse files Browse the repository at this point in the history
  • Loading branch information
Katie George committed Apr 29, 2024
1 parent 16059fd commit ea75a6c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/pages/wizard/stepComponents/step2.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,13 @@ const InstanceOptions = ({

const validateStorageValue = (value, range) => {
if (!value) {
return false;
return '';
}
return value < range[0] || value > range[1];
if (value < range[0] || value > range[1]) {
return 'Enter a valid storage amount.';
}

return '';
};

return (
Expand Down Expand Up @@ -131,7 +135,7 @@ const InstanceOptions = ({
<FormField
label="Allocated storage"
description="Higher allocated storage may improve IOPS performance."
errorText={validateStorageValue(Number(storage), [20, 128]) ? 'Enter a valid storage amount.' : undefined}
errorText={validateStorageValue(Number(storage), [20, 128])}
>
<div className="flex-wrapper">
<div className="slider-wrapper">
Expand Down

0 comments on commit ea75a6c

Please sign in to comment.