Skip to content

Commit 3b4a22a

Browse files
authored
Merge pull request #11368 from ethereum/writingcohortbug
writing cohort banner on homepage
2 parents 3de8933 + de0fe10 commit 3b4a22a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/components/Banners/Implementations/WritersCohortBanner.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,20 @@ import { Text } from "@chakra-ui/react"
44
import DismissableBanner from "../DismissableBanner"
55
import Link from "../../Link"
66

7+
import { supportedLanguages } from "../../../utils/languages"
8+
79
interface IProps {
810
pathname: string
911
}
1012

1113
const WritersCohortBanner: React.FC<IProps> = ({ pathname }) => {
14+
const pattern = supportedLanguages.join("|")
15+
const strippedPathname = pathname.replace(new RegExp(`^/(${pattern})/`), "/")
16+
1217
if (
1318
pathname.includes("contributing") ||
1419
pathname.includes("community") ||
15-
pathname === "/"
20+
strippedPathname === "/"
1621
) {
1722
return (
1823
<DismissableBanner storageKey="writersCohort">

0 commit comments

Comments
 (0)