From 3245fddc61b308051b3093e0a3742ed74c2e9c11 Mon Sep 17 00:00:00 2001
From: Greg Fodor <gfodor@gmail.com>
Date: Mon, 23 Apr 2018 21:10:29 -0700
Subject: [PATCH] Show mailing list signup with ?list_signup=true

---
 src/index.js                      | 13 +++++++++++--
 src/react-components/home-root.js |  4 +++-
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/src/index.js b/src/index.js
index 198ee8d47..1a5788f87 100644
--- a/src/index.js
+++ b/src/index.js
@@ -1,8 +1,17 @@
 import "./assets/stylesheets/index.scss";
 import React from "react";
 import ReactDOM from "react-dom";
-import HomeRoot from "./react-components/home-root";
 import registerTelemetry from "./telemetry";
+import HomeRoot from "./react-components/home-root";
+import InfoDialog from "./react-components/info-dialog.js";
+import queryString from "query-string";
 
+const qs = queryString.parse(location.search);
+
+console.log(qs.list_signup);
 registerTelemetry();
-ReactDOM.render(<HomeRoot />, document.getElementById("home-root"));
+
+ReactDOM.render(
+  <HomeRoot dialogType={qs.list_signup ? InfoDialog.dialogTypes.updates : null} />,
+  document.getElementById("home-root")
+);
diff --git a/src/react-components/home-root.js b/src/react-components/home-root.js
index f930eaea7..6e780474b 100644
--- a/src/react-components/home-root.js
+++ b/src/react-components/home-root.js
@@ -27,7 +27,8 @@ const ENVIRONMENT_URLS = [
 
 class HomeRoot extends Component {
   static propTypes = {
-    intl: PropTypes.object
+    intl: PropTypes.object,
+    dialogType: PropTypes.symbol
   };
 
   state = {
@@ -39,6 +40,7 @@ class HomeRoot extends Component {
 
   componentDidMount() {
     this.loadEnvironments();
+    this.setState({ dialogType: this.props.dialogType });
     document.querySelector("#background-video").playbackRate = 0.75;
   }
 
-- 
GitLab