add validation and basic api && change design sidebar

This commit is contained in:
ehsanahmadi456
2025-04-01 15:38:07 +03:30
parent b09957f97c
commit 13a9de2438
8 changed files with 41 additions and 12 deletions
@@ -24,13 +24,12 @@ function ModalAddCard() {
const updateNum = (value, type, name) => {
const parseValue = +value;
const { max } = validate_phone_number;
const validateValue = parseValue > max ? data[name].value : value;
changeData(validateValue, name);
changeData(parseValue, name);
};
const isValidData = data.card && data.shaba && data.value && data.value.value;
return (
<>
{/* Button Modal */}
@@ -69,6 +68,7 @@ function ModalAddCard() {
<Button
variant="contained"
onClick={handleClose}
disabled={!isValidData}
className="!min-w-[134px] !rounded-[4px] !h-[40px] md:!h-[44px] lg:!h-[48px] !text-[#EFEFEF] !text-[16px] !font-medium"
>
ذخیره