11import { NextSeo } from 'next-seo' ;
22import Image from 'next/image' ;
3- import router , { useRouter } from 'next/router' ;
3+ import { useRouter } from 'next/router' ;
44import Layout from '@/layout/Layout' ;
55import { getSite } from '@/services/notion.server' ;
66import { Site } from '@/models/site.model' ;
7- import { HTMLAttributes , useEffect , useRef } from 'react' ;
8- import { useFormFields , useMailChimpForm } from 'use-mailchimp-form' ;
7+ import { useEffect , useRef } from 'react' ;
98import { useScroll } from '@/hooks/useScroll' ;
109import { GetStaticProps , InferGetStaticPropsType } from 'next' ;
1110
@@ -27,44 +26,14 @@ export const getStaticProps: GetStaticProps<StaticParams> = async ({
2726export default function Sponsorship ( {
2827 site,
2928} : InferGetStaticPropsType < typeof getStaticProps > ) {
30- const url =
31- 'https://dev.us5.list-manage.com/subscribe/post?u=d5670cc367744e51204ca56f8&id=c07a1fa483' ;
32-
33- const defaultFields = {
34- EMAIL : '' ,
35- FNAME : '' ,
36- LNAME : '' ,
37- PHONE : '' ,
38- COMPANY : '' ,
39- WEBSITE : '' ,
40- SPONSOR : '' ,
41- } ;
42-
4329 const form = useRef < HTMLDivElement > ( null ) ;
4430 const email = useRef < HTMLInputElement > ( null ) ;
4531 const router = useRouter ( ) ;
4632 const scroll = useScroll ( ) ;
4733 const scrollBtn = useRef < HTMLButtonElement > ( null ) ;
4834
49- const { loading, error, success, message, handleSubmit, reset } =
50- useMailChimpForm ( url ) ;
51- const { fields, handleFieldChange } = useFormFields ( defaultFields ) ;
52-
5335 const scrollToForm = ( ) => {
5436 if ( form && form . current ) form . current . scrollIntoView ( ) ;
55- if ( email && email . current ) email . current . focus ( ) ;
56- } ;
57-
58- const isInViewport = ( e : HTMLElement ) => {
59- const rect = e . getBoundingClientRect ( ) ;
60- console . log ( rect ) ;
61- return (
62- rect . top >= 0 &&
63- rect . left >= 0 &&
64- rect . bottom <=
65- ( window . innerHeight || document . documentElement . clientHeight ) &&
66- rect . right <= ( window . innerWidth || document . documentElement . clientWidth )
67- ) ;
6837 } ;
6938
7039 useEffect ( ( ) => {
@@ -138,183 +107,11 @@ export default function Sponsorship({
138107 ) ) }
139108
140109 < div ref = { form } className = "bg-white rounded" >
141- < >
142- { /* Begin Mailchimp Signup Form */ }
143- < div id = "mc_embed_signup" >
144- < form
145- onSubmit = { ( event ) => {
146- event . preventDefault ( ) ;
147- handleSubmit ( fields ) ;
148- } }
149- >
150- < div
151- id = "mc_embed_signup_scroll"
152- className = "flex flex-wrap m-2 lg:m-8"
153- >
154- < h2 className = "w-full m-8" > Sponsor</ h2 >
155- < div className = "w-full text-right indicates-required" >
156- < span className = "asterisk" > *</ span > indicates required
157- </ div >
158- < div className = "flex flex-col w-full mb-2 mc-field-group" >
159- < label htmlFor = "EMAIL" >
160- Email Address < span className = "asterisk" > *</ span >
161- </ label >
162- < input
163- type = "email"
164- id = "EMAIL"
165- ref = { email }
166- value = { fields . EMAIL }
167- onChange = { handleFieldChange }
168- required
169- />
170- </ div >
171- < div className = "flex flex-col w-full mb-2 mc-field-group" >
172- < label htmlFor = "FNAME" >
173- First Name < span className = "asterisk" > *</ span >
174- </ label >
175- < input
176- type = "text"
177- name = "FNAME"
178- value = { fields . FNAME }
179- onChange = { handleFieldChange }
180- id = "FNAME"
181- required
182- />
183- </ div >
184- < div className = "flex flex-col w-full mb-2 mc-field-group" >
185- < label htmlFor = "LNAME" >
186- Last Name < span className = "asterisk" > *</ span >
187- </ label >
188- < input
189- type = "text"
190- value = { fields . LNAME }
191- onChange = { handleFieldChange }
192- name = "LNAME"
193- id = "LNAME"
194- required
195- />
196- </ div >
197- < div className = "flex flex-col w-full mb-2 mc-field-group size1of2" >
198- < label htmlFor = "PHONE" > Phone Number </ label >
199- < input
200- type = "text"
201- name = "PHONE"
202- value = { fields . PHONE }
203- onChange = { handleFieldChange }
204- id = "PHONE"
205- />
206- </ div >
207- < div className = "flex flex-col w-full mb-2 mc-field-group" >
208- < label htmlFor = "COMPANY" >
209- Company < span className = "asterisk" > *</ span >
210- </ label >
211- < input
212- type = "text"
213- value = { fields . COMPANY }
214- onChange = { handleFieldChange }
215- name = "COMPANY"
216- id = "COMPANY"
217- required
218- />
219- </ div >
220- < div className = "flex flex-col w-full mb-2 mc-field-group" >
221- < label htmlFor = "WEBSITE" >
222- Website URL < span className = "asterisk" > *</ span >
223- </ label >
224- < input
225- type = "text"
226- value = { fields . WEBSITE }
227- onChange = { handleFieldChange }
228- name = "WEBSITE"
229- id = "WEBSITE"
230- />
231- </ div >
232- < div className = "flex flex-col w-full mb-2 mc-field-group input-group" >
233- < strong >
234- Sponsorship Options < span className = "asterisk" > *</ span >
235- </ strong >
236- < ul >
237- < li >
238- < input
239- required
240- type = "radio"
241- checked = { '$150 - 1 Show' === fields . SPONSOR }
242- id = "SPONSOR"
243- value = "$150 - 1 Show"
244- name = "SPONSOR"
245- onChange = { handleFieldChange }
246- />
247- < label htmlFor = "SPONSOR-0" className = "ml-2" >
248- $150 - 1 Show
249- </ label >
250- </ li >
251- < li >
252- < input
253- type = "radio"
254- checked = { '$400 - 3 Shows' === fields . SPONSOR }
255- id = "SPONSOR"
256- value = "$400 - 3 Shows"
257- onChange = { handleFieldChange }
258- name = "SPONSOR"
259- />
260- < label htmlFor = "SPONSOR-1" className = "ml-2" >
261- $400 - 3 Shows
262- </ label >
263- </ li >
264- < li >
265- < input
266- type = "radio"
267- checked = { '$900 - 10 Shows' === fields . SPONSOR }
268- id = "SPONSOR"
269- value = "$900 - 10 Shows"
270- onChange = { handleFieldChange }
271- name = "SPONSOR"
272- />
273- < label htmlFor = "SPONSOR-2" className = "ml-2" >
274- $900 - 10 Shows
275- </ label >
276- </ li >
277- </ ul >
278- </ div >
279- < div id = "mce-responses" className = "clear" >
280- < div
281- className = "response"
282- id = "mce-error-response"
283- style = { { display : 'none' } }
284- />
285- < div
286- className = "response"
287- id = "mce-success-response"
288- style = { { display : 'none' } }
289- />
290- </ div > { ' ' }
291- { /* real people should not fill this in and expect good things - do not remove this or risk form bot signups*/ }
292- < div
293- style = { { position : 'absolute' , left : '-5000px' } }
294- aria-hidden = "true"
295- >
296- < input
297- type = "text"
298- name = "b_d5670cc367744e51204ca56f8_c07a1fa483"
299- tabIndex = { - 1 }
300- defaultValue = ""
301- />
302- </ div >
303- < div className = "flex flex-col" >
304- < div className = "mb-2 clear" >
305- < input type = "submit" className = "btn-primary" />
306- </ div >
307- { loading && 'submitting' }
308- { error && (
309- < div dangerouslySetInnerHTML = { { __html : message } } />
310- ) }
311- { success && message }
312- </ div >
313- </ div >
314- </ form >
315- </ div >
316- { /*End mc_embed_signup*/ }
317- </ >
110+ < iframe
111+ className = "border-none w-full"
112+ height = "680px"
113+ src = "https://notionforms.io/forms/sponsor-submissions"
114+ > </ iframe >
318115 </ div >
319116 </ section >
320117 </ Layout >
0 commit comments