diff --git a/src/pages/mentor/apply.gql b/src/pages/mentor/apply.gql deleted file mode 100644 index 1816124..0000000 --- a/src/pages/mentor/apply.gql +++ /dev/null @@ -1,4 +0,0 @@ -#import "../../providers/ProgramDates.gql" -query ApplyQuery { - ...ProgramDates -} diff --git a/src/pages/mentor/apply.js b/src/pages/mentor/apply.js index a09a6a9..e0e3f0d 100644 --- a/src/pages/mentor/apply.js +++ b/src/pages/mentor/apply.js @@ -1,80 +1,14 @@ -import { print } from 'graphql'; -import { apiFetch } from '@codeday/topo/utils'; -import { useState, useEffect } from 'react'; -import { useRouter } from 'next/router'; -import LinkedInTag from 'react-linkedin-insight'; -import Box from '@codeday/topo/Atom/Box'; -import Content from '@codeday/topo/Molecule/Content'; -import Image from '@codeday/topo/Atom/Image'; -import CognitoForm from '@codeday/topo/Molecule/CognitoForm'; -import Text, { Heading } from '@codeday/topo/Atom/Text'; -import { useAnalytics } from '@codeday/topo/utils'; +import { useEffect } from 'react'; import Page from '../../components/Page'; -import { useProgramDates } from '../../providers'; -import { ApplyQuery } from './apply.gql'; -import { DateTime } from 'luxon'; export default function MentorApplyPage () { - const { goal } = useAnalytics(); - const [hasStarted, setHasStarted] = useState(false); - const { query, isReady } = useRouter(); - const { mentorApplicationWarningAt, mentorApplicationEndsAt } = useProgramDates(); - useEffect(() => typeof window !== 'undefined' && LinkedInTag.init('1831116', null, false), typeof window); + useEffect(() => { + if (typeof window === 'undefined') return; + window.location = 'https://www.codeday.org/volunteer/labs/mentor/go?return=labs&returnto=mentor%2Fshare%3Fapplied'; + }, [typeof window]); return ( - - - Sign Up to Mentor - {mentorApplicationEndsAt < DateTime.local() ? ( - <> - The mentor application is now closed. Check back for a future cycle of CodeDay Labs. - - ) : ( - <> - {mentorApplicationWarningAt < DateTime.local() && ( - - CodeDay Labs starts soon! - - It's not too late to become a mentor, but we'll need to complete an onboarding call to discuss your project - quickly. Please keep a close eye on your email after submitting. - - - )} - {isReady && ( - { goal('VA6TNIKN'); setHasStarted(true); }} - onSubmit={() => { - goal('FQKVLN2E'); - LinkedInTag.track('4864865'); - window.location = '/mentor/share?applied'; - }} - /> - )} - - )} - ); }; - -export async function getStaticProps() { - const data = await apiFetch(print(ApplyQuery)); - - return { - props: { - query: data || {}, - random: Math.random(), - }, - revalidate: 240, - }; -} - diff --git a/src/pages/mentor/index.js b/src/pages/mentor/index.js index b0c3390..f4d231d 100644 --- a/src/pages/mentor/index.js +++ b/src/pages/mentor/index.js @@ -31,6 +31,7 @@ export default function Mentor() { const { query } = useRouter(); const f = { day: 'numeric', month: 'long' }; useEffect(() => typeof window !== 'undefined' && LinkedInTag.init('1831116', null, false), typeof window); + const qs = (new URLSearchParams(query || {})).toString() || ''; return ( @@ -79,7 +80,7 @@ export default function Mentor() {