+"use client";
+import { React, useEffect, useState, Component } from "react";
+import { sendEmail } from "../utils/Emailscript";
+import { motion } from "framer-motion";
+import { useInView } from "react-intersection-observer";
+
+const Newsletter = () => {
+ const [isSuccess, setIsSuccess] = useState(false);
+ const { ref: s1, inView: newsVisible1 } = useInView();
+ const handleSubmit = (e) => {
+ e.preventDefault();
+
+ // Get form data
+ // const fullName = e.target.elements.full_name.value;
+ const email = e.target.elements.email.value;
+ // console.log(email);
+ const organization = e.target.elements.organization.value;
+
+ sendEmail(email, organization)
+ .then((response) => {
+ console.log("Email sent successfully!", response, email);
+ // Update the success message
+ setIsSuccess(true);
+ // this.setState({ successMessage: 'Thank you for signing up! ' });
+ })
+ .catch((error) => {
+ console.error("Email sending failed:", error);
+ // Handle error (e.g., show an error message)
+ });
+ };
+
+ return (
+
+
+
+
+
+ Get started with
+
+
+
+ xmigrate
+
+
+
+
+
+ Subscribe to our newsletter and become a part of our thriving
+ community. Get access to exclusive content.
+
+
+
+
+
+
+
+ {isSuccess ? (
+
Thank you for joining us!
+ ) : (
+
+
+ )}
+
-
+
+
+
+
+
+ );
+};
export default Newsletter;
diff --git a/package-lock.json b/package-lock.json
index bcee468..820c1d4 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -3,14 +3,48 @@
"version": "0.1.0",
"lockfileVersion": 1,
"requires": true,
- "dependencies": {
- "@alloc/quick-lru": {
+ "packages": {
+ "": {
+ "name": "xmigrateweb",
+ "version": "0.1.0",
+ "dependencies": {
+ "aos": "^2.3.4",
+ "emailjs-com": "^3.2.0",
+ "framer-motion": "^10.16.16",
+ "next": "14.0.3",
+ "react": "^18",
+ "react-dom": "^18",
+ "react-icons": "^4.12.0",
+ "react-intersection-observer": "^9.5.3"
+ },
+ "devDependencies": {
+ "autoprefixer": "^10.0.1",
+ "postcss": "^8",
+ "tailwindcss": "^3.3.0"
+ }
+ },
+ "node_modules/@alloc/quick-lru": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/@alloc/quick-lru/-/quick-lru-5.2.0.tgz",
"integrity": "sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==",
"dev": true
},
- "@jridgewell/gen-mapping": {
+ "node_modules/@emotion/is-prop-valid": {
+ "version": "0.8.8",
+ "resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-0.8.8.tgz",
+ "integrity": "sha512-u5WtneEAr5IDG2Wv65yhunPSMLIpuKsbuOktRojfrEiEvRyC85LgPMZI63cr7NUqT8ZIGdSVg8ZKGxIug4lXcA==",
+ "optional": true,
+ "dependencies": {
+ "@emotion/memoize": "0.7.4"
+ }
+ },
+ "node_modules/@emotion/memoize": {
+ "version": "0.7.4",
+ "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.7.4.tgz",
+ "integrity": "sha512-Ja/Vfqe3HpuzRsG1oBtWTHk2PGZ7GR+2Vz5iYGelAw8dx32K0y7PjVuxK6z1nMpZOqAFsRUPCkK1YjJ56qJlgw==",
+ "optional": true
+ },
+ "node_modules/@jridgewell/gen-mapping": {
"version": "0.3.3",
"resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz",
"integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==",
@@ -158,7 +192,17 @@
"picomatch": "^2.0.4"
}
},
- "arg": {
+ "node_modules/aos": {
+ "version": "2.3.4",
+ "resolved": "https://registry.npmjs.org/aos/-/aos-2.3.4.tgz",
+ "integrity": "sha512-zh/ahtR2yME4I51z8IttIt4lC1Nw0ktsFtmeDzID1m9naJnWXhCoARaCgNOGXb5CLy3zm+wqmRAEgMYB5E2HUw==",
+ "dependencies": {
+ "classlist-polyfill": "^1.0.3",
+ "lodash.debounce": "^4.0.6",
+ "lodash.throttle": "^4.0.1"
+ }
+ },
+ "node_modules/arg": {
"version": "5.0.2",
"resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz",
"integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==",
@@ -267,7 +311,12 @@
}
}
},
- "client-only": {
+ "node_modules/classlist-polyfill": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/classlist-polyfill/-/classlist-polyfill-1.2.0.tgz",
+ "integrity": "sha512-GzIjNdcEtH4ieA2S8NmrSxv7DfEV5fmixQeyTmqmRmRJPGpRBaSnA2a0VrCjyT8iW8JjEdMbKzDotAJf+ajgaQ=="
+ },
+ "node_modules/client-only": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz",
"integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA=="
@@ -308,12 +357,16 @@
"integrity": "sha512-dM8BMtXtlH237ecSMnYdYuCkib2QHq0kpWfUnavjdYsyr/6OsAwg5ZGUfnQ9KD1Ga4QgB2sqXlB2NT8zy2GnVg==",
"dev": true
},
- "emailjs-com": {
+ "node_modules/emailjs-com": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/emailjs-com/-/emailjs-com-3.2.0.tgz",
- "integrity": "sha512-Prbz3E1usiAwGjMNYRv6EsJ5c373cX7/AGnZQwOfrpNJrygQJ15+E9OOq4pU8yC977Z5xMetRfc3WmDX6RcjAA=="
+ "integrity": "sha512-Prbz3E1usiAwGjMNYRv6EsJ5c373cX7/AGnZQwOfrpNJrygQJ15+E9OOq4pU8yC977Z5xMetRfc3WmDX6RcjAA==",
+ "deprecated": "The SDK name changed to @emailjs/browser",
+ "engines": {
+ "node": ">=12.0.0"
+ }
},
- "escalade": {
+ "node_modules/escalade": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
"integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==",
@@ -367,7 +420,30 @@
"integrity": "sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==",
"dev": true
},
- "fs.realpath": {
+ "node_modules/framer-motion": {
+ "version": "10.16.16",
+ "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-10.16.16.tgz",
+ "integrity": "sha512-je6j91rd7NmUX7L1XHouwJ4v3R+SO4umso2LUcgOct3rHZ0PajZ80ETYZTajzEXEl9DlKyzjyt4AvGQ+lrebOw==",
+ "dependencies": {
+ "tslib": "^2.4.0"
+ },
+ "optionalDependencies": {
+ "@emotion/is-prop-valid": "^0.8.2"
+ },
+ "peerDependencies": {
+ "react": "^18.0.0",
+ "react-dom": "^18.0.0"
+ },
+ "peerDependenciesMeta": {
+ "react": {
+ "optional": true
+ },
+ "react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==",
@@ -506,7 +582,17 @@
"integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==",
"dev": true
},
- "loose-envify": {
+ "node_modules/lodash.debounce": {
+ "version": "4.0.8",
+ "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz",
+ "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow=="
+ },
+ "node_modules/lodash.throttle": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz",
+ "integrity": "sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ=="
+ },
+ "node_modules/loose-envify": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
"integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==",
@@ -753,7 +839,15 @@
"resolved": "https://registry.npmjs.org/react-icons/-/react-icons-4.12.0.tgz",
"integrity": "sha512-IBaDuHiShdZqmfc/TwHu6+d6k2ltNCf3AszxNmjJc1KUfXdEeRJOKyNvLmAHaarhzGmTSVygNdyu8/opXv2gaw=="
},
- "read-cache": {
+ "node_modules/react-intersection-observer": {
+ "version": "9.5.3",
+ "resolved": "https://registry.npmjs.org/react-intersection-observer/-/react-intersection-observer-9.5.3.tgz",
+ "integrity": "sha512-NJzagSdUPS5rPhaLsHXYeJbsvdpbJwL6yCHtMk91hc0ufQ2BnXis+0QQ9NBh6n9n+Q3OyjR6OQLShYbaNBkThQ==",
+ "peerDependencies": {
+ "react": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0"
+ }
+ },
+ "node_modules/read-cache": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz",
"integrity": "sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==",
diff --git a/package.json b/package.json
index 4adcff6..549564b 100644
--- a/package.json
+++ b/package.json
@@ -9,11 +9,14 @@
"lint": "next lint"
},
"dependencies": {
+ "aos": "^2.3.4",
"emailjs-com": "^3.2.0",
- "next": "^14.0.3",
+ "framer-motion": "^10.16.16",
+ "next": "14.0.3",
"react": "^18",
"react-dom": "^18",
- "react-icons": "^4.12.0"
+ "react-icons": "^4.12.0",
+ "react-intersection-observer": "^9.5.3"
},
"devDependencies": {
"autoprefixer": "^10.0.1",
diff --git a/public/image/Vector.png b/public/image/Vector.png
new file mode 100644
index 0000000..f185d44
Binary files /dev/null and b/public/image/Vector.png differ
diff --git a/utils/Emailscript.js b/utils/Emailscript.js
index df59ed9..304bb7f 100644
--- a/utils/Emailscript.js
+++ b/utils/Emailscript.js
@@ -1,6 +1,6 @@
import emailjs from "emailjs-com";
-export const sendEmail = (email) => {
+export const sendEmail = (email, organization) => {
// Initialize email.js with your user ID
emailjs.init("X3Z_QUxaIZazE6d-l");
@@ -10,6 +10,7 @@ export const sendEmail = (email) => {
to_name: "xmigrate", // Replace with the recipient's name
// name: fullName,
email: email,
+ organization: organization,
};