Skip to content

Commit

Permalink
feat: add new newsletter view (#644)
Browse files Browse the repository at this point in the history
  • Loading branch information
derberg authored Apr 5, 2022
1 parent ccb39c7 commit f719b47
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 17 deletions.
7 changes: 5 additions & 2 deletions components/NewsletterSubscribe.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,20 @@ export default function NewsletterSubscribe ({
}) {
if (!formName) throw new Error('Parameter formName is required for the NewsletterSubscribe component.')

const headTextColor = dark ? 'text-white' : ''
const paragraphTextColor = dark ? 'text-gray-300' : ''

return (
<div className={className}>
<Heading
level="h3"
textColor="text-white"
textColor={headTextColor}
typeStyle="heading-lg"
className="mb-4"
>
{title}
</Heading>
<Paragraph className="mb-8" textColor="text-gray-300">
<Paragraph className="mb-8" textColor={paragraphTextColor}>
We respect your inbox. No spam, promise ✌️
</Paragraph>
<form className="md:flex" data-netlify="true">
Expand Down
1 change: 0 additions & 1 deletion components/layout/BlogLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ export default function BlogLayout({ post, children }) {
</article>
</main>
</Container>
<Footer />
</BlogContext.Provider>
)
}
4 changes: 1 addition & 3 deletions components/layout/DocsLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ function generateEditLink(post) {
}

export default function DocsLayout({ post, navItems = {}, children }) {

if (!post) return <ErrorPage statusCode={404} />
if (post.title === undefined) throw new Error('Post title is required')

Expand All @@ -49,7 +48,7 @@ export default function DocsLayout({ post, navItems = {}, children }) {
<StickyNavbar>
<NavBar className="max-w-screen-xl block px-4 sm:px-6 lg:px-8 mx-auto" />
</StickyNavbar>
<div className="bg-white px-4 sm:px-6 lg:px-8 xl:max-w-7xl xl:mx-auto">
<div className="bg-white px-4 sm:px-6 lg:px-8 w-full xl:max-w-7xl xl:mx-auto">
{ showMenu && (
<DocsMobileMenu onClickClose={() => setShowMenu(false)} post={post} navigation={navigation} />
) }
Expand Down Expand Up @@ -114,7 +113,6 @@ export default function DocsLayout({ post, navItems = {}, children }) {
</div>
</div>
</div>
<Footer/>
</DocsContext.Provider>
)
}
1 change: 0 additions & 1 deletion components/layout/GenericLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export default function GenericLayout({
<AnnouncementHero className="text-center m-4" small={true} />
{children}
</Container>
<Footer />
</>
)
}
1 change: 0 additions & 1 deletion components/layout/GenericPostLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export default function GenericPostLayout({ post, children }) {
</article>
</main>
</Container>
<Footer />
</GenericPostContext.Provider>
)
}
1 change: 0 additions & 1 deletion components/layout/GenericWideLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export default function GenericWideLayout({
<AnnouncementHero className="text-center m-4" small={true} />
{children}
</Row>
<Footer />
</>
)
}
1 change: 0 additions & 1 deletion components/layout/JobsLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ export default function JobsLayout({ post, children }) {
</div>
</main>
</Container>
<Footer />
</JobsContext.Provider>
)
}
14 changes: 10 additions & 4 deletions pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import Banner from '../components/campaigns/Banner'
import Link from 'next/link'
import DocsButton from '../components/buttons/DocsButton';
import AppContext from '../context/AppContext'
import Footer from "../components/Footer";
import '../css/styles.css'

export default function MyApp({ Component, pageProps, router }) {
Expand All @@ -28,11 +29,16 @@ export default function MyApp({ Component, pageProps, router }) {
<Head>
<script async defer src="https://buttons.github.io/buttons.js"></script>
</Head>
<Banner />
<MDXProvider components={getMDXComponents()}>
<Layout>
<Component {...pageProps} />
</Layout>
<div className="flex flex-col min-h-screen">
<Banner />
<Layout>
<Component {...pageProps} />
</Layout>
<div className="mt-auto">
<Footer />
</div>
</div>
</MDXProvider>
</AppContext.Provider>
)
Expand Down
1 change: 0 additions & 1 deletion pages/blog/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ export default function BlogIndexPage() {
</div>
</div>
</div>
<Footer />
</div>
);
}
1 change: 0 additions & 1 deletion pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ function HomePage() {
<Button bgClassName="bg-none border border-gray-200 text-gray-800 hover:text-gray-700 shadow-none" href="/blog" text="View more blog posts" />
</div>
</Container>
<Footer />
</>
)
}
Expand Down
1 change: 0 additions & 1 deletion pages/jobs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ Join us!
</div>
</div>
</div>
<Footer />
</div>
);
}
21 changes: 21 additions & 0 deletions pages/newsletter/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import NavBar from "../../components/navigation/NavBar";
import Head from "../../components/Head";
import Container from '../../components/layout/Container'
import StickyNavbar from "../../components/navigation/StickyNavbar"
import NewsletterSubscribe from '../../components/NewsletterSubscribe'

export default function NewsletterIndexPage() {
return (
<div>
<Head title="Newsletter"/>
<StickyNavbar>
<NavBar className="max-w-screen-xl block px-4 sm:px-6 lg:px-8 mx-auto" />
</StickyNavbar>
<div className="py-12 mt-12">
<Container wide>
<NewsletterSubscribe formName="form 1" />
</Container>
</div>
</div>
);
}

0 comments on commit f719b47

Please sign in to comment.