Skip to content

Commit 3a9bdee

Browse files
authored
Merge branch 'staging' into dev
2 parents 69dd9f0 + 3aa9c2e commit 3a9bdee

File tree

3 files changed

+31
-5
lines changed

3 files changed

+31
-5
lines changed

src/components/Banners/DismissableBanner.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { Center, CloseButton } from "@chakra-ui/react"
44

55
// Components
66
import BannerNotification from "../BannerNotification"
7-
import Emoji from "../Emoji"
87

98
// Interface
109
export interface IProps {
@@ -27,10 +26,7 @@ const DismissableBanner: React.FC<IProps> = ({ children, storageKey }) => {
2726

2827
return (
2928
<BannerNotification shouldShow={show}>
30-
<Center paddingEnd={8}>
31-
<Emoji marginEnd={4} flexShrink={0} text=":tada:" />
32-
{children}
33-
</Center>
29+
<Center paddingEnd={8}>{children}</Center>
3430
<CloseButton onClick={onClose} aria-label="Close Banner" />
3531
</BannerNotification>
3632
)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import React from "react"
2+
import { Text } from "@chakra-ui/react"
3+
4+
import DismissableBanner from "./DismissableBanner"
5+
import Link from "../Link"
6+
7+
export const TranslatathonBanner = () => {
8+
return (
9+
<DismissableBanner storageKey="translatathon">
10+
<Text m={0}>
11+
✨ Join the first Ethereum.org Translatathon: help translate our website
12+
and compete for prizes in a hackathon-style online event.{" "}
13+
<Link to="/contributing/translation-program/translatathon">
14+
Apply until August 15th
15+
</Link>
16+
.
17+
</Text>
18+
</DismissableBanner>
19+
)
20+
}
21+
22+
export default TranslatathonBanner

src/components/Layout.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import TranslationBanner from "./TranslationBanner"
1010
import TranslationBannerLegal from "./TranslationBannerLegal"
1111
import FeedbackWidget from "./FeedbackWidget"
1212
import { SkipLink } from "./SkipLink"
13+
import TranslatathonBanner from "./Banners/TranslatathonBanner"
1314

1415
import { lightTheme as oldTheme } from "../theme"
1516

@@ -74,6 +75,12 @@ const Layout: React.FC<IProps> = ({
7475
(isPageContentEnglish && !isPageLanguageEnglish)) &&
7576
!isTranslationBannerIgnored
7677

78+
const strippedPathname = path.replace(/^\/[a-z]{2,3}(-[a-z]{2})?\//, "/")
79+
const shouldShowTranslatathonBanner =
80+
strippedPathname === "/community/get-involved/" ||
81+
strippedPathname === "/" ||
82+
strippedPathname === "/contributing/translation-program/"
83+
7784
return (
7885
<ApolloProvider client={client}>
7986
<SkipLink hrefId="#main-content" />
@@ -100,6 +107,7 @@ const Layout: React.FC<IProps> = ({
100107
>
101108
<Nav path={path} />
102109
{shouldShowSideNav && <SideNavMobile path={path} />}
110+
{shouldShowTranslatathonBanner && <TranslatathonBanner />}
103111
<Flex
104112
flexDirection={{ base: "column", lg: "row" }}
105113
id="main-content"

0 commit comments

Comments
 (0)