-
- 📧
-
-
setEmail(e.target.value)}
- required
- />
+
+
Subscribe to our Newsletter
+
@@ -65,12 +62,13 @@ const NewsletterForm = () => {
);
};
+
const Section2 = () => {
const [isWide, setIsWide] = useState(null);
useEffect(() => {
const handleResize = () => setIsWide(window.innerWidth > 640);
- handleResize(); // Set initial value
+ handleResize();
window.addEventListener('resize', handleResize);
return () => window.removeEventListener('resize', handleResize);
}, []);
@@ -78,142 +76,64 @@ const Section2 = () => {
if (isWide === null) return null;
return (
- <>
- {!isWide && (
-
-
-
- )}
-
-
-
- BoardGame Cafe{!isWide &&
}
-
-
- ©2024 by Sip & Play
-
-
-
- >
+
+
+
+ BoardGame Cafe
+
+
©2024 by Sip & Play
+
);
};
const Nav = () => {
const navLinks = [
- {
- name: 'Home',
- link: '/',
- },
- {
- name: 'Events',
- link: '/events',
- },
- {
- name: 'Reservation',
- link: '/reservation',
- },
- {
- name: 'Boardgame',
- link: '/boardgame',
- },
- {
- name: 'About',
- link: '/about',
- },
+ { name: 'Home', link: '/' },
+ { name: 'Events', link: '/events' },
+ { name: 'Reservation', link: '/reservation' },
+ { name: 'Boardgame', link: '/boardgame' },
+ { name: 'About', link: '/about' },
];
+
const socialLink = [
- {
- name: 'Facebook',
- link: 'https://www.facebook.com/sipnplaynyc/',
- icon:
,
- },
- {
- name: 'Instagram',
- link: 'https://www.instagram.com/sipnplaynyc/?hl=en',
- icon:
,
- },
- {
- name: 'Tiktok',
- link: 'https://www.tiktok.com/@sipnplaynycofficial?lang=en',
- icon:
,
- },
- {
- name: 'GitHub',
- link: 'https://github.com/RamakrushnaBiswal/PlayCafe',
- icon:
,
- },
+ { name: 'Facebook', link: 'https://www.facebook.com/sipnplaynyc/', icon:
},
+ { name: 'Instagram', link: 'https://www.instagram.com/sipnplaynyc/?hl=en', icon:
},
+ { name: 'Tiktok', link: 'https://www.tiktok.com/@sipnplaynycofficial?lang=en', icon:
},
+ { name: 'GitHub', link: 'https://github.com/RamakrushnaBiswal/PlayCafe', icon:
},
];
+
const emailAddress = 'sipnplaynyc@gmail.com';
return (
-
-
-
+
+
-
+
-
);
};
diff --git a/frontend/src/components/ui/FeedbackForm.jsx b/frontend/src/components/ui/FeedbackForm.jsx
index df15fd07..924664fd 100644
--- a/frontend/src/components/ui/FeedbackForm.jsx
+++ b/frontend/src/components/ui/FeedbackForm.jsx
@@ -17,7 +17,6 @@ const FeedbackForm = () => {
visible: { opacity: 1, y: 0, transition: { duration: 0.5 } },
};
- // Use an environment variable for backend URL
const API_URL = import.meta.env.VITE_BACKEND_URL || 'http://localhost:3000';
const [name, setName] = useState('');
const [email, setEmail] = useState('');
@@ -25,22 +24,17 @@ const FeedbackForm = () => {
const [submitted, setSubmitted] = useState(false);
const [rating, setRating] = useState(null);
const [hover, setHover] = useState(null);
- const [totalStars] = useState(5); // No need to set this dynamically unless you plan to change it later
+ const [totalStars] = useState(5);
const [error, setError] = useState(null);
const [isLoading, setIsLoading] = useState(false);
const handleSubmit = async (e) => {
e.preventDefault();
-
- // Basic client-side validation for security
if (!name || !email || !feedback || !rating) {
setError('All fields are required, including the rating.');
return;
}
-
- // Clear any previous errors
setError(null);
-
setIsLoading(true);
try {
const response = await fetch(`${API_URL}/api/feedback/create`, {
@@ -50,23 +44,13 @@ const FeedbackForm = () => {
},
body: JSON.stringify({ name, email, feedback, rating }),
});
-
- // Check for JSON response
- let data;
- try {
- data = await response.json();
- } catch (jsonError) {
- throw new Error('Invalid response format.');
- }
-
+ const data = await response.json();
if (!response.ok) {
- const errorMessage =
- data.message || 'An error occurred while submitting feedback.';
+ const errorMessage = data.message || 'An error occurred while submitting feedback.';
setError(errorMessage);
console.error('Feedback submission failed:', errorMessage);
return;
}
-
setSubmitted(true);
setTimeout(() => {
setName('');
@@ -91,61 +75,55 @@ const FeedbackForm = () => {
initial="hidden"
animate={inView ? 'visible' : 'hidden'}
variants={animationVariants}
- className="lg:grid lg:grid-cols-2 lg:gap-8 lg:items-center"
+ className="flex flex-col lg:flex-row lg:gap-8 lg:items-center"
>
-
-
+
+
We value Your Feedback!
-
+
Your thoughts help us improve. Share your experience and suggestions with us!
-
-