|
1 | 1 | import React from 'react' |
2 | | -import { useFormField } from 'hooks/useFormField' |
3 | | -import css from './newsletter.module.scss' |
4 | | -import { Alert } from '../alert' |
5 | 2 | import { Button } from 'lib/components/button' |
6 | | -import { EMAIL_DEVCON } from 'utils/constants' |
7 | | -import { motion } from 'framer-motion' |
8 | | - |
9 | | -export interface Result { |
10 | | - result: 'success' | 'error' |
11 | | - msg: string |
12 | | -} |
| 3 | +import Link from 'lib/components/link' |
13 | 4 |
|
14 | 5 | interface Props { |
15 | 6 | id?: string |
16 | 7 | } |
17 | 8 |
|
18 | | -const MC_ENDPOINT = |
19 | | - 'https://ethereum.us7.list-manage.com/subscribe/post-json?u=bfdb1ffb0f71e3a27b9d96aed&id=013a6fa362' |
20 | | - |
21 | 9 | export const Newsletter = (props: Props) => { |
22 | | - const emailField = useFormField() |
23 | | - const [result, setResult] = React.useState<Result | undefined>(undefined) |
24 | | - |
25 | | - function onDismiss() { |
26 | | - setResult(undefined) |
27 | | - } |
28 | | - |
29 | 10 | return ( |
30 | | - <form |
31 | | - action="https://login.sendpulse.com/forms/simple/u/eyJ1c2VyX2lkIjo4MjUxNTM4LCJhZGRyZXNzX2Jvb2tfaWQiOjEwNDI3MSwibGFuZyI6ImVuIn0=" |
32 | | - method="post" |
33 | | - > |
34 | | - <div> |
35 | | - <p className="semi-bold">Subscribe to our newsletter</p> |
36 | | - <div> |
37 | | - {result ? ( |
38 | | - <div className={css['alert-container']}> |
39 | | - <Alert type={result.result} message={result.msg} dismissable={true} dismissed={onDismiss} /> |
40 | | - </div> |
41 | | - ) : ( |
42 | | - <> |
43 | | - <p>Stay up to date on the latest devcon news and updates.</p> |
44 | | - <div className={`${css['container']} flex-col`}> |
45 | | - <motion.input |
46 | | - className={`${css['input']} rounded-full p-2.5 px-5 border-solid border border-slate-300`} |
47 | | - type="email" |
48 | | - name="email" |
49 | | - whileFocus={{ boxShadow: '0px 0px 4px 0px black' }} |
50 | | - id={props.id ?? 'newsletter_email'} |
51 | | - placeholder="Enter your email" |
52 | | - {...emailField} |
53 | | - /> |
54 | | - <input type="hidden" name="sender" value={EMAIL_DEVCON} /> |
55 | | - <Button color="black-1" className="!flex w-full mt-2 !justify-start" fill fat type="submit"> |
56 | | - Subscribe to Newsletter |
57 | | - </Button> |
58 | | - </div> |
59 | | - </> |
60 | | - )} |
61 | | - </div> |
62 | | - </div> |
63 | | - </form> |
| 11 | + <div> |
| 12 | + <p className="semi-bold">Subscribe to our newsletter</p> |
| 13 | + <Link href="https://paragraph.com/@efevents/subscribe"> |
| 14 | + <Button color="black-1" className="!flex w-full mt-2 !justify-start" fill fat type="submit"> |
| 15 | + Subscribe |
| 16 | + </Button> |
| 17 | + </Link> |
| 18 | + </div> |
64 | 19 | ) |
65 | 20 | } |
0 commit comments