|
1 | | -import React from 'react' |
2 | | -import { useForm, ValidationError } from '@formspree/react' |
3 | | -import { BigText, IconContainer, Paragraph, Widont } from '@/components/home/common' |
| 1 | +import { IconContainer } from '@/components/home/common' |
4 | 2 | import { ReactComponent as Icon } from '@/img/icons/home/newsletter.svg' |
5 | 3 | import { gradients } from '@/utils/gradients' |
| 4 | +import React from 'react' |
6 | 5 |
|
7 | 6 | export function Newsletter() { |
8 | | - const [state, handleSubmit] = useForm('moqyyjvo', { |
9 | | - data: { |
10 | | - _subject: 'Someone joined the newsletter', |
11 | | - pageTitle: function () { |
12 | | - // This function will be evaluated at submission time |
13 | | - return document.title |
14 | | - }, |
15 | | - }, |
16 | | - }) |
17 | | - if (state.succeeded) { |
18 | | - return ( |
19 | | - <div className="p-5 m-5 flex flex-wrap font-semibold hover:shadow-lg rounded-lg border border-green-400 bg-green-300 text-green-900 "> |
20 | | - <span className="mr-2"> |
21 | | - <svg |
22 | | - xmlns="http://www.w3.org/2000/svg" |
23 | | - className="h-6 w-6" |
24 | | - fill="none" |
25 | | - viewBox="0 0 24 24" |
26 | | - stroke="currentColor" |
27 | | - > |
28 | | - <path |
29 | | - stroke-linecap="round" |
30 | | - stroke-linejoin="round" |
31 | | - stroke-width="2" |
32 | | - d="M14 10h4.764a2 2 0 011.789 2.894l-3.5 7A2 2 0 0115.263 21h-4.017c-.163 0-.326-.02-.485-.06L7 20m7-10V5a2 2 0 00-2-2h-.095c-.5 0-.905.405-.905.905 0 .714-.211 1.412-.608 2.006L7 11v9m7-10h-2M7 20H5a2 2 0 01-2-2v-6a2 2 0 012-2h2.5" |
33 | | - /> |
34 | | - </svg> |
35 | | - </span> |
36 | | - Congratulations! |
37 | | - <p className="font-normal pl-2">You have successfully subscribed to our newsletter.</p> |
38 | | - </div> |
39 | | - ) |
40 | | - } |
41 | 7 | return ( |
42 | 8 | <section id="newsletter"> |
43 | | - <div className="px-4 sm:px-6 md:px-8 mb-10 sm:mb-16 md:mb-20"> |
| 9 | + <div className="flex flex-col justify-center items-center px-4 sm:px-6 md:px-8 mb-10 sm:mb-8 md:mb-20"> |
44 | 10 | <IconContainer className={`${gradients.blue[0]} mb-8`}> |
45 | 11 | <Icon /> |
46 | 12 | </IconContainer> |
47 | | - <BigText className="mb-8"> |
48 | | - <Widont>Want product news and updates?</Widont> |
49 | | - </BigText> |
50 | | - <Paragraph className="mb-6">Sign Up for our weekly newsletter.</Paragraph> |
| 13 | + <p className="text-3xl sm:text-5xl lg:text-6xl text-center leading-none font-extrabold text-gray-900 tracking-tight mb-8">Want product news and updates?</p> |
| 14 | + <p className="max-w-4xl text-lg sm:text-2xl text-center font-medium sm:leading-10 space-y-6">Subscribe to our newsletter.</p> |
51 | 15 | </div> |
52 | 16 | <div className="max-w-xl mx-auto"> |
53 | | - <form onSubmit={handleSubmit} class="mt-2"> |
54 | | - <div className="flex flex-center flex-wrap p-5 space-y-4 sm:space-y-4 sm:space-x-0 text-center mt-12"> |
55 | | - <input |
56 | | - id="email" |
57 | | - type="email" |
58 | | - name="email" |
59 | | - className="flex-none w-full px-4 py-4 font-medium text-lg bg-gray-100 hover:shadow-lg rounded-lg border border-gray-400 focus:outline-none" |
60 | | - placeholder="Enter your email" |
61 | | - required |
62 | | - /> |
63 | | - <ValidationError |
64 | | - prefix="Email" |
65 | | - field="email" |
66 | | - errors={state.errors} |
67 | | - className="p-5 rounded-lg w-full flex-none hover:shadow-lg font-semibold border border-red-400 bg-red-300 text-red-900" |
68 | | - /> |
69 | | - <button |
70 | | - type="submit" |
71 | | - disabled={state.submitting} |
72 | | - className="w-full px-6 py-4 sm:w-auto flex-none bg-blue-700 hover:bg-blue-600 text-white text-lg shadow-md hover:shadow-lg leading-6 font-semibold border border-transparent rounded-lg focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:ring-blue-600 focus:outline-none transition-colors duration-200" |
73 | | - > |
74 | | - Sign Up |
75 | | - </button> |
76 | | - <p className="pt-2 text-base flex-center"> |
77 | | - We care about the protection of your data. Read our{' '} |
78 | | - <a className="text-blue-500 font-medium underline" href="/"> |
79 | | - Privacy Policy |
80 | | - </a> |
81 | | - </p> |
82 | | - </div> |
83 | | - </form> |
| 17 | + <div id="revue-embed"> |
| 18 | + <form action="https://www.getrevue.co/profile/javaistic/add_subscriber" double_opt_in="false" method="post" id="revue-form" name="revue-form" target="_blank"> |
| 19 | + <div className="flex flex-center flex-wrap p-5 pb-1 space-y-4 sm:space-y-4 sm:space-x-0 text-center mt-1"> |
| 20 | + <label for="member_email">Email address</label> |
| 21 | + <input className="flex-none w-full px-4 py-4 font-medium text-lg bg-gray-100 hover:shadow-lg rounded-lg border border-gray-400 focus:outline-none" placeholder="Your email address..." type="email" name="member[email]" id="member_email" /> |
| 22 | + </div> |
| 23 | + <div className="flex flex-center flex-wrap p-5 pb-1 space-y-4 sm:space-y-4 sm:space-x-0 text-center"> |
| 24 | + <label for="member_first_name">First name <span class="optional">(Optional)</span></label> |
| 25 | + <input className="flex-none w-full px-4 py-4 font-medium text-lg bg-gray-100 hover:shadow-lg rounded-lg border border-gray-400 focus:outline-none" placeholder="First name... (Optional)" type="text" name="member[first_name]" id="member_first_name" /> |
| 26 | + </div> |
| 27 | + <div className="flex flex-center flex-wrap p-5 pb-1 space-y-4 sm:space-y-4 sm:space-x-0 text-center"> |
| 28 | + <label for="member_last_name">Last name <span class="optional">(Optional)</span></label> |
| 29 | + <input className="flex-none w-full px-4 py-4 font-medium text-lg bg-gray-100 hover:shadow-lg rounded-lg border border-gray-400 focus:outline-none" placeholder="Last name... (Optional)" type="text" name="member[last_name]" id="member_last_name" /> |
| 30 | + </div> |
| 31 | + <div className="flex flex-center flex-wrap p-5 pb-1 space-y-4 sm:space-y-4 sm:space-x-0 text-center"> |
| 32 | + <input className="w-full px-6 py-4 sm:w-auto flex-none bg-blue-700 hover:bg-blue-600 text-white text-lg shadow-md hover:shadow-lg leading-6 font-semibold border border-transparent rounded-lg focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:ring-blue-600 focus:outline-none transition-colors duration-200" type="submit" value="Subscribe" name="member[subscribe]" id="member_submit" /> |
| 33 | + </div> |
| 34 | + <div className="p-5 lg:p-0 lg:pt-3 sm:p-5 text-base flex-center">By subscribing, you agree with Revue’s <a target="_blank" className="text-blue-500 font-medium underline" href="https://www.getrevue.co/terms" rel="noreferrer">Terms of Service</a> and <a target="_blank" className="text-blue-500 font-medium underline" href="https://www.getrevue.co/privacy" rel="noreferrer">Privacy Policy</a>.</div> |
| 35 | + </form> |
| 36 | + </div> |
84 | 37 | </div> |
85 | 38 | </section> |
86 | 39 | ) |
|
0 commit comments