1- import PropTypes from 'prop-types'
21import Link from 'next/link'
32
43import Button from '../atoms/Button'
@@ -7,206 +6,92 @@ import Heading from '../atoms/Heading'
76import Subtitle from '../atoms/Subtitle'
87
98import { choices , decisions } from '../../utils/designTokens'
10- import Paragraph from '../atoms/Paragraph'
11- import {
12- links ,
13- conferenceDate ,
14- conferenceStartTime
15- } from '../../utils/constants'
16- 17- const Newsletter = ( { name, email, handleSubmit, handleChange, isLoading } ) => {
18- const isHappening =
19- new Date ( `${ conferenceDate } T${ conferenceStartTime } ` ) <= Date . now ( )
20- 21- return (
22- < section id = "newsletter" className = "newsletter" >
23- < Container >
24- < div className = "description" >
25- < Heading size = { 1 } isInverted >
26- The CSS Conf Colombia 2021
27- </ Heading >
28- < Subtitle size = { 1 } isInverted withMargin >
29- is over, but you can watch it again 🎉
30- </ Subtitle >
31- { isHappening && (
32- < Link href = { links . RECORDING } >
33- < a >
34- < Button withMargin >
35- < Heading size = { 3 } isInverted >
36- Watch the recording
37- </ Heading >
38- </ Button >
39- </ a >
40- </ Link >
41- ) }
42- </ div >
43- { ! isHappening && (
44- < form className = "form" onSubmit = { handleSubmit } >
45- < div className = "field-group" >
46- < label htmlFor = "name" >
47- < Subtitle size = { 2 } isInverted >
48- Fullname:
49- </ Subtitle >
50- </ label >
51- < input
52- name = "name"
53- type = "name"
54- placeholder = "Your name"
55- value = { name }
56- onChange = { handleChange ( 'name' ) }
57- required
58- />
59- </ div >
60- < div className = "field-group" >
61- < label htmlFor = "email" >
62- < Subtitle size = { 2 } isInverted >
63- Email:
64- </ Subtitle >
65- </ label >
66- < input
67- name = "email"
68- type = "email"
69- placeholder = "Your email"
70- value = { email }
71- onChange = { handleChange ( 'email' ) }
72- required
73- />
74- </ div >
75- < Button type = "submit" withMargin isDisabled = { isLoading } >
9+ import { links } from '../../utils/constants'
10+ 11+ const Newsletter = ( ) => (
12+ < section id = "newsletter" className = "newsletter" >
13+ < Container >
14+ < div className = "description" >
15+ < Heading size = { 1 } isInverted >
16+ The CSS Conf Colombia 2021
17+ </ Heading >
18+ < Subtitle size = { 1 } isInverted withMargin >
19+ is over, but you can watch it again 🎉
20+ </ Subtitle >
21+ < Link href = { links . RECORDING } >
22+ < a >
23+ < Button withMargin >
7624 < Heading size = { 3 } isInverted >
77- Register for free
25+ Watch the recording
7826 </ Heading >
7927 </ Button >
80- < Paragraph size = "xs" isInverted >
81- ✅ By registering, you agree with the FAQs and our Code of
82- Conduct.
83- </ Paragraph >
84- < Paragraph size = "xs" isInverted >
85- ✅ The data will be used just for the event and we are not sharing
86- it with any third party or sponsor.
87- </ Paragraph >
88- </ form >
89- ) }
90- < div className = "bird" > </ div >
91- </ Container >
92- < style jsx > { `
28+ </ a >
29+ </ Link >
30+ </ div >
31+ < div className = "bird" > </ div >
32+ </ Container >
33+ < style jsx > { `
34+ .newsletter {
35+ display: flex;
36+ flex-direction: colum;
37+ align-items: center;
38+ position: relative;
39+ background: ${ choices . colors . brand . bayofmany } ;
40+ padding: 120px ${ decisions . container . padding } 50px;
41+ overflow: hidden;
42+ }
43+
44+ .newsletter :global(.container) > :global(.heading) {
45+ position: relative;
46+ z-index: 1;
47+ }
48+
49+ .description {
50+ position: relative;
51+ margin-bottom: 50px;
52+ text-align: center;
53+ z-index: 1;
54+ }
55+
56+ .bird {
57+ position: absolute;
58+ display: inline-block;
59+ background-image: url('/static/images/hero-tribal-bird-vector.svg');
60+ background-position: center center;
61+ background-repeat: no-repeat;
62+ background-size: contain;
63+ top: 50%;
64+ left: 0;
65+ transform: translate(40%, -50%);
66+ width: 500px;
67+ height: 500px;
68+ opacity: 0.1;
69+ pointer-events: none;
70+ }
71+
72+ @media (${ decisions . queries . screens . desktop } ) {
9373 .newsletter {
94- display: flex;
95- flex-direction: colum;
96- align-items: center;
97- position: relative;
98- background: ${ choices . colors . brand . bayofmany } ;
99- padding: 120px ${ decisions . container . padding } 50px;
100- overflow: hidden;
101- }
102-
103- .newsletter :global(.container) > :global(.heading) {
104- position: relative;
105- z-index: 1;
74+ display: block;
75+ padding-top: 60px;
10676 }
10777
10878 .description {
109- position: relative;
110- margin-bottom: 50px;
111- text-align: center;
112- z-index: 1;
113- }
114-
115- .form {
116- position: relative;
117- display: flex;
118- flex-direction: column;
119- max-width: ${ choices . screens . xs } ;
120- z-index: 1;
121- margin: 0 auto;
122- }
123-
124- .form :global(.paragraph) {
125- margin-top: 20px;
126- }
127-
128- .field-group {
129- margin-bottom: ${ choices . spacing [ 5 ] } ;
130- }
131-
132- label {
133- display: inline-block;
134- margin-bottom: ${ choices . spacing [ 1 ] } ;
135- }
136-
137- input {
138- height: 40px;
139- width: 100%;
140- border: 1px solid transparent;
141- margin-right: 20px;
142- padding: 10px 20px;
143- font-size: ${ choices . fontSize . lg } ;
144- color: ${ choices . colors . gray [ 800 ] } ;
145- }
146-
147- ::placeholder {
148- color: ${ choices . colors . gray [ 400 ] } ;
149- font-size: ${ choices . fontSize . lg } ;
150- font-weight: 300;
79+ margin-top: 100px;
80+ text-align: left;
15181 }
15282
15383 .bird {
154- position: absolute;
15584 display: inline-block;
156- background-image: url('/static/images/hero-tribal-bird-vector.svg');
157- background-position: center center;
158- background-repeat: no-repeat;
159- background-size: contain;
160- top: 50%;
161- left: 0;
162- transform: translate(40%, -50%);
163- width: 500px;
164- height: 500px;
165- opacity: 0.1;
166- pointer-events: none;
167- }
168-
169- @media (${ decisions . queries . screens . desktop } ) {
170- .newsletter {
171- display: block;
172- padding-top: 60px;
173- }
174-
175- .form {
176- margin 0;
177- }
178-
179- .description {
180- margin-top: 100px;
181- text-align: left;
182- }
183-
184- .bird {
185- display: inline-block;
186- bottom: 0;
187- right: 0;
188- width: 600px;
189- height: 600px;
190- opacity: 1;
191- transform: translate(120%, -50%);
192- }
85+ bottom: 0;
86+ right: 0;
87+ width: 600px;
88+ height: 600px;
89+ opacity: 1;
90+ transform: translate(120%, -50%);
19391 }
194- ` } </ style >
195- </ section >
196- )
197- }
198- 199- Newsletter . propTypes = {
200- name : PropTypes . string ,
201- email : PropTypes . string ,
202- handleSubmit : PropTypes . func ,
203- handleChange : PropTypes . func ,
204- isLoading : PropTypes . bool
205- }
206- 207- Newsletter . defaultProps = {
208- handleSubmit : ( ) => { } ,
209- handleChange : ( ) => { }
210- }
92+ }
93+ ` } </ style >
94+ </ section >
95+ )
21196
21297export default Newsletter
0 commit comments