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

fix: navigation and ui of feedback page after submission #199

Merged
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
12 changes: 9 additions & 3 deletions frontend/src/pages/Feedback.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useState } from 'react';
import useDocTitle from '../hooks/useDocTitle';
import Rating from 'react-rating-stars-component';
import { useNavigate } from 'react-router-dom';

const Feedback = () => {
useDocTitle('Feedback - TelMedSphere');
Expand All @@ -11,7 +12,12 @@ const Feedback = () => {
});
const [submitStatus, setSubmitStatus] = useState(null);
const [isModalOpen, setIsModalOpen] = useState(false);
const navigate = useNavigate();

const handleClose = () => {
setIsModalOpen(false);
navigate('/');
};
const handleSubmit = async (e) => {
e.preventDefault();
const formDataToSend = new FormData();
Expand Down Expand Up @@ -89,7 +95,7 @@ const Feedback = () => {

<button
type="submit"
className="w-full bg-[rgb(123,116,215)] text-white font-bold py-3 px-6 rounded-lg hover:bg-[rgb(94, 88, 184)] transition-colors duration-300">
className="w-full text-white-1 bg-[rgb(123,116,215)] text-white font-bold py-3 px-6 rounded-lg hover:bg-[rgb(94, 88, 184)] transition-colors duration-300">
Submit Feedback
</button>

Expand All @@ -102,12 +108,12 @@ const Feedback = () => {

{isModalOpen && (
<div className="fixed inset-0 flex items-center justify-center bg-black bg-opacity-50 z-50">
<div className="bg-white p-8 rounded-xl shadow-lg max-w-md mx-4">
<div className="bg-white-1 p-8 rounded-xl shadow-lg max-w-md mx-4">
<h2 className="text-2xl font-bold mb-4 text-blue-600">Thank You!</h2>
<p className="mb-6 text-gray-600">Your feedback has been successfully submitted.</p>
<button
className="w-full bg-blue-600 text-white font-bold py-2 px-4 rounded-lg hover:bg-blue-700 transition duration-300"
onClick={() => setIsModalOpen(false)}
onClick={handleClose}
>
Close
</button>
Expand Down