This commit is contained in:
Kenneth Jannette
2024-03-23 03:13:30 -05:00
parent b77ee96743
commit f8e2f5cea6
2 changed files with 9 additions and 4 deletions

View File

@@ -456,7 +456,7 @@ const HomePage = () => {
</section> </section>
{showPromoModal ? ( {showPromoModal ? (
<ConfirmModal <ConfirmModal
titleText="Enter Promo Code" titleText="Enter Code"
onCancel={handleCancelModal} onCancel={handleCancelModal}
buttonLabelText="Enter Code" buttonLabelText="Enter Code"
isPromoModal={true} isPromoModal={true}

View File

@@ -24,7 +24,12 @@ const ConfirmModal = ({
}) => { }) => {
const [inputValue, setInputValue] = useState(""); const [inputValue, setInputValue] = useState("");
const title = titleText ? titleText : "Confirmation"; const title = titleText ? titleText : "Confirmation";
const handleConfirm = (code) => {
if (!code) {
return;
}
onConfirm(code);
};
return ( return (
<Modal show="true" onHide={onCancel} size="lg"> <Modal show="true" onHide={onCancel} size="lg">
<Modal.Header closeButton> <Modal.Header closeButton>
@@ -61,7 +66,7 @@ const ConfirmModal = ({
inputValue inputValue
? "" ? ""
: isPromoModal : isPromoModal
? "Enter your promotional code" ? "Paste or type your code"
: "Description of issue" : "Description of issue"
} }
/> />
@@ -80,7 +85,7 @@ const ConfirmModal = ({
<Button <Button
disabled={isBusy} disabled={isBusy}
className="primary-button" className="primary-button"
onClick={() => onConfirm(inputValue)} onClick={() => handleConfirm(inputValue)}
labelText={buttonLabelText} labelText={buttonLabelText}
/> />
</Modal.Footer> </Modal.Footer>