We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3de8933 + de0fe10 commit 3b4a22aCopy full SHA for 3b4a22a
src/components/Banners/Implementations/WritersCohortBanner.tsx
@@ -4,15 +4,20 @@ import { Text } from "@chakra-ui/react"
4
import DismissableBanner from "../DismissableBanner"
5
import Link from "../../Link"
6
7
+import { supportedLanguages } from "../../../utils/languages"
8
+
9
interface IProps {
10
pathname: string
11
}
12
13
const WritersCohortBanner: React.FC<IProps> = ({ pathname }) => {
14
+ const pattern = supportedLanguages.join("|")
15
+ const strippedPathname = pathname.replace(new RegExp(`^/(${pattern})/`), "/")
16
17
if (
18
pathname.includes("contributing") ||
19
pathname.includes("community") ||
- pathname === "/"
20
+ strippedPathname === "/"
21
) {
22
return (
23
<DismissableBanner storageKey="writersCohort">
0 commit comments