This commit is contained in:
Benjamin Toby 2024-05-04 07:45:48 +01:00
commit b88dd4f5cd
5 changed files with 56 additions and 37 deletions

View File

@ -1,4 +1,10 @@
[ [
{
"title": "Datasquirel",
"description": "Datasquirel is a fast and efficient cloud-based SQL data management system",
"url": "https://datasquirel.com",
"image": "/images/datasquirel-img.jpg"
},
{ {
"title": "Showme Rebates", "title": "Showme Rebates",
"description": "Showmerebates curates agents' rebates/cashback on properties in Utah, Texas, Florida, and Kansas states", "description": "Showmerebates curates agents' rebates/cashback on properties in Utah, Texas, Florida, and Kansas states",
@ -10,12 +16,11 @@
"description": "Summit Lending is a mortgage broker offering competitive rates for home loans of all sorts", "description": "Summit Lending is a mortgage broker offering competitive rates for home loans of all sorts",
"url": "https://summitlending.com", "url": "https://summitlending.com",
"image": "/images/summit-lending.jpg" "image": "/images/summit-lending.jpg"
}, }, {
{ "title": "Coderank",
"title": "Datasquirel", "description": "The New era of Talent acquisition and Remote work.",
"description": "Datasquirel is a fast and efficient cloud-based SQL data management system", "url": "https://coderank.net/",
"url": "https://datasquirel.com", "image": "https://static.datasquirel.com/images/user-images/user-2/tben-me/portfolio/screenshot-coderank.png"
"image": "/images/datasquirel-img.jpg"
}, },
{ {
"title": "Base Wears", "title": "Base Wears",

View File

@ -1,6 +1,10 @@
import { Dispatch, SetStateAction } from "react"; import { Dispatch, SetStateAction } from "react";
export default async function submitContactForm(e: any, setSuccess: Dispatch<SetStateAction<string | null>>, setLoading: Dispatch<SetStateAction<boolean>>) { export default async function submitContactForm(
e: any,
setSuccess: Dispatch<SetStateAction<string | null>>,
setLoading: Dispatch<SetStateAction<boolean>>
) {
e.preventDefault(); e.preventDefault();
setLoading(true); setLoading(true);
@ -15,26 +19,34 @@ export default async function submitContactForm(e: any, setSuccess: Dispatch<Set
message: message, message: message,
}; };
let res = await fetch("/api/contactForm", { try {
method: "post", let res = await fetch("/api/contactForm", {
headers: { method: "post",
"Content-Type": "application/json", headers: {
}, "Content-Type": "application/json",
body: JSON.stringify(body), },
}); body: JSON.stringify(body),
});
let data = await res.json(); let data = await res.json();
console.log(data); console.log(data);
if (data.msg === "Success") { if (data.msg === "Success") {
setSuccess("Success"); setSuccess("Success");
setTimeout(() => { setTimeout(() => {
window.location.reload(); window.location.reload();
}, 1000); }, 1000);
} else { } else {
setSuccess("Failed"); setSuccess("Failed");
}
setLoading(false);
} catch (error: any) {
console.log(
"Form submission failed. Please try again in a minute.",
error.message
);
window.alert("Form submission failed. Please try again in a minute.");
} }
setLoading(false);
} }

View File

@ -10,7 +10,7 @@ import { NextApiRequest, NextApiResponse } from "next";
let transporter = nodemailer.createTransport({ let transporter = nodemailer.createTransport({
host: process.env.TBENMAIL_HOST, host: process.env.TBENMAIL_HOST,
port: 587, port: 465,
auth: { auth: {
user: process.env.TBENMAIL_EMAIL, user: process.env.TBENMAIL_EMAIL,
pass: process.env.TBENMAIL_EMAIL_PASSWORD, pass: process.env.TBENMAIL_EMAIL_PASSWORD,
@ -46,7 +46,9 @@ export default async function handler(
res.json({ msg: "Success", info: info }); res.json({ msg: "Success", info: info });
} catch (error) { } catch (error) {
console.log(error); console.log(error);
res.json({ msg: "Failed" }); res.json({
msg: "Please try again in a minute.",
});
} }
} }
} }

View File

@ -1,17 +1,17 @@
console.log("main js"); // console.log("main js");
const lenis = new Lenis(); // const lenis = new Lenis();
lenis.on("scroll", (e) => { // lenis.on("scroll", (e) => {
// console.log(e); // // console.log(e);
}); // });
function raf(time) { // function raf(time) {
lenis.raf(time); // lenis.raf(time);
requestAnimationFrame(raf); // requestAnimationFrame(raf);
} // }
requestAnimationFrame(raf); // requestAnimationFrame(raf);
/** /**
* GSAP globals * GSAP globals

0
push.sh Normal file → Executable file
View File