Merge pull request #180 from kjannette/analy2

Analy2
This commit is contained in:
S Jannette
2024-03-23 03:46:22 -05:00
committed by GitHub
4 changed files with 28 additions and 7 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

@@ -23,8 +23,15 @@ const ConfirmModal = ({
cancelButtonText, cancelButtonText,
}) => { }) => {
const [inputValue, setInputValue] = useState(""); const [inputValue, setInputValue] = useState("");
const [codeError, setCodeError] = useState("");
const title = titleText ? titleText : "Confirmation"; const title = titleText ? titleText : "Confirmation";
const handleConfirm = (code) => {
if (!code) {
setCodeError("Please enter a 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,10 +68,17 @@ const ConfirmModal = ({
inputValue inputValue
? "" ? ""
: isPromoModal : isPromoModal
? "Enter your promotional code" ? "Paste or type your code"
: "Description of issue" : "Description of issue"
} }
/> />
<div className="confirm-error-box">
{codeError ? (
<p className="confirm-error-text">{codeError}</p>
) : (
<></>
)}
</div>
</div> </div>
) : ( ) : (
<></> <></>
@@ -80,7 +94,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>

View File

@@ -134,7 +134,7 @@ section.section-1 {
font-size: 19px; font-size: 19px;
font-weight: 300; font-weight: 300;
max-width: 370px; max-width: 370px;
line-height: 29px; line-height: 1.5;
text-align: justify; text-align: justify;
margin-top: -8px; margin-top: -8px;
} }
@@ -166,7 +166,7 @@ p.text-block-1 {
font-size: 26px; font-size: 26px;
font-style: normal; font-style: normal;
font-weight: 300; font-weight: 300;
line-height: 1.5; line-height: 1.4;
width: 525px; width: 525px;
margin-top: 24px; margin-top: 24px;
} }

View File

@@ -34,7 +34,14 @@
color: red; color: red;
} }
} }
.confirm-error-box {
margin-top: -6px;
}
.confirm-error-text {
font-size: 14px;
color: red;
margin-left: 12px;
}
.upload-header-bold { .upload-header-bold {
font-weight: 500; font-weight: 500;
} }