Skip to content

Commit cc5a6b7

Browse files
committed
newsletter
1 parent 38dbfd4 commit cc5a6b7

1 file changed

Lines changed: 9 additions & 54 deletions

File tree

Lines changed: 9 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,20 @@
11
import React from 'react'
2-
import { useFormField } from 'hooks/useFormField'
3-
import css from './newsletter.module.scss'
4-
import { Alert } from '../alert'
52
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'
134

145
interface Props {
156
id?: string
167
}
178

18-
const MC_ENDPOINT =
19-
'https://ethereum.us7.list-manage.com/subscribe/post-json?u=bfdb1ffb0f71e3a27b9d96aed&id=013a6fa362'
20-
219
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-
2910
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>
6419
)
6520
}

0 commit comments

Comments
 (0)