diff --git a/app/api/contact/route.js b/app/api/contact/route.js
index 3cb34ff..43ef6df 100644
--- a/app/api/contact/route.js
+++ b/app/api/contact/route.js
@@ -1,16 +1,12 @@
-import nodemailer from 'nodemailer';
-
-export default async function handler(req, res) {
- if (req.method !== 'POST') {
- return res.status(405).json({ message: 'Method not allowed' });
- }
+import nodemailer from "nodemailer";
+export async function POST(req) {
try {
- const { name, email, subject, message } = req.body;
+ const { name, email, subject, message } = await req.json();
// Create transporter
const transporter = nodemailer.createTransport({
- service: 'gmail', // or your email service
+ service: "gmail",
auth: {
user: process.env.EMAIL_USER,
pass: process.env.EMAIL_PASSWORD,
@@ -19,8 +15,8 @@ export default async function handler(req, res) {
// Email options
const mailOptions = {
- from: process.env.EMAIL_USER,
- to: process.env.CONTACT_EMAIL, // Your receiving email
+ from: email,
+ to: process.env.EMAIL_USER, // Your receiving email
subject: `New Contact Form Submission: ${subject}`,
text: `
Name: ${name}
@@ -34,16 +30,19 @@ export default async function handler(req, res) {
Email: ${email}
Subject: ${subject}
Message:
- ${message.replace(/\n/g, '
')}
+ ${message.replace(/\n/g, "
")}
`,
};
// Send email
await transporter.sendMail(mailOptions);
- res.status(200).json({ message: 'Email sent successfully' });
+ return Response.json({ message: "Email sent successfully" });
} catch (error) {
- console.error('Error sending email:', error);
- res.status(500).json({ message: 'Error sending email' });
+ console.error("Error sending email:", error);
+ return new Response(JSON.stringify({ message: "Error sending email" }), {
+ status: 500,
+ headers: { "Content-Type": "application/json" },
+ });
}
-}
\ No newline at end of file
+}
diff --git a/app/components/footer.jsx b/app/components/footer.jsx
index 88a61ad..d0ca089 100644
--- a/app/components/footer.jsx
+++ b/app/components/footer.jsx
@@ -81,12 +81,14 @@ const legalLinks = [
Made with ♥ by Sohan Rout
+ {/*
+ */}
diff --git a/app/components/testimonial.jsx b/app/components/testimonial.jsx
index 9aa095a..6520616 100644
--- a/app/components/testimonial.jsx
+++ b/app/components/testimonial.jsx
@@ -35,15 +35,15 @@ const TestimonialSection = () => {
stars: 5,
},
{
- name: 'Priya Sharma',
- email: '@priya.s',
- review: `As a visual learner, this tool has been revolutionary for me. Being able to see the algorithms in action with different speeds makes all the difference. The color coding helps distinguish between different operations clearly.`,
+ name: 'Vansh Saini',
+ email: '@Vanshsaini9311',
+ review: `The data structure application website is an excellent platform for both beginners and advanced learners. It offers clear, interactive demonstrations of essential data structures like stacks, queues, trees, and graphs. The real-time visualizations make complex topics easier to understand, and the practical examples enhance learning. The clean, responsive design and user-friendly navigation add to its appeal. Whether you're a student or a developer, this site is a valuable resource for strengthening your understanding of algorithms and data structures.`,
stars: 5,
},
{
- name: 'Amit Patel',
- email: '@amit.p',
- review: `Excellent resource for interview preparation. The way it visualizes time and space complexity helps build intuition. I've recommended it to all my friends who are preparing for technical interviews.`,
+ name: 'Priya Sharma',
+ email: '@priya.s',
+ review: `As a visual learner, this tool has been revolutionary for me. Being able to see the algorithms in action with different speeds makes all the difference. The color coding helps distinguish between different operations clearly.`,
stars: 5,
},
{