File tree Expand file tree Collapse file tree 7 files changed +27
-13
lines changed
Expand file tree Collapse file tree 7 files changed +27
-13
lines changed Original file line number Diff line number Diff line change 11import Head from '@docusaurus/Head' ;
2- import React , { useLayoutEffect } from 'react' ;
2+ import React from 'react' ;
33import useForm from '../hooks/useForm' ;
44import useMunchkin from '../hooks/useMunchkin' ;
55import useSqueeze from '../hooks/useSqueeze' ;
66
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 > ) {
815 useSqueeze ( ) ;
916 useForm ( thankYou ) ;
1017 useMunchkin ( ) ;
Original file line number Diff line number Diff line change 1+ /* eslint-disable @typescript-eslint/no-unsafe-call, @typescript-eslint/no-misused-promises */
12import { useLayoutEffect } from 'react' ;
23
3- export default function useForm ( thankYou ) {
4+ declare const MktoForms2 : any ;
5+
6+ export default function useForm ( thankYou : string ) {
47 useLayoutEffect ( ( ) => {
58 const interval = setInterval ( ( ) => {
69 if ( typeof MktoForms2 === 'undefined' ) {
@@ -11,7 +14,8 @@ export default function useForm(thankYou) {
1114 document . querySelectorAll ( '.m-form' ) . forEach ( async ( el ) => {
1215 const id = el . id . split ( '_' ) [ 1 ] ;
1316 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' ,
1519 } ) ;
1620
1721 let prefills = { } ;
@@ -34,18 +38,17 @@ export default function useForm(thankYou) {
3438 '//lp.redis.com' ,
3539 '915-NFD-128' ,
3640 Number ( id ) ,
37- ( form ) => {
41+ ( form : any ) => {
3842 if ( Object . keys ( prefills ) . length > 0 ) {
3943 form . vals ( prefills ) ;
4044 }
4145
4246 if ( ! thankYou ) {
43- return ;
47+ return ;
4448 }
4549
4650 form . onSuccess ( ( ) => {
47- form . getFormElem ( ) . hide ( ) ;
48-
51+ form . getFormElem ( ) . hide ( ) ;
4952 } ) ;
5053 } ,
5154 ) ;
Original file line number Diff line number Diff line change 1+ /* eslint-disable @typescript-eslint/no-unsafe-call, @typescript-eslint/ban-ts-comment */
12import { useLayoutEffect } from 'react' ;
23
4+ declare const Munchkin : any ;
5+
36export default function useMunchkin ( ) {
47 useLayoutEffect ( ( ) => {
5- var didInit = false ;
8+ let didInit = false ;
69 function initMunchkin ( ) {
710 if ( didInit === false ) {
811 didInit = true ;
912 Munchkin . init ( '915-NFD-128' ) ;
1013 }
1114 }
12- var s = document . createElement ( 'script' ) ;
15+ const s = document . createElement ( 'script' ) ;
1316 s . type = 'text/javascript' ;
1417 s . async = true ;
1518 s . src = '//munchkin.marketo.net/munchkin.js' ;
19+ // @ts -ignore
1620 s . onreadystatechange = function ( ) {
21+ // @ts -ignore
1722 if ( this . readyState == 'complete' || this . readyState == 'loaded' ) {
1823 initMunchkin ( ) ;
1924 }
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' ;
22import Layout from '@theme/Layout' ;
33import LandingPageWrapper from '../../components/LandingPageWrapper' ;
44
@@ -17,7 +17,7 @@ export default function LearnToEarnJWT() {
1717 style = { {
1818 width : '70%' ,
1919 minWidth : '370px' ,
20- margin : 'auto'
20+ margin : 'auto' ,
2121 } } >
2222 < p >
2323 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() {
1414 target = "_blank"
1515 rel = "noopener"
1616 className = "link" >
17-
1817 < img
1918 src = "/img/launchpad.png"
2019 className = "thumb"
You can’t perform that action at this time.
0 commit comments