Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Writing cohort banner #10078

Merged
merged 6 commits into from
Apr 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions redirects.json
Original file line number Diff line number Diff line change
Expand Up @@ -334,5 +334,9 @@
{
"fromPath": "/*/staking/withdraws",
"toPath": "/:splat/staking/withdrawals/"
},
{
"fromPath": "/*/writing-cohort",
"toPath": "https://ethereumwriterscohort.carrd.co/"
}
]
28 changes: 28 additions & 0 deletions src/components/Banners/Implementations/WritersCohortBanner.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React from "react"
import { Text } from "@chakra-ui/react"

import DismissableBanner from "../DismissableBanner"
import Link from "../../Link"

interface IProps {
pathname: string
}

const WritersCohortBanner = ({ pathname }) => {
if (pathname.includes("contributing") || pathname.includes("community")) {
return (
<DismissableBanner storageKey="writersCohort">
<Text m={0}>
Join the first-ever ethereum.org Writers Cohort, starting May 11th.{" "}
<Link to="https://ethereumwriterscohort.carrd.co/">
Sign up here!
</Link>
</Text>
</DismissableBanner>
)
}

return null
}

export default WritersCohortBanner
4 changes: 4 additions & 0 deletions src/pages/community.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import PageMetadata from "../components/PageMetadata"
import Translation from "../components/Translation"
import PageHero from "../components/PageHero"
import FeedbackCard from "../components/FeedbackCard"
import WritersCohortBanner from "../components/Banners/Implementations/WritersCohortBanner"

import { getImage } from "../utils/image"

Expand Down Expand Up @@ -141,6 +142,7 @@ interface IGetInvolvedCard {

const CommunityPage = ({
data,
location,
}: PageProps<Queries.CommunityPageQuery, Context>) => {
const { t } = useTranslation()
const theme = useTheme()
Expand Down Expand Up @@ -207,6 +209,8 @@ const CommunityPage = ({
title={t("page-community-meta-title")}
description={t("page-community-meta-description")}
/>
{/* TODO: REMOVE MAY 11 */}
<WritersCohortBanner pathname={location.pathname} />
<PageHero isReverse content={heroContent} />
<Divider />
<Flex
Expand Down
4 changes: 4 additions & 0 deletions src/templates/static.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import PostMergeBanner from "../components/Banners/PostMergeBanner"
import EnergyConsumptionChart from "../components/EnergyConsumptionChart"
import QuizWidget from "../components/Quiz/QuizWidget"
import { Item as ItemTableOfContents } from "../components/TableOfContents/utils"
import WritersCohortBanner from "../components/Banners/Implementations/WritersCohortBanner"

import { getLocaleTimestamp } from "../utils/time"
import { isLangRightToLeft, TranslationKey } from "../utils/translations"
Expand Down Expand Up @@ -211,6 +212,7 @@ const components = {
const StaticPage = ({
data: { siteData, pageData: mdx },
pageContext: { relativePath, slug },
location,
}: PageProps<Queries.StaticPageQuery, Context>) => {
const { language } = useI18next()

Expand Down Expand Up @@ -246,6 +248,8 @@ const StaticPage = ({
translationString={postMergeBannerTranslationString!}
/>
)}
{/* TODO: REMOVE MAY 11 */}
<WritersCohortBanner pathname={location.pathname} />
<Flex
justifyContent="space-between"
w="full"
Expand Down