Skip to content

Commit

Permalink
Add back newsletter form on homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Gilles committed May 1, 2024
1 parent 51d3cd5 commit f25f876
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
11 changes: 11 additions & 0 deletions src/components/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import YoutubeEmbedVideo from "./YoutubeEmbedVideo";
import HoverVideoPlayer from "react-hover-video-player";
import { TestimonialHomeSection } from "./Testimonial";
import PlayImage from "./play.svg";
import SubcribeNewsletter from "./home/SubcribeNewsletter";

import testimonialFr from "./testimonials/testimonial.fr.json";
import testimonialEn from "./testimonials/testimonial.en.json";
Expand Down Expand Up @@ -373,6 +374,11 @@ function Home({ integrations, lang }) {
</div>
</header>
<main>
<div
className={classnames(styles.homeSection, styles.newsletterSection)}
>
<SubcribeNewsletter lang={lang} />
</div>
<div className={classnames(styles.homeSection)}>
<h2 className={styles.secondaryTitle}>
<Translate
Expand Down Expand Up @@ -753,6 +759,11 @@ function Home({ integrations, lang }) {
</div>
</div>
</div>
<div
className={classnames(styles.homeSection, styles.newsletterSection)}
>
<SubcribeNewsletter lang={lang} />
</div>
</main>
</>
);
Expand Down
8 changes: 5 additions & 3 deletions src/components/home/SubcribeNewsletter.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React from "react";

import Translate, { translate } from "@docusaurus/Translate";
import cx from "classnames";
import styles from "../homeStyles.module.css";

function validateEmail(email) {
var re = /[A-Z0-9._%+-]+@[A-Z0-9.-]+.[A-Z]{2,4}/gim;
Expand Down Expand Up @@ -57,11 +59,11 @@ function SubcribeNewsletter({ lang }) {
id="subscribeNewsletter.text"
description="Subscribe newsletter banner text"
>
Emails are sent by Pierre-Gilles Leymarie, founder of the project.
You can unsubscribe at any time 🙂
Emails are sent by Pierre-Gilles Leymarie, founder of the project. You
can unsubscribe at any time 🙂
</Translate>
</div>
<div className="col col--4">
<div className={cx("col col--4", styles.newsletterSectionInputCol)}>
<form>
{status === "failed" && (
<div
Expand Down
11 changes: 11 additions & 0 deletions src/components/homeStyles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -379,3 +379,14 @@ YouTube videos
.homeYouTubeVideoTitle {
margin-top: 8px;
}

.newsletterSection {
background-color: var(--ifm-hero-background-color);
color: var(--ifm-hero-text-color);
}

@media screen and (max-width: 996px) {
.newsletterSectionInputCol {
margin-top: 20px;
}
}

0 comments on commit f25f876

Please sign in to comment.