Skip to content

Commit

Permalink
add ref null check, cancellation disclaimer
Browse files Browse the repository at this point in the history
  • Loading branch information
sabzdotpy committed Oct 24, 2024
1 parent 67c035c commit 3df2c7e
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 7 deletions.
7 changes: 7 additions & 0 deletions src/styles/ProjectExpoRegistration.scss
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,13 @@ nav.projectExpoNav {
}
}

.cancellationFee {
// font-family: ;
font-family: "Unbounded";
width: min(600px, 90%);
margin: 0 auto;
}

}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,17 @@ export default function ProjectExpoRegistration() {
return;
}

const upiValue = form.current.elements["upi_id"].value;

if (upiValue == UPI_ID) {
setConfirmModalShown(false);
setRegistrationLoading(false);
setRegistrationDisabled(false);
form.current.elements["upi_id"].focus();
toast.info("Please enter *YOUR* UPI ID");
return;
};

const teamName = form.current.elements.teamName.value;
const theme = form.current.elements.theme.value;
const teamSize = form.current.elements.numberOfMembers.value;
Expand Down Expand Up @@ -352,8 +363,13 @@ export default function ProjectExpoRegistration() {
name="referrerInput"
type="text"
placeholder="Referrer ID"
defaultValue={new URLSearchParams(location.search).get("ref")}
disabled={!!(new URLSearchParams(location.search).get("ref"))}
defaultValue={
new URLSearchParams(location.search).get("ref")
?
(new URLSearchParams(location.search).get("ref") != "null") ? new URLSearchParams(location.search).get("ref") : ""
: ""
}
disabled={!!(new URLSearchParams(location.search).get("ref") && new URLSearchParams(location.search).get("ref") != "null")}
/>
</div>

Expand Down Expand Up @@ -475,12 +491,10 @@ export default function ProjectExpoRegistration() {
type="text"
id="upi_id"
name="upi_id"
// value={upi_id}
// onChange={(e) => setupi_id(e.target.value)}
required
pattern="[\w\s\.\-\_]+@[\w]+"
title="Enter a valid UPI ID"
placeholder="Enter your UPI ID. ex: example@oksbi"
title="Enter YOUR valid UPI ID"
placeholder="Enter YOUR UPI ID. ex: example@oksbi"
required
/>

<label className="screenshotLabel" htmlFor="screenshotInput">Upload Payment Screenshot</label>
Expand Down Expand Up @@ -555,6 +569,10 @@ export default function ProjectExpoRegistration() {
) : (
<button disabled={registrationLoading || registrationDisabled}>{ (registrationLoading) ? "Please wait..." : "Register" }</button>
)}

<div className="cancellationFee">
NOTE: Cancelling of registration will incur a cancellation fee set by the organiser.
</div>
</form>
</div>
</>
Expand Down

0 comments on commit 3df2c7e

Please sign in to comment.