From c1750fc6b9b48586b989d55ba5b57e8a91463d31 Mon Sep 17 00:00:00 2001 From: "rich.jdev00" Date: Wed, 11 Dec 2024 04:48:10 +0400 Subject: [PATCH 1/5] Add newsletter topics --- src/components/SectionHero.js | 11 +- src/components/SectionSignUp.js | 163 ++++++++++++++++++++++------ src/sass/mailerlite-newsletter.scss | 17 +-- studio/schemas/index.js | 2 + studio/schemas/newsletter_topic.js | 46 ++++++++ studio/schemas/section_sign_up.js | 12 ++ 6 files changed, 208 insertions(+), 43 deletions(-) create mode 100644 studio/schemas/newsletter_topic.js diff --git a/src/components/SectionHero.js b/src/components/SectionHero.js index c2233f6..9463af5 100644 --- a/src/components/SectionHero.js +++ b/src/components/SectionHero.js @@ -71,12 +71,12 @@ function SectionHero(props) { ({ + header: { + fontFamily: "'Libre Baskerville', serif!important", + fontSize: "32px!important", + }, + grid: { + marginTop: "110px", + display: "grid", + gridGap: "20px", + gridTemplateColumns: "1fr 1fr", + marginRight: "-20px", + marginLeft: "-20px", + }, + gridTopic: { + border: "1px solid #DCDCDC", + padding: "20px", + fontFamily: "Lexend", + fontSize: "16px", + fontWeight: "300", + textAlign: "left", + display: "flex", + flexDirection: "column", + justifyContent: "space-between", + height: "325px", + }, +})); + +//Libre Baskerville export default function SectionSignUp(props) { + const classes = useStyles(); let section = _.get(props, "section", null); + console.log(section); + return (
@@ -18,15 +51,33 @@ export default function SectionSignUp(props) {
-

+

Join our newsletter on issues and ideas at the intersection of tech & democracy.

-

+

Tech Policy Press is a startup nonprofit media & community venture that will provoke debate and discussion at the intersection of technology and democracy.

+

+ We compile all the top stories from our website into a + newsletter format for you to receive directly to your email. + Please check out the preview newsletters within each topic + below and consider subscribing if you enjoy the content. +

-
-
-
- +
+
+
+
+ +
+ +
+ + +
+
- -
- - -
- + {section.topics && ( +
+ {section.topics.map((topic) => { + return ( + + ); + })} +
+ )}
Rule.required(), + }, + { + title: 'Description', + type: 'string', + name: 'description', + description: 'The topic description.', + validation: (Rule) => Rule.required(), + }, + { + title: 'Frequency', + type: 'string', + name: 'type', + options: { + list: [ + {title: 'Weekly', value: 'weekly'}, + {title: 'Monthly', value: 'monthly'}, + {title: 'Quarterly', value: 'quarterly'}, + ], + }, + }, + { + title: 'MailerLite ID', + type: 'string', + name: 'mailerlite_id', + description: 'ID of the topic in MailerLite.', + validation: (Rule) => Rule.required(), + }, + ], + preview: { + select: { + title: "name" + } + } + }; + \ No newline at end of file diff --git a/studio/schemas/section_sign_up.js b/studio/schemas/section_sign_up.js index 1f9184f..2a9d31c 100644 --- a/studio/schemas/section_sign_up.js +++ b/studio/schemas/section_sign_up.js @@ -11,6 +11,18 @@ export default { 'A unique identifier that can be used when linking to this section, if any. Must not contain whitespace.', validation: null, }, + { + type: 'array', + name: 'topics', + title: 'Topics', + description: 'Newsletter topics', + validation: null, + of: [ + { + type: 'newsletter_topic', + }, + ], + }, { type: "string", name: "type", From 88efa456298699afc2e8230fbff0645545f6d124 Mon Sep 17 00:00:00 2001 From: "rich.jdev00" Date: Sat, 25 Jan 2025 01:53:23 +0400 Subject: [PATCH 2/5] Support temporary newsletter page --- src/components/SectionHero.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/SectionHero.js b/src/components/SectionHero.js index 9463af5..a0f66a7 100644 --- a/src/components/SectionHero.js +++ b/src/components/SectionHero.js @@ -72,11 +72,12 @@ function SectionHero(props) { style={{ backgroundColor: page.stackbit_model_type == "data" || - page.stackbit_url_path == "/newsletter" + page.stackbit_url_path == "/newsletter-new" ? "#FFF" : page.layout == "policy_action" || page._type == "author" || - page.stackbit_url_path == "/contributors" + page.stackbit_url_path == "/contributors" || + page.stackbit_url_path == "/newsletter" ? theme.palette["secondary"].main : page.stackbit_url_path == "/donate" || page.stackbit_url_path == "/donate_new" @@ -101,9 +102,10 @@ function SectionHero(props) { ? "#ECF0F0" : page.layout == "policy_action" || page._type == "author" || - page.stackbit_url_path == "/contributors" + page.stackbit_url_path == "/contributors" || + page.stackbit_url_path == "/newsletter" ? "#3C6E63" - : page.stackbit_url_path == "/newsletter" + : page.stackbit_url_path == "/newsletter-new" ? "#559482" : page.stackbit_url_path == "/donate" || page.stackbit_url_path == "/donate_new" From ce34356bd554b3283e538103e0875f3b1ae07645 Mon Sep 17 00:00:00 2001 From: "rich.jdev00" Date: Sat, 25 Jan 2025 01:53:44 +0400 Subject: [PATCH 3/5] Update newsletter ids --- src/components/SectionSignUp.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/SectionSignUp.js b/src/components/SectionSignUp.js index da4a3b8..b9cdc14 100644 --- a/src/components/SectionSignUp.js +++ b/src/components/SectionSignUp.js @@ -81,8 +81,8 @@ export default function SectionSignUp(props) {
@@ -125,6 +125,7 @@ export default function SectionSignUp(props) {
+
{section.topics && (
From 12e5b3b93d3a136e917abbe69e05c6db57977478 Mon Sep 17 00:00:00 2001 From: "rich.jdev00" Date: Sun, 26 Jan 2025 01:08:37 +0400 Subject: [PATCH 4/5] Update new newsletter page header --- src/components/SectionHero.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/components/SectionHero.js b/src/components/SectionHero.js index a0f66a7..6a631df 100644 --- a/src/components/SectionHero.js +++ b/src/components/SectionHero.js @@ -71,13 +71,13 @@ function SectionHero(props) { Date: Sat, 1 Feb 2025 01:07:29 +0400 Subject: [PATCH 5/5] Update signup form styles --- src/components/SectionSignUp.js | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/components/SectionSignUp.js b/src/components/SectionSignUp.js index b9cdc14..08aa872 100644 --- a/src/components/SectionSignUp.js +++ b/src/components/SectionSignUp.js @@ -5,7 +5,7 @@ import _ from "lodash"; import Box from "@mui/material/Box"; import { makeStyles } from "@mui/styles"; -const useStyles = makeStyles(() => ({ +const useStyles = makeStyles((theme) => ({ header: { fontFamily: "'Libre Baskerville', serif!important", fontSize: "32px!important", @@ -15,6 +15,9 @@ const useStyles = makeStyles(() => ({ display: "grid", gridGap: "20px", gridTemplateColumns: "1fr 1fr", + [theme.breakpoints.down("sm")]: { + gridTemplateColumns: "1fr", + }, marginRight: "-20px", marginLeft: "-20px", }, @@ -30,6 +33,16 @@ const useStyles = makeStyles(() => ({ justifyContent: "space-between", height: "325px", }, + formContainer: { + display: "flex", + gap: "32px", + justifyContent: "center", + [theme.breakpoints.down("sm")]: { + marginRight: "-16px", + marginLeft: "-16px", + gap: "16px", + }, + }, })); //Libre Baskerville @@ -86,13 +99,7 @@ export default function SectionSignUp(props) { method="post" target="_blank" > -
+