From 0205e2b17713c8fd9ef1d8d9d95d815f8e239d1f Mon Sep 17 00:00:00 2001 From: Tben Date: Tue, 30 Jan 2024 04:27:23 +0100 Subject: [PATCH 1/3] update form --- functions/frontend/submitContactForm.ts | 46 +++++++++++++++---------- pages/api/contactForm.ts | 6 ++-- 2 files changed, 31 insertions(+), 21 deletions(-) diff --git a/functions/frontend/submitContactForm.ts b/functions/frontend/submitContactForm.ts index a6283dd..f9b2e24 100644 --- a/functions/frontend/submitContactForm.ts +++ b/functions/frontend/submitContactForm.ts @@ -1,6 +1,10 @@ import { Dispatch, SetStateAction } from "react"; -export default async function submitContactForm(e: any, setSuccess: Dispatch>, setLoading: Dispatch>) { +export default async function submitContactForm( + e: any, + setSuccess: Dispatch>, + setLoading: Dispatch> +) { e.preventDefault(); setLoading(true); @@ -15,26 +19,30 @@ export default async function submitContactForm(e: any, setSuccess: Dispatch { - window.location.reload(); - }, 1000); - } else { - setSuccess("Failed"); + if (data.msg === "Success") { + setSuccess("Success"); + setTimeout(() => { + window.location.reload(); + }, 1000); + } else { + setSuccess("Failed"); + } + + setLoading(false); + } catch (error) { + console.log("Form submission failed. Please try again in a minute."); } - - setLoading(false); } diff --git a/pages/api/contactForm.ts b/pages/api/contactForm.ts index a819ea9..20a2ddd 100644 --- a/pages/api/contactForm.ts +++ b/pages/api/contactForm.ts @@ -10,7 +10,7 @@ import { NextApiRequest, NextApiResponse } from "next"; let transporter = nodemailer.createTransport({ host: process.env.TBENMAIL_HOST, - port: 587, + port: 465, auth: { user: process.env.TBENMAIL_EMAIL, pass: process.env.TBENMAIL_EMAIL_PASSWORD, @@ -46,7 +46,9 @@ export default async function handler( res.json({ msg: "Success", info: info }); } catch (error) { console.log(error); - res.json({ msg: "Failed" }); + res.json({ + msg: "Please try again in a minute.", + }); } } } From df3d3a5ea2a249494db390f9657083b9c83f1e0a Mon Sep 17 00:00:00 2001 From: Tben Date: Tue, 30 Jan 2024 04:29:07 +0100 Subject: [PATCH 2/3] update form --- functions/frontend/submitContactForm.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/functions/frontend/submitContactForm.ts b/functions/frontend/submitContactForm.ts index f9b2e24..c52babc 100644 --- a/functions/frontend/submitContactForm.ts +++ b/functions/frontend/submitContactForm.ts @@ -42,7 +42,11 @@ export default async function submitContactForm( } setLoading(false); - } catch (error) { - console.log("Form submission failed. Please try again in a minute."); + } 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."); } } From 0aa29ffaf3fab14b971fe2a776526c23c7e2b311 Mon Sep 17 00:00:00 2001 From: Ben <52448020+BenjaminToby@users.noreply.github.com> Date: Sat, 9 Mar 2024 02:50:40 +0000 Subject: [PATCH 3/3] Update portfolio, remove Lenis Scroll --- components/portfolioEntries.json | 17 +++++++++++------ public/scripts/main.js | 20 ++++++++++---------- push.sh | 0 3 files changed, 21 insertions(+), 16 deletions(-) mode change 100644 => 100755 push.sh diff --git a/components/portfolioEntries.json b/components/portfolioEntries.json index 1482c4f..ab0cf10 100644 --- a/components/portfolioEntries.json +++ b/components/portfolioEntries.json @@ -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", "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", "url": "https://summitlending.com", "image": "/images/summit-lending.jpg" - }, - { - "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": "Coderank", + "description": "The New era of Talent acquisition and Remote work.", + "url": "https://coderank.net/", + "image": "https://static.datasquirel.com/images/user-images/user-2/tben-me/portfolio/screenshot-coderank.png" }, { "title": "Base Wears", diff --git a/public/scripts/main.js b/public/scripts/main.js index 52c9034..83596e7 100644 --- a/public/scripts/main.js +++ b/public/scripts/main.js @@ -1,17 +1,17 @@ -console.log("main js"); +// console.log("main js"); -const lenis = new Lenis(); +// const lenis = new Lenis(); -lenis.on("scroll", (e) => { - // console.log(e); -}); +// lenis.on("scroll", (e) => { +// // console.log(e); +// }); -function raf(time) { - lenis.raf(time); - requestAnimationFrame(raf); -} +// function raf(time) { +// lenis.raf(time); +// requestAnimationFrame(raf); +// } -requestAnimationFrame(raf); +// requestAnimationFrame(raf); /** * GSAP globals diff --git a/push.sh b/push.sh old mode 100644 new mode 100755