Skip to content

Commit

Permalink
fix: display demo form modal on mobile (datahub-project#11581)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoonhyejin authored Oct 11, 2024
1 parent f43720e commit 43c185d
Show file tree
Hide file tree
Showing 7 changed files with 135 additions and 29 deletions.
4 changes: 1 addition & 3 deletions docs-website/src/pages/cloud/DemoForm/styles.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@
.bookButton {
display: block;
}
.formContainer {
display: none;
}

.productTourButton {
text-align: center!important;
}
Expand Down
17 changes: 17 additions & 0 deletions docs-website/src/pages/cloud/DemoFormModal/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React, { useEffect } from 'react';
import styles from "./styles.module.scss";
import DemoForm from '../DemoForm';

const DemoFormModal = ({ formId, handleCloseModal }) => {

return (
<div className={styles.modal}>
<div className={styles.modalContent}>
<button className={styles.closeButton} onClick={handleCloseModal}></button>
<DemoForm formId={formId} />
</div>
</div>
);
};

export default DemoFormModal;
45 changes: 45 additions & 0 deletions docs-website/src/pages/cloud/DemoFormModal/styles.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@

.modal {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5); /* Modal background */
display: flex;
justify-content: center;
align-items: center;
z-index: 1000;
overflow-y: scroll;

.modalContent {
width: 90%;
max-width: 540px;
background: #fff;
border-radius: 16px;
position: relative;
box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.1);
animation: modalShow 0.3s ease-in-out;

.closeButton {
position: absolute;
top: 1rem;
right: 1rem;
background: none;
border: none;
font-size: 1.5rem;
cursor: pointer;
}
}
}

