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

feat: contact form | Sumbitted succefully mechanism #700

Merged
merged 8 commits into from
Mar 8, 2024
Merged
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
14 changes: 11 additions & 3 deletions src/components/Homepage/ContactForm/ContactForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ const ContactForm = () => {
const [isOpened, setIsOpened] = useState(false);
const [isClosed, setIsClosed] = useState(false);



useEffect(() => {
if (error || error2) {
toast.error("Please fill all the fields");
Expand Down Expand Up @@ -148,8 +150,12 @@ const ContactForm = () => {
if (response.data.message === "Form submitted successfully") {
setIsLoading(false);
setIsSuccess(true);
toast.success("Form submitted successfully")
setTimeout(() => {
setIsSuccess(false);
}, 50); // Reset after 0.005 seconds

setFormData({
setFormData({
name: "",
email: "",
reason: "",
Expand Down Expand Up @@ -439,8 +445,10 @@ Including:
<ErrorMessage>{"Server Error - Please contact us on discord"}</ErrorMessage>
)}
</ContactFormSection>
{isSuccess && !error ? <GlowingButton>Submit Successfully</GlowingButton>: null}
</ContactFormCard>


</ContactFormCard>

</ContactFormContainer>
);
};
Expand Down