From 1bf35cdc3335a13aba3547e4104a614ef99b7955 Mon Sep 17 00:00:00 2001 From: Kellan Wampler Date: Thu, 14 Jul 2022 14:13:43 -0400 Subject: [PATCH] Fixing error in height calculation with SVG graphics. Adding redirect on form submit to the /contact page. Adding metadata to the /contact page. --- frontend/pages/contact/index.js | 101 +++++++++++------- .../src/components/EngineOverviewDiagram.js | 6 +- frontend/src/components/SVGGraphics/Cloud.js | 6 +- .../src/components/SVGGraphics/Rectangle.js | 6 +- .../src/components/SVGGraphics/RoundedRect.js | 7 +- 5 files changed, 73 insertions(+), 53 deletions(-) diff --git a/frontend/pages/contact/index.js b/frontend/pages/contact/index.js index 462dcd5d..f47cbcf5 100644 --- a/frontend/pages/contact/index.js +++ b/frontend/pages/contact/index.js @@ -1,54 +1,75 @@ -import React from "react"; +import React, { useEffect } from "react"; import { Box, Image, Center, VStack, Text, Spinner } from "@chakra-ui/react"; import { getLayout, getLayoutProps } from "../../src/layouts/WideInfoPage"; import HubspotForm from "react-hubspot-form"; +import { useRouter } from "next/router"; -const Contact = () => ( - - - -
- - - Thanks for your interest in Moonstream. -
- Please answer some questions to help us get acquainted with you. +const Contact = () => { + const router = useRouter(); + const formId = "b54d192f-59b1-410a-8ac1-a1e8383c423c"; + + useEffect(() => { + function handler(event) { + if ( + event.data.type === "hsFormCallback" && + event.data.eventName === "onFormSubmitted" + ) { + if (event.data.id === formId) { + router.push("/"); + } + } + } + + window.addEventListener("message", handler); + return () => { + window.removeEventListener("message", handler); + }; + }); + + return ( + + + +
+ + + Thanks for your interest in Moonstream. +
+ Please answer some questions to help us get acquainted with you. +
+
+
+ } + /> +
+ + + Click the button to submit your answers. We'll reach out + directly within 3 days. You will not receive any marketing emails + from us. + - -
- } - /> -
- - - Click the button to submit your answers. We'll reach out - directly within 3 days. You will not receive any marketing emails - from us. - - -
+
+
- -); + ); +}; Contact.getLayout = getLayout; export async function getStaticProps() { const layoutProps = getLayoutProps(); - // const metaTags = { - // title: "Moonstream: privacy policy", - // description: "Privacy policy and legal information", - // keywords: "moonstream, privacy, policy, legal", - // url: "https://www.moonstream.to/privacy-policy", - // }; - // layoutProps.props.metaTags = { - // ...layoutProps.props.metaTags, - // ...DEFAULT_METATAGS, - // ...metaTags, - // }; + const metaTags = { + title: "Moonstream: Contact form", + description: + "Form requesting contact information to connect with Moonstream", + keywords: "moonstream, contact, web3, game economy, get acquainted", + url: "https://www.moonstream.to/contact", + }; + layoutProps.props.metaTags = { ...layoutProps.props.metaTags, ...metaTags }; return { ...layoutProps }; } diff --git a/frontend/src/components/EngineOverviewDiagram.js b/frontend/src/components/EngineOverviewDiagram.js index 1c455fb3..ad88d8ca 100644 --- a/frontend/src/components/EngineOverviewDiagram.js +++ b/frontend/src/components/EngineOverviewDiagram.js @@ -65,7 +65,7 @@ const _EngineOverviewDiagram = () => { h={["73", "73", "114px"]} position="relative" > - +
{ h={["160px", "160px", "205px"]} position="relative" > - +
{ h={["120px", "120px", "188px"]} position="relative" > - +
{ - scale = scale || 1.0; +const _CloudSVG = (props) => { + const _scale = props.scaling || 1.0; return ( { - scale = scale || 1.0; +const _RectangleSVG = (props) => { + const _scale = props.scaling || 1.0; return ( { - scale = scale || 1.0; - console.log(scale); +const _RoundedRectSVG = (props) => { + const _scale = props.scaling || 1.0; return (