Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation for contact form #210

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions lantern-club/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions lantern-club/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
},
"dependencies": {
"@auth/prisma-adapter": "^1.0.2",
"@coffeeandfun/google-profanity-words": "^2.1.0",
"@fortawesome/fontawesome-svg-core": "^6.5.1",
"@fortawesome/free-solid-svg-icons": "^6.5.1",
"@fortawesome/react-fontawesome": "^0.2.0",
Expand All @@ -33,8 +34,11 @@
"nodemailer": "^6.9.9",
"react": "^18.2.0",
"react-dom": "latest",
"react-form-input-validation": "^2.1.0",
"react-hook-form": "^7.51.3",
"react-intersection-observer": "^9.8.1",
"react-multi-carousel": "^2.8.4",
"swr": "^2.2.5",
"uuid": "^9.0.1"
},
"devDependencies": {
Expand Down
3 changes: 3 additions & 0 deletions lantern-club/src/components/contact/Contact.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export default function Contact() {

setFormData(tempFormData); // Store form data for later submission
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Halle! I noticed you remove these lines of code and may be conflicting with its current functionality, can you take a look at this. After hitting the submit button a confirmation modal should pop up but right now that is not happening!

setShowConfirmation(true); // Show the confirmation popup

};

const onConfirmSubmit = async () => {
Expand Down Expand Up @@ -87,6 +88,8 @@ export default function Contact() {
required
type="text"
name="name"
pattern="[A-Za-z.\s\-]+"
title="Must be a valid name (no numbers, symbols, etc.)"
className="mt-2 w-full p-3 border-contact-g1 border-4 mr-7 outline-gc2 h-8 contact-input rounded-3xl"
></input>
</div>
Expand Down