+
Reservation Details
+
Guests: {reservation.guests}
+
Date: {new Intl.DateTimeFormat('en-US', {
+ year: 'numeric',
+ month: 'long',
+ day: 'numeric'
+ }).format(new Date(reservation.date))}
+
Time: {reservation.time}
+
Email: {reservation.email}
+
+);
+
+export default Profile;
diff --git a/frontend/src/components/Pages/Event.jsx b/frontend/src/components/Pages/Event.jsx
index da8bfcd..96ad51b 100644
--- a/frontend/src/components/Pages/Event.jsx
+++ b/frontend/src/components/Pages/Event.jsx
@@ -14,6 +14,8 @@ import game from '../../assets/Boardgames/carrom.gif';
import spin from '../../assets/Boardgames/spin.gif';
import MainHOC from '../MainHOC';
const daysOfWeek = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
+import { useNavigate } from 'react-router-dom';
+import Cookies from 'js-cookie';
const months = [
'January',
'February',
@@ -31,6 +33,16 @@ const months = [
function Event() {
const [events, setEvents] = useState([]);
const [error, setError] = useState(null);
+ const navigate = useNavigate();
+
+ const handleRegisterClick = () => {
+ const isAuthenticated = Boolean(Cookies.get('authToken'));
+
+ if (!isAuthenticated) {
+ alert("Please sign in to register for the event.");
+ navigate('/login');
+ }
+ };
useEffect(() => {
const fetchData = async () => {
try {
@@ -183,7 +195,7 @@ function Event() {
))}