@keyframes modalShow {
from {
opacity: 0;
transform: translateY(-20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
48 changes: 33 additions & 15 deletions docs-website/src/pages/cloud/Hero/index.js
Original file line number Diff line number Diff line change
@@ -1,38 +1,56 @@
import React, { useEffect } from 'react';
import React, { useState } from 'react';
import clsx from "clsx";
import Link from "@docusaurus/Link";
import styles from "./styles.module.scss";
import ScrollingCustomers from '../CompanyLogos';
import DemoForm from '../DemoForm';
import DemoFormModal from '../DemoFormModal';

const Hero = () => {
const [isModalOpen, setIsModalOpen] = useState(false);

const handleOpenModal = () => setIsModalOpen(true);
const handleCloseModal = () => setIsModalOpen(false);

return (
<header className={clsx("hero", styles.hero)}>
<div className="container">
<div className="hero__content">
<div className="row row__padded">
<div className={clsx(styles.hero__cta, styles.col, "col col--7")}>
<h1 className={clsx("hero__title", styles.hero__title)}>DataHub Cloud</h1>
<div className={clsx("hero__subtitle", styles.hero__subtitle)}>
<h1 className={clsx("hero__title", styles.hero__title)}>DataHub Cloud</h1>
<div className={clsx("hero__subtitle", styles.hero__subtitle)}>
Experience the premium version of DataHub
<div style={{ fontWeight: "500" }}>
with Observability and Governance built-in.
</div>
<div style={{ fontWeight: "500" }}>
with Observability and Governance built-in.
</div>
<Link className={clsx(styles.button, styles.bookButton, "button button--primary button--lg")} to="https://www.acryldata.io/datahub-sign-up?utm_source=datahub&utm_medium=referral&utm_campaign=acryl_signup">
Book Demo
</Link>
<Link className={clsx(styles.button, styles.productTourButton, "button button--secondary button--lg")} to="https://www.acryldata.io/tour">
Live Product Tour →
</Link>
<ScrollingCustomers />
</div>

<button
className={clsx(styles.button, styles.bookButton, "button button--primary button--lg")}
onClick={handleOpenModal}
>
Book Demo
</button>

<Link
className={clsx(styles.button, styles.productTourButton, "button button--secondary button--lg")}
to="https://www.acryldata.io/tour"
>
Live Product Tour →
</Link>
<ScrollingCustomers />
</div>
<div className={clsx(styles.col, "col col--5")}>
<DemoForm formId="heroForm" />
<div className={clsx(styles.col, styles.hideOnMobile, "col col--5")}>
<DemoForm formId="heroForm" />
</div>
</div>
</div>
</div>

{isModalOpen && (
<DemoFormModal formId="heroFormMobile" handleCloseModal={handleCloseModal} />
)}
</header>
);
};
Expand Down
6 changes: 5 additions & 1 deletion docs-website/src/pages/cloud/Hero/styles.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,15 @@
.productTourButton {
text-align: center!important;
}

.hideOnMobile{
display: none;
}
}

@media screen and (min-width: 1000px){
.productTourButton {
padding-left: 0!important;
margin-left: 0!important;
}
}
}
31 changes: 22 additions & 9 deletions docs-website/src/pages/cloud/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react";
import React, { useState } from "react";
import Layout from "@theme/Layout";
import Link from "@docusaurus/Link";
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
Expand All @@ -10,11 +10,16 @@ import UnifiedTabs from "./UnifiedTabs";
import FeatureCards from "./FeatureCards";
import Hero from "./Hero";
import DemoForm from "./DemoForm";
import DemoFormModal from "./DemoFormModal";

function Home() {
const context = useDocusaurusContext();
const { siteConfig = {} } = context;

const [isModalOpen, setIsModalOpen] = useState(false);

const handleOpenModal = () => setIsModalOpen(true);
const handleCloseModal = () => setIsModalOpen(false);
if (siteConfig.customFields.isSaas) {
window.location.replace("/docs");
}
Expand All @@ -28,7 +33,7 @@ function Home() {
<div className={clsx(styles.bgSection)}>
<UnifiedTabs />
</div>
<FeatureCards/>
<FeatureCards />
<div className={clsx(styles.bgSection)}>
<Section>
<Enterprise />
Expand All @@ -41,25 +46,33 @@ function Home() {
<div className={clsx("hero", styles.hero)}>
<div className="container" style={{ paddingTop: '12vh', paddingBottom: '12vh' }}>
<div className="row row__padded">
<div className={clsx(styles.col, styles.hero__cta, "col col--7")}>
<h1 className={styles.hero__title}>Start your free trial<br/>today.</h1>
<div className={clsx(styles.hero__subtitle)}>Unify Discovery, Observability and Governance<br/>for data and AI.</div>
<div className={clsx(styles.col, styles.hero__cta, "col col--7")}>
<h1 className={styles.hero__title}>Start your free trial<br />today.</h1>
<div className={clsx(styles.hero__subtitle)}>
Unify Discovery, Observability and Governance<br />for data and AI.
</div>
<div>
<Link className={clsx(styles.button, styles.bookButton, "button button--primary button--lg")} to="https://www.acryldata.io/datahub-sign-up?utm_source=datahub&utm_medium=referral&utm_campaign=acryl_signup">
<button
className={clsx(styles.button, styles.bookButton, "button button--primary button--lg")}
onClick={handleOpenModal}
>
Book Demo
</Link>
</button>
<Link className={clsx(styles.button, styles.productTourButton, "button button--secondary button--lg")} to="https://www.acryldata.io/tour">
Live Product Tour →
</Link>
</div>
<div className="hero__subtitle" />
</div>
<div className={clsx(styles.col, "col col--5")}>
<DemoForm formId="footerForm"/>
<div className={clsx(styles.col, "col col--5", styles.hideOnMobile)}>
<DemoForm formId="footerForm" />
</div>
</div>
</div>
</div>
{isModalOpen && (
<DemoFormModal formId="footerFormMobile" handleCloseModal={handleCloseModal} />
)}
</Layout>
) : null;
}
Expand Down
13 changes: 12 additions & 1 deletion docs-website/src/pages/cloud/styles.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,27 @@
@media screen and (max-width: 999px) {
.bookButton, .productTourButton {
display: block;
width: 100%;
}

.productTourButton {
text-align: center!important;
}


.hideOnMobile {
display: none;
}

.formContainer {
display: none;
}

}

@media screen and (min-width: 1000px){
.productTourButton {
padding-left: 0!important;
margin-left: 0!important;
}
}
}

0 comments on commit 43c185d

Please sign in to comment.