File tree 7 files changed +27
-13
lines changed
7 files changed +27
-13
lines changed Original file line number Diff line number Diff line change 1
1
import Head from '@docusaurus/Head' ;
2
- import React , { useLayoutEffect } from 'react' ;
2
+ import React from 'react' ;
3
3
import useForm from '../hooks/useForm' ;
4
4
import useMunchkin from '../hooks/useMunchkin' ;
5
5
import useSqueeze from '../hooks/useSqueeze' ;
6
6
7
- export default function LandingPageWrapper ( { thankYou, children } ) {
7
+ export interface LandingPageWrapperProps {
8
+ thankYou : string ;
9
+ }
10
+
11
+ export default function LandingPageWrapper ( {
12
+ thankYou,
13
+ children,
14
+ } : React . PropsWithChildren < LandingPageWrapperProps > ) {
8
15
useSqueeze ( ) ;
9
16
useForm ( thankYou ) ;
10
17
useMunchkin ( ) ;
Original file line number Diff line number Diff line change
1
+ /* eslint-disable @typescript-eslint/no-unsafe-call, @typescript-eslint/no-misused-promises */
1
2
import { useLayoutEffect } from 'react' ;
2
3
3
- export default function useForm ( thankYou ) {
4
+ declare const MktoForms2 : any ;
5
+
6
+ export default function useForm ( thankYou : string ) {
4
7
useLayoutEffect ( ( ) => {
5
8
const interval = setInterval ( ( ) => {
6
9
if ( typeof MktoForms2 === 'undefined' ) {
@@ -11,7 +14,8 @@ export default function useForm(thankYou) {
11
14
document . querySelectorAll ( '.m-form' ) . forEach ( async ( el ) => {
12
15
const id = el . id . split ( '_' ) [ 1 ] ;
13
16
MktoForms2 . setOptions ( {
14
- formXDPath : 'https://lp.redis.com/rs/915-NFD-128/images/marketo-xdframe-relative.html' ,
17
+ formXDPath :
18
+ 'https://lp.redis.com/rs/915-NFD-128/images/marketo-xdframe-relative.html' ,
15
19
} ) ;
16
20
17
21
let prefills = { } ;
@@ -34,18 +38,17 @@ export default function useForm(thankYou) {
34
38
'//lp.redis.com' ,
35
39
'915-NFD-128' ,
36
40
Number ( id ) ,
37
- ( form ) => {
41
+ ( form : any ) => {
38
42
if ( Object . keys ( prefills ) . length > 0 ) {
39
43
form . vals ( prefills ) ;
40
44
}
41
45
42
46
if ( ! thankYou ) {
43
- return ;
47
+ return ;
44
48
}
45
49
46
50
form . onSuccess ( ( ) => {
47
- form . getFormElem ( ) . hide ( ) ;
48
-
51
+ form . getFormElem ( ) . hide ( ) ;
49
52
} ) ;
50
53
} ,
51
54
) ;
Original file line number Diff line number Diff line change
1
+ /* eslint-disable @typescript-eslint/no-unsafe-call, @typescript-eslint/ban-ts-comment */
1
2
import { useLayoutEffect } from 'react' ;
2
3
4
+ declare const Munchkin : any ;
5
+
3
6
export default function useMunchkin ( ) {
4
7
useLayoutEffect ( ( ) => {
5
- var didInit = false ;
8
+ let didInit = false ;
6
9
function initMunchkin ( ) {
7
10
if ( didInit === false ) {
8
11
didInit = true ;
9
12
Munchkin . init ( '915-NFD-128' ) ;
10
13
}
11
14
}
12
- var s = document . createElement ( 'script' ) ;
15
+ const s = document . createElement ( 'script' ) ;
13
16
s . type = 'text/javascript' ;
14
17
s . async = true ;
15
18
s . src = '//munchkin.marketo.net/munchkin.js' ;
19
+ // @ts -ignore
16
20
s . onreadystatechange = function ( ) {
21
+ // @ts -ignore
17
22
if ( this . readyState == 'complete' || this . readyState == 'loaded' ) {
18
23
initMunchkin ( ) ;
19
24
}
File renamed without changes.
Original file line number Diff line number Diff line change 1
- import React , { useLayoutEffect } from 'react' ;
1
+ import React from 'react' ;
2
2
import Layout from '@theme/Layout' ;
3
3
import LandingPageWrapper from '../../components/LandingPageWrapper' ;
4
4
@@ -17,7 +17,7 @@ export default function LearnToEarnJWT() {
17
17
style = { {
18
18
width : '70%' ,
19
19
minWidth : '370px' ,
20
- margin : 'auto'
20
+ margin : 'auto' ,
21
21
} } >
22
22
< p >
23
23
Complete this short assessment for a chance to earn a $25 Amazon
Original file line number Diff line number Diff line change @@ -14,7 +14,6 @@ function Launchpad() {
14
14
target = "_blank"
15
15
rel = "noopener"
16
16
className = "link" >
17
-
18
17
< img
19
18
src = "/img/launchpad.png"
20
19
className = "thumb"
You can’t perform that action at this time.
0 commit comments