{"version":3,"sources":["webpack:///./src/pages/academy.js"],"names":["AcademyPage","render","metaData","get","this","props","allModule","allAudience","HeroSection","AudienceSection","data","ModuleSection","FormSection","React","Component","className","to","src","alt","width","height","map","index","node","key","fontAwesomeIcon","title","description","childMarkdownRemark","rawMarkdownBody","icon","file","url","state","messageSent","contactSchema","Yup","shape","name","min","max","required","matches","email","companyName","phoneNumber","positive","id","initialValues","cc","validationSchema","onSubmit","values","resetForm","axios","method","then","response","statusCode","setState","prevState","catch","error","console","log","errors","touched","type","pageQuery"],"mappings":"0SAWMA,E,0FAEFC,OAAA,WACI,IAAMC,EAAWC,IAAIC,KAAKC,MAAO,sCAC3BC,EAAYH,IAAIC,KAAKC,MAAO,kCAC5BE,EAAcJ,IAAIC,KAAKC,MAAO,2CACpC,OACI,6BACI,kBAAC,IAAD,CAAUH,SAAUA,IACpB,kBAACM,EAAD,MACA,kBAACC,EAAD,CAAiBC,KAAMH,IACvB,kBAACI,EAAD,CAAeD,KAAMJ,IACrB,kBAACM,EAAD,MACA,kBAAC,IAAD,Q,GAbUC,IAAMC,WAqB1BN,E,0FAEFP,OAAA,WAEI,OACI,6BAASc,UAAU,2CACf,yBAAKA,UAAU,aACX,yBAAKA,UAAU,yBACX,yBAAKA,UAAU,aACX,yBAAKA,UAAU,gBACX,kBAAC,IAAD,CAAMC,GAAK,YACP,yBAAKC,IAAI,wBAAwBC,IAAI,eAAeC,MAAM,KAAKC,OAAO,YAM1F,yBAAKL,UAAU,aACX,yBAAKA,UAAU,aACX,yBAAKA,UAAU,wBACX,yBAAKA,UAAU,kBACX,wBAAIA,UAAU,2GAlBxB,4DAsBU,yBAAKA,UAAU,2CACX,kBAAC,IAAD,CAAMC,GAAK,gBAAgBD,UAAU,6CAArC,+B,GA1BVF,IAAMC,WAuC1BL,E,0FAEFR,OAAA,WAEI,IACOS,EAAQN,KAAKC,MAAbK,KACP,OACI,6BAASK,UAAU,oBACf,yBAAKA,UAAU,aACX,wBAAIA,UAAU,2FALZ,4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L,SAK3N,yBAAKA,UAAU,SACX,2BAAOA,UAAU,mBAAjB,SAGA,uBAAGA,UAAU,sCACT,kBAAC,IAAD,CAAOA,UAAU,kBAAkBuB,KAAK,SACxC,0BAAMvB,UAAU,yBACZ,uBAAGA,UAAU,kBAGpBkD,EAAO3B,MAAQ4B,EAAQ5B,KAAQ,uBAAGvB,UAAU,kBAAkBkD,EAAO3B,MAAa,MAEvF,yBAAKvB,UAAU,SACX,2BAAOA,UAAU,mBAAjB,UAGA,uBAAGA,UAAU,sCACT,kBAAC,IAAD,CAAOA,UAAU,kBAAkBuB,KAAK,QAAQ6B,KAAK,UACrD,0BAAMpD,UAAU,yBACZ,uBAAGA,UAAU,sBAGpBkD,EAAOtB,OAASuB,EAAQvB,MAAS,uBAAG5B,UAAU,kBAAkBkD,EAAOtB,OAAc,MAE1F,yBAAK5B,UAAU,SACX,2BAAOA,UAAU,mBAAjB,YAGA,uBAAGA,UAAU,sCACT,kBAAC,IAAD,CAAOA,UAAU,kBAAkBuB,KAAK,gBACxC,0BAAMvB,UAAU,yBACZ,uBAAGA,UAAU,sBAGpBkD,EAAOrB,aAAesB,EAAQtB,YAAe,uBAAG7B,UAAU,kBAAkBkD,EAAOrB,aAAoB,MAE5G,yBAAK7B,UAAU,SACX,2BAAOA,UAAU,mBAAjB,UAGA,uBAAGA,UAAU,sCACT,kBAAC,IAAD,CAAOA,UAAU,kBAAkBuB,KAAK,gBACxC,0BAAMvB,UAAU,yBACZ,uBAAGA,UAAU,0BAGpBkD,EAAOpB,aAAeqB,EAAQrB,YAAe,uBAAG9B,UAAU,kBAAb,6BAA+D,MAEjH,yBAAKA,UAAU,SACX,yBAAKA,UAAU,6BACX,4BAAQA,UAAU,6BAA6BoD,KAAK,UAApD,qC,GArI9BtD,IAAMC,WAsJjBd,YAER,IAAMoE,EAAS","file":"component---src-pages-academy-js-2326d1efa9e761c194b0.js","sourcesContent":["import React from 'react'\nimport { graphql, Link } from 'gatsby'\nimport get from 'lodash/get'\nimport { Formik, Form, Field} from 'formik'\nimport * as Yup from 'yup'\nimport axios from 'axios'\nimport SiteMeta from '../components/meta-data'\nimport Footer from '../components/footer'\n\n\n\nclass AcademyPage extends React.Component {\n \n render() {\n const metaData = get(this.props, 'data.site.siteMetadata.academyPage')\n const allModule = get(this.props, 'data.allContentfulModule.edges')\n const allAudience = get(this.props, 'data.allContentfulAcademyAudience.edges')\n return(\n
\n \n \n \n \n \n
\n )\n }\n\n}\n\n\nclass HeroSection extends React.Component {\n\n render() {\n const title = \"Data driven digital marketing academy for Chinese market\"\n return(\n
\n
\n \n
\n
\n
\n
\n
\n

\n {title}\n

\n
\n \n Request for interest \n \n
\n
\n
\n
\n
\n
\n )\n }\n}\n\nclass AudienceSection extends React.Component {\n \n render() {\n \n const title = \"who is this academy for?\"\n const {data} = this.props\n return(\n
\n
\n

\n {title}\n

\n
\n
\n {\n data.map(({node}, index) => {\n return(\n
\n
\n \n \n \n \n

{node.title}

\n

{node.description.childMarkdownRemark.rawMarkdownBody}

\n
\n
\n )\n })\n }\n\n
\n
\n
\n )\n }\n}\n\nclass ModuleSection extends React.Component {\n \n render(){\n\n const title = \"What does the academy include?\"\n const {data} = this.props\n return(\n
\n
\n

\n {title}\n

\n
\n
\n {\n data.map(({node}, index)=>{\n return(\n
\n
\n
\n
\n {`${node.title}`}/\n
\n
\n
\n
\n

{node.title}

\n

{node.description.childMarkdownRemark.rawMarkdownBody}

\n
\n
\n
\n
\n )\n })\n }\n
\n
\n
\n )\n }\n}\n\nclass FormSection extends React.Component {\n\n constructor(props) {\n\t\tsuper(props)\n\t\tthis.state = {\n\t\t\tmessageSent: false\n\t\t}\n\t\tthis.contactSchema = Yup.object().shape({\n\t\t\tname: Yup.string().min(2, 'Too Short!').max(50, 'Too Long!').required('Required').matches(/[^0-9]/,'Numbers in the name?'),\n\t\t\temail: Yup.string().email('invalid email').required('Required!'),\n\t\t\tcompanyName: Yup.string().min(2, 'Too short!').required('Required!'),\n\t\t\tphoneNumber: Yup.number().required('Required').positive()\n\t\t})\n\t}\n\n render(){\n\n const title = \"get your training brochure\"\n return(\n
\n
\n

\n {title}\n

\n
\n
\n
\n
\n \"red\n
\n
\n
\n {\n // same shape as initial values\n axios({\n method: 'post',\n url:'https://8dbp32h7ge.execute-api.eu-west-1.amazonaws.com/dev/?format=json',\n data: `_to=${values[\"to\"]}&_cc=${values[\"cc\"]}&_replyTo=${values[\"email\"]}&title=${values[\"title\"]}&name=${values[\"name\"]}&email=${values[\"email\"]}&company=${values[\"companyName\"]}&phone=${values[\"phoneNumber\"]}`,\n }).then((response) => {\n if (response.data.statusCode==200) {\n this.setState(prevState => ({\n messageSent: !prevState.messageSent\n }))\n }\n resetForm({\n to:'sarahyam%40reddigitalchina.com',\n cc:'sunqqxp%40gmail.com',\n title:'Training Brouchure Request',\n name:'',\n email:'',\n companyName:'',\n phoneNumber:'',\n })\n }).catch((error) => {\n console.log(error)\n })\n }}\n >\n {({errors, touched}) => (\n
\n
\n
\n
\n
\n
\n
\n {this.state.messageSent ? (

Thank you for requesting training brouchure from Red Digtial Academy, our training advisor will contact you via email or phone within 1-2 days.

) : null}\n
\n
\n
\n
\n
\n \n

\n \n \n \n \n

\n {errors.name && touched.name ? (

{errors.name}

) : null} \n
\n
\n \n

\n \n \n \n \n

\n {errors.email && touched.email ? (

{errors.email}

) : null}\n
\n
\n \n

\n \n \n \n \n

\n {errors.companyName && touched.companyName ? (

{errors.companyName}

) : null} \n
\n
\n \n

\n \n \n \n \n

\n {errors.phoneNumber && touched.phoneNumber ? (

Wrong phone number format

) : null}\n
\n
\n
\n \n
\n
\n
\n
\n
\n )}\t\n
\n
\n
\n
\n
\n )\n }\n}\n\n\nexport default AcademyPage\n\nexport const pageQuery = graphql`\n query AcademyPage {\n site {\n siteMetadata {\n academyPage {\n title\n description\n imageUrl\n siteUrl\n }\n }\n } \n allContentfulAcademyAudience(filter: {node_locale: {eq: \"en-GB\"}}, sort: {fields: order}) {\n edges {\n node {\n order\n title\n fontAwesomeIcon\n description {\n childMarkdownRemark {\n rawMarkdownBody\n }\n }\n }\n }\n }\n allContentfulModule(filter: {node_locale: {eq: \"en-GB\"}}, sort: {fields: order}) {\n edges {\n node {\n order\n title\n icon {\n file {\n url\n }\n }\n description {\n childMarkdownRemark {\n rawMarkdownBody\n }\n }\n }\n }\n } \n }\n`"],"sourceRoot":""}