diff --git a/cms.data.js b/cms.data.js index 84c6769..2d34916 100644 --- a/cms.data.js +++ b/cms.data.js @@ -10,6 +10,12 @@ export const navigationLinks = export const navigationHrefs = [ "#why-invest", "#why-invest", "#why-invest" ]; export const cta = "Invest"; export const logoSrc = undefined; +export const newsletterContent = { + newsletterTitle : 'Subscribe', + newsletterSubtitle : 'Say informed with updates from our blog ', + newsletterHref : 'https://slightlysharpe.com', + newsletterName : 'Slightly Sharpe', +}; export const stats1Data = [ { icon : "", diff --git a/components/FAQCard.jsx b/components/FAQCard.jsx index 3f8f4db..68cf896 100644 --- a/components/FAQCard.jsx +++ b/components/FAQCard.jsx @@ -1,6 +1,6 @@ export default function FAQCard({ title, listItems }) { return ( -
+
-

+

{title}

-
@@ -111,7 +47,7 @@ export default function Footer({ entityTitle, logoSrc, footerItems, socials }) {
diff --git a/components/Hero.jsx b/components/Hero.jsx index f523829..2784a58 100644 --- a/components/Hero.jsx +++ b/components/Hero.jsx @@ -9,7 +9,7 @@ export default function Hero({ session, }) { return ( -
+
diff --git a/components/MobileNavbar.jsx b/components/MobileNavbar.jsx index 122e09a..26ddea7 100644 --- a/components/MobileNavbar.jsx +++ b/components/MobileNavbar.jsx @@ -83,7 +83,7 @@ export default function MobileNavbar({
setMobileMenuIsClicked(!mobileMenuIsClicked)} > diff --git a/components/Newsletter.jsx b/components/Newsletter.jsx new file mode 100644 index 0000000..ca4e833 --- /dev/null +++ b/components/Newsletter.jsx @@ -0,0 +1,95 @@ +import { useState, useRef } from "react"; + +export default function Newsletter({ + newsletterTitle, + newsletterSubtitle, + newsletterName, + newsletterHref, +}) { + const inputEl = useRef(null); + const [inputError, setInputError] = useState(false); + const [message, setMessage] = useState(""); + const [subscribed, setSubscribed] = useState(false); + + const subscribe = async (e) => { + e.preventDefault(); + + const res = await fetch(`/api/convertkit`, { + body: JSON.stringify({ + email: inputEl.current.value, + }), + headers: { + "Content-Type": "application/json", + }, + method: "POST", + }); + + const { error } = await res.json(); + if (error) { + setInputError(true); + setMessage( + "Your e-mail address is invalid or you are already subscribed!" + ); + return; + } + + inputEl.current.value = ""; + setInputError(false); + setSubscribed(true); + setMessage("Successfully! 🎉 You are now subscribed."); + }; + + return ( +
+

+ {newsletterTitle || "Subscribe"} +

+

+ {newsletterSubtitle || "Stay informed with updates from our blog "} + + {newsletterName || "Slighly Sharpe"} + + . +

+
+ + + + {inputError && ( +
+ {message} +
+ )} +
+
+ ); +} diff --git a/components/Sections/FactCards.jsx b/components/Sections/FactCards.jsx index 875b453..1d5434a 100644 --- a/components/Sections/FactCards.jsx +++ b/components/Sections/FactCards.jsx @@ -10,7 +10,7 @@ export default function FactCards({ factCardsContent }) { {index + 1} -

+

{title}

diff --git a/components/Sections/FactSnippets.jsx b/components/Sections/FactSnippets.jsx index ecffef7..d7c23d8 100644 --- a/components/Sections/FactSnippets.jsx +++ b/components/Sections/FactSnippets.jsx @@ -23,7 +23,7 @@ export default function FactSnippets({ cta1Href={cta1Href} cta2Href={cta2Href} /> -

+
{factSnippetsCardContent?.map( ({ description, imageSrc, title, subTitle }, index) => { return ( @@ -36,9 +36,9 @@ export default function FactSnippets({ {description}

Avatar image

{title}

{subTitle}

diff --git a/components/Sections/Stats1.jsx b/components/Sections/Stats1.jsx index 4c265b5..fee61cc 100644 --- a/components/Sections/Stats1.jsx +++ b/components/Sections/Stats1.jsx @@ -4,7 +4,7 @@ export default function Stats1({ data }) { return (
-
+
{data?.map((props, index) => { return ; })} diff --git a/components/Sections/WhyInvest.jsx b/components/Sections/WhyInvest.jsx index 339220b..15d09bc 100644 --- a/components/Sections/WhyInvest.jsx +++ b/components/Sections/WhyInvest.jsx @@ -11,7 +11,7 @@ export default function WhyInvest({ return (
-
+
-
+
{whyInvestCardData?.map((description, index) => { return ( - +
+ {label}
-

{description}

+

+ {description} +

); diff --git a/components/WhyInvestHero.jsx b/components/WhyInvestHero.jsx index e583a31..6970a54 100644 --- a/components/WhyInvestHero.jsx +++ b/components/WhyInvestHero.jsx @@ -1,7 +1,7 @@ -export default function WhyInvest1Hero({ subTitle, title, description, cta }) { +export default function WhyInvestHero({ subTitle, title, description, cta }) { return ( -
-
+
+
{subTitle} diff --git a/pages/index.jsx b/pages/index.jsx index 2284f36..b1084c8 100644 --- a/pages/index.jsx +++ b/pages/index.jsx @@ -36,6 +36,7 @@ import { hostname, teamContent, factSnippetsContent, + newsletterContent, } from "../cms.data"; export default function Funded() { @@ -184,6 +185,7 @@ export default function Funded() { logoSrc={logoSrc} footerItems={footerItems} socials={socials} + {...newsletterContent} />