Skip to content

Commit

Permalink
Merge pull request #2064 from DevGajjar28/notification
Browse files Browse the repository at this point in the history
contact page notification
  • Loading branch information
panwar8279 authored Jul 22, 2024
2 parents 18cf2ac + f7eb0eb commit 7f5bd86
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 11 deletions.
22 changes: 16 additions & 6 deletions frontend/src/App.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
*{
cursor:none;
* {
cursor: none;
}

.sidebar-content {
padding: 10px;
cursor: none;
transition: background-color 0.2s;
}
padding: 10px;
cursor: none;
transition: background-color 0.2s;
}

.Toastify__toast-container {
color: #000;
}

.Toastify__toast {
font-size: 18px;
color: black;
background-color: rgb(165, 57, 197);
}
43 changes: 38 additions & 5 deletions frontend/src/Component/Contact.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import React, { useState } from "react";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import {
faLinkedin,
faFacebook,
faGithub,
faLinkedin,
faTwitter,
faFacebook,
} from "@fortawesome/free-brands-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import Lottie from "lottie-react";
import React, { useState } from "react";
import { Bounce, ToastContainer, toast } from "react-toastify";
import "react-toastify/dist/ReactToastify.css";
import animationData from "../lottie/contact.json";
import "../style/Contact.css";

Expand All @@ -22,6 +24,24 @@ const Contact = () => {
setIsValid(emailRegex.test(value));
};

const handleSubmit = (event) => {
event.preventDefault();
if (isValid && email) {
toast("✅ Sent Successfully!", {
position: "top-center",
autoClose: 5000,
hideProgressBar: false,
closeOnClick: true,
pauseOnHover: false,
draggable: true,
progress: undefined,
theme: "light",
transition: Bounce,
closeButton: true,
});
}
};

return (
<div className="outer-contact">
<div className="contact-container">
Expand All @@ -38,7 +58,7 @@ const Contact = () => {
<p className="contact-description">
Please fill out the form below to get in touch with us.
</p>
<form className="contact-form">
<form className="contact-form" onSubmit={handleSubmit}>
<div className="form-group">
<label htmlFor="name" className="form-label">
Name
Expand Down Expand Up @@ -122,6 +142,19 @@ const Contact = () => {
</div>
</div>
</div>
<ToastContainer
position="top-center"
autoClose={5000}
hideProgressBar={false}
newestOnTop={false}
closeOnClick
rtl={false}
pauseOnFocusLoss
draggable
pauseOnHover={false}
theme="light"
transition={Bounce}
/>
</div>
);
};
Expand Down

0 comments on commit 7f5bd86

Please sign in to comment.