Skip to content

Commit

Permalink
notification on sumbit
Browse files Browse the repository at this point in the history
  • Loading branch information
DevGajjar28 committed Jun 20, 2024
1 parent 0d8e66e commit a8569e7
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 4 deletions.
36 changes: 36 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"react-icons": "^5.2.1",
"react-router-dom": "^6.23.1",
"react-scripts": "5.0.1",
"react-toastify": "^8.0.0",
"styled-components": "^6.1.11",
"web-vitals": "^4.1.1"
},
Expand Down
39 changes: 37 additions & 2 deletions src/Components/footer_section/ContactUs/contact_us.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,30 @@ import './contact_us.css';
import React from 'react';
import { Link } from 'react-router-dom';
import homeIcon from '../../../img/homeicon.png';
import { ToastContainer, toast, Bounce } from 'react-toastify';
import 'react-toastify/dist/ReactToastify.css';


function ContactUs() {
const handleSubmit = (event) => {
event.preventDefault();
// Perform form validation or any other logic here

// Show success toast notification
toast.success('Sent Successfully!', {
position: "top-center",
autoClose: 5000,
hideProgressBar: false,
closeOnClick: true,
pauseOnHover: false,
draggable: true,
progress: undefined,
theme: "dark",
transition: Bounce,
});
}


return (
<div className='box'>
<Link to="/">
Expand Down Expand Up @@ -44,7 +66,7 @@ function ContactUs() {
<div className='form'>
<h2>Facing any Issue? Help Us Improve!</h2>
<p>Use the form below to get in touch. We attempt to respond to support requests within 1 business day.</p>
<form>
<form onSubmit={handleSubmit}>
<label htmlFor="flname">Name :</label>
<input type='text' id='flname' name='flname' required></input>
<label htmlFor="email">Email :</label>
Expand All @@ -56,13 +78,26 @@ function ContactUs() {
<option value='Other'>Other</option>
</select>
<label htmlFor="message">Message :</label>
<textarea id='message' name='message'></textarea>
<textarea id='message' name='message' required></textarea>
<label htmlFor="attachments">Any Attachments :</label>
<input type='file' id='attachments' name='attachments'></input>
<button type='submit'>Submit</button>
</form>
</div>
</div>
<ToastContainer
position="top-center"
autoClose={5000}
hideProgressBar={false}
newestOnTop={false}
closeOnClick
rtl={false}
pauseOnFocusLoss
draggable
pauseOnHover={false}
theme="dark"
transition={Bounce}
/>
</div>
);
}
Expand Down
16 changes: 14 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4268,6 +4268,11 @@ cliui@^8.0.1:
strip-ansi "^6.0.1"
wrap-ansi "^7.0.0"

clsx@^1.1.1:
version "1.2.1"
resolved "https://registry.npmjs.org/clsx/-/clsx-1.2.1.tgz"
integrity sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==

clsx@^2.1.0:
version "2.1.1"
resolved "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz"
Expand Down Expand Up @@ -9330,7 +9335,7 @@ react-dev-utils@^12.0.1:
strip-ansi "^6.0.1"
text-table "^0.2.0"

react-dom@*, "react-dom@^16.8.0 || ^17.0.0 || ^18.0.0", "react-dom@^17.0.0 || ^18.0.0", react-dom@^17.0.2, "react-dom@>= 16.8.0", react-dom@>=16.6.0, react-dom@>=16.8, react-dom@>=16.8.0:
react-dom@*, "react-dom@^16.8.0 || ^17.0.0 || ^18.0.0", "react-dom@^17.0.0 || ^18.0.0", react-dom@^17.0.2, "react-dom@>= 16.8.0", react-dom@>=16, react-dom@>=16.6.0, react-dom@>=16.8, react-dom@>=16.8.0:
version "17.0.2"
resolved "https://registry.npmjs.org/react-dom/-/react-dom-17.0.2.tgz"
integrity sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA==
Expand Down Expand Up @@ -9449,6 +9454,13 @@ react-scripts@5.0.1:
optionalDependencies:
fsevents "^2.3.2"

react-toastify@^8.0.0:
version "8.0.0"
resolved "https://registry.npmjs.org/react-toastify/-/react-toastify-8.0.0.tgz"
integrity sha512-7a5uhwbJ5Ivp5QyJN8P9M8g+7wksJt51QuYAZW0c3pDOh0Jx8lH7XzNHzzJg4NHup9n4zcqH9rwXknnyzYg2OA==
dependencies:
clsx "^1.1.1"

react-transition-group@^4.4.5:
version "4.4.5"
resolved "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz"
Expand All @@ -9459,7 +9471,7 @@ react-transition-group@^4.4.5:
loose-envify "^1.4.0"
prop-types "^15.6.2"

react@*, "react@^16.8.0 || ^17.0.0 || ^18.0.0", "react@^17.0.0 || ^18.0.0", react@^17.0.2, "react@>= 16", "react@>= 16.8.0", react@>=16.3, react@>=16.6.0, react@>=16.8, react@>=16.8.0, react@17.0.2:
react@*, "react@^16.8.0 || ^17.0.0 || ^18.0.0", "react@^17.0.0 || ^18.0.0", react@^17.0.2, "react@>= 16", "react@>= 16.8.0", react@>=16, react@>=16.3, react@>=16.6.0, react@>=16.8, react@>=16.8.0, react@17.0.2:
version "17.0.2"
resolved "https://registry.npmjs.org/react/-/react-17.0.2.tgz"
integrity sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==
Expand Down

0 comments on commit a8569e7

Please sign in to comment.