Skip to content

Commit 78e53f0

Browse files
authored
chore : merging fixes to main
fixed api route of the contact support section added new review from the email
2 parents 6c31ad8 + 9762d89 commit 78e53f0

3 files changed

Lines changed: 22 additions & 21 deletions

File tree

app/api/contact/route.js

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
1-
import nodemailer from 'nodemailer';
2-
3-
export default async function handler(req, res) {
4-
if (req.method !== 'POST') {
5-
return res.status(405).json({ message: 'Method not allowed' });
6-
}
1+
import nodemailer from "nodemailer";
72

3+
export async function POST(req) {
84
try {
9-
const { name, email, subject, message } = req.body;
5+
const { name, email, subject, message } = await req.json();
106

117
// Create transporter
128
const transporter = nodemailer.createTransport({
13-
service: 'gmail', // or your email service
9+
service: "gmail",
1410
auth: {
1511
user: process.env.EMAIL_USER,
1612
pass: process.env.EMAIL_PASSWORD,
@@ -19,8 +15,8 @@ export default async function handler(req, res) {
1915

2016
// Email options
2117
const mailOptions = {
22-
from: process.env.EMAIL_USER,
23-
to: process.env.CONTACT_EMAIL, // Your receiving email
18+
from: email,
19+
to: process.env.EMAIL_USER, // Your receiving email
2420
subject: `New Contact Form Submission: ${subject}`,
2521
text: `
2622
Name: ${name}
@@ -34,16 +30,19 @@ export default async function handler(req, res) {
3430
<p><strong>Email:</strong> ${email}</p>
3531
<p><strong>Subject:</strong> ${subject}</p>
3632
<p><strong>Message:</strong></p>
37-
<p>${message.replace(/\n/g, '<br>')}</p>
33+
<p>${message.replace(/\n/g, "<br>")}</p>
3834
`,
3935
};
4036

4137
// Send email
4238
await transporter.sendMail(mailOptions);
4339

44-
res.status(200).json({ message: 'Email sent successfully' });
40+
return Response.json({ message: "Email sent successfully" });
4541
} catch (error) {
46-
console.error('Error sending email:', error);
47-
res.status(500).json({ message: 'Error sending email' });
42+
console.error("Error sending email:", error);
43+
return new Response(JSON.stringify({ message: "Error sending email" }), {
44+
status: 500,
45+
headers: { "Content-Type": "application/json" },
46+
});
4847
}
49-
}
48+
}

app/components/footer.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,14 @@ const legalLinks = [
8181
Made with ♥ by <a href="https://www.linkedin.com/in/sohan-rout/" className="text-blue-400 hover:text-blue-300">Sohan Rout</a>
8282
</span>
8383
</div>
84+
{/*
8485
<div className="flex items-start">
8586
<svg className="w-5 h-5 mt-0.5 mr-3 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
8687
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth="1.5" d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" />
8788
</svg>
8889
<a href="mailto:contact@dsavisualizer.com" className="hover:text-blue-400 transition">contact@dsavisualizer.com</a>
8990
</div>
91+
*/}
9092
</div>
9193
</div>
9294

app/components/testimonial.jsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ const TestimonialSection = () => {
3535
stars: 5,
3636
},
3737
{
38-
name: 'Priya Sharma',
39-
email: '@priya.s',
40-
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.`,
38+
name: 'Vansh Saini',
39+
email: '@Vanshsaini9311',
40+
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.`,
4141
stars: 5,
4242
},
4343
{
44-
name: 'Amit Patel',
45-
email: '@amit.p',
46-
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.`,
44+
name: 'Priya Sharma',
45+
email: '@priya.s',
46+
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.`,
4747
stars: 5,
4848
},
4949
{

0 commit comments

Comments
 (0)