diff --git a/docs/.env.example b/docs/.env.example index 22f6e715f..56b26dafb 100644 --- a/docs/.env.example +++ b/docs/.env.example @@ -3,4 +3,5 @@ UMAMI_PROJECT_API_KEY=xxxx UMAMI_APP_URL=xxxx ALGOLIA_API_KEY=xxxx ALGOLIA_APP_ID=xxxx -GITHUB_ACCESS_TOKEN=xxxx \ No newline at end of file +GITHUB_ACCESS_TOKEN=xxxx +API_KEY_BREVO=xxxx \ No newline at end of file diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index 4e7e91baf..79d833413 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -341,7 +341,7 @@ const config = { // { // type: "docSidebar", // sidebarId: "pricingSidebar", - // positionL: "left", + // positionl: "left", // label: "Pricing", // }, // Navbar right diff --git a/docs/package.json b/docs/package.json index eb386d783..1c8f6fe34 100644 --- a/docs/package.json +++ b/docs/package.json @@ -40,10 +40,12 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "react-icons": "^4.11.0", + "react-tweet": "^3.2.0", "redocusaurus": "^2.0.0", "sass": "^1.69.3", "tailwind-merge": "^2.1.0", - "tailwindcss": "^3.3.3" + "tailwindcss": "^3.3.3", + "react-hook-form": "^7.47.0" }, "devDependencies": { "@docusaurus/module-type-aliases": "^3.0.0", diff --git a/docs/src/containers/Footer/index.js b/docs/src/containers/Footer/index.js index 186839e04..0f94120c9 100644 --- a/docs/src/containers/Footer/index.js +++ b/docs/src/containers/Footer/index.js @@ -2,6 +2,7 @@ import React from 'react' import { AiOutlineGithub, AiOutlineTwitter } from 'react-icons/ai' import { BiLogoDiscordAlt, BiLogoLinkedin } from 'react-icons/bi' +import { useForm } from 'react-hook-form' const socials = [ { @@ -105,8 +106,37 @@ const menus = [ const getCurrentYear = new Date().getFullYear() export default function Footer() { + const { register, handleSubmit } = useForm({ + defaultValues: { + email: '', + }, + }) + + const onSubmit = (data) => { + const { email } = data + const options = { + method: 'POST', + headers: { + 'accept': 'application/json', + 'content-type': 'application/json', + 'api-key': process.env.API_KEY_BREVO, + }, + body: JSON.stringify({ + updateEnabled: false, + email, + listIds: [13], + }), + } + + if (email) { + fetch('https://api.brevo.com/v3/contacts', options) + .then((response) => response.json()) + .catch((err) => console.error(err)) + } + } + return ( -