Skip to content

Commit 2254a09

Browse files
authored
Merge pull request #337 from DevGajjar28/notification
notification on sumbit button
2 parents 0d8e66e + a8569e7 commit 2254a09

File tree

4 files changed

+88
-4
lines changed

4 files changed

+88
-4
lines changed

package-lock.json

Lines changed: 36 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"react-icons": "^5.2.1",
2424
"react-router-dom": "^6.23.1",
2525
"react-scripts": "5.0.1",
26+
"react-toastify": "^8.0.0",
2627
"styled-components": "^6.1.11",
2728
"web-vitals": "^4.1.1"
2829
},

src/Components/footer_section/ContactUs/contact_us.js

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,30 @@ import './contact_us.css';
22
import React from 'react';
33
import { Link } from 'react-router-dom';
44
import homeIcon from '../../../img/homeicon.png';
5+
import { ToastContainer, toast, Bounce } from 'react-toastify';
6+
import 'react-toastify/dist/ReactToastify.css';
7+
58

69
function ContactUs() {
10+
const handleSubmit = (event) => {
11+
event.preventDefault();
12+
// Perform form validation or any other logic here
13+
14+
// Show success toast notification
15+
toast.success('Sent Successfully!', {
16+
position: "top-center",
17+
autoClose: 5000,
18+
hideProgressBar: false,
19+
closeOnClick: true,
20+
pauseOnHover: false,
21+
draggable: true,
22+
progress: undefined,
23+
theme: "dark",
24+
transition: Bounce,
25+
});
26+
}
27+
28+
729
return (
830
<div className='box'>
931
<Link to="/">
@@ -44,7 +66,7 @@ function ContactUs() {
4466
<div className='form'>
4567
<h2>Facing any Issue? Help Us Improve!</h2>
4668
<p>Use the form below to get in touch. We attempt to respond to support requests within 1 business day.</p>
47-
<form>
69+
<form onSubmit={handleSubmit}>
4870
<label htmlFor="flname">Name :</label>
4971
<input type='text' id='flname' name='flname' required></input>
5072
<label htmlFor="email">Email :</label>
@@ -56,13 +78,26 @@ function ContactUs() {
5678
<option value='Other'>Other</option>
5779
</select>
5880
<label htmlFor="message">Message :</label>
59-
<textarea id='message' name='message'></textarea>
81+
<textarea id='message' name='message' required></textarea>
6082
<label htmlFor="attachments">Any Attachments :</label>
6183
<input type='file' id='attachments' name='attachments'></input>
6284
<button type='submit'>Submit</button>
6385
</form>
6486
</div>
6587
</div>
88+
<ToastContainer
89+
position="top-center"
90+
autoClose={5000}
91+
hideProgressBar={false}
92+
newestOnTop={false}
93+
closeOnClick
94+
rtl={false}
95+
pauseOnFocusLoss
96+
draggable
97+
pauseOnHover={false}
98+
theme="dark"
99+
transition={Bounce}
100+
/>
66101
</div>
67102
);
68103
}

yarn.lock

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4268,6 +4268,11 @@ cliui@^8.0.1:
42684268
strip-ansi "^6.0.1"
42694269
wrap-ansi "^7.0.0"
42704270

4271+
clsx@^1.1.1:
4272+
version "1.2.1"
4273+
resolved "https://registry.npmjs.org/clsx/-/clsx-1.2.1.tgz"
4274+
integrity sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==
4275+
42714276
clsx@^2.1.0:
42724277
version "2.1.1"
42734278
resolved "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz"
@@ -9330,7 +9335,7 @@ react-dev-utils@^12.0.1:
93309335
strip-ansi "^6.0.1"
93319336
text-table "^0.2.0"
93329337

9333-
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:
9338+
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:
93349339
version "17.0.2"
93359340
resolved "https://registry.npmjs.org/react-dom/-/react-dom-17.0.2.tgz"
93369341
integrity sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA==
@@ -9449,6 +9454,13 @@ [email protected]:
94499454
optionalDependencies:
94509455
fsevents "^2.3.2"
94519456

9457+
react-toastify@^8.0.0:
9458+
version "8.0.0"
9459+
resolved "https://registry.npmjs.org/react-toastify/-/react-toastify-8.0.0.tgz"
9460+
integrity sha512-7a5uhwbJ5Ivp5QyJN8P9M8g+7wksJt51QuYAZW0c3pDOh0Jx8lH7XzNHzzJg4NHup9n4zcqH9rwXknnyzYg2OA==
9461+
dependencies:
9462+
clsx "^1.1.1"
9463+
94529464
react-transition-group@^4.4.5:
94539465
version "4.4.5"
94549466
resolved "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz"
@@ -9459,7 +9471,7 @@ react-transition-group@^4.4.5:
94599471
loose-envify "^1.4.0"
94609472
prop-types "^15.6.2"
94619473

9462-
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, [email protected]:
9474+
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, [email protected]:
94639475
version "17.0.2"
94649476
resolved "https://registry.npmjs.org/react/-/react-17.0.2.tgz"
94659477
integrity sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==

0 commit comments

Comments
 (0)