From 0fcb33380058d5d6ad7d1bcde8dfb6648f6e2732 Mon Sep 17 00:00:00 2001 From: jennyg0 Date: Tue, 13 Feb 2024 15:24:26 -0500 Subject: [PATCH 1/7] add banner to community events [fixes #11838] --- src/components/DevconGrantsBanner.tsx | 26 ++++++++++++++++++++++++++ src/layouts/Static.tsx | 4 +++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 src/components/DevconGrantsBanner.tsx diff --git a/src/components/DevconGrantsBanner.tsx b/src/components/DevconGrantsBanner.tsx new file mode 100644 index 00000000000..ce6eed370d4 --- /dev/null +++ b/src/components/DevconGrantsBanner.tsx @@ -0,0 +1,26 @@ +import { Text } from "@chakra-ui/react" + +import DismissableBanner from "./Banners/DismissableBanner" +import Link from "./Link" + +interface IProps { + pathname: string +} + +const DevconGrantsBanner: React.FC = ({ pathname }) => { + if (pathname.includes("community") && pathname.includes("events")) { + return ( + + + The Road to Devcon Grants support Ethereum education initiatives in + and close to Southeast Asia 🌏🦄 Learn more{" "} + here. + + + ) + } + + return null +} + +export default DevconGrantsBanner diff --git a/src/layouts/Static.tsx b/src/layouts/Static.tsx index 6f734a16218..798f0b2a7c7 100644 --- a/src/layouts/Static.tsx +++ b/src/layouts/Static.tsx @@ -35,6 +35,7 @@ import { getLocaleTimestamp } from "@/lib/utils/time" import { isLangRightToLeft } from "@/lib/utils/translations" import GuideHeroImage from "@/public/heroes/guides-hub-hero.jpg" +import DevconGrantsBanner from "@/components/DevconGrantsBanner" const Heading1 = (props: HeadingProps) => ( @@ -91,12 +92,13 @@ export const StaticLayout = ({ lastUpdatedDate, contentNotTranslated, }: StaticLayoutProps) => { - const { locale } = useRouter() + const { locale, asPath } = useRouter() const absoluteEditPath = getEditPath(slug) return ( + Date: Tue, 13 Feb 2024 16:59:52 -0500 Subject: [PATCH 2/7] update --- public/_redirects | 4 +++- src/components/DevconGrantsBanner.tsx | 4 +++- src/layouts/Static.tsx | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/public/_redirects b/public/_redirects index 5ee30bff053..242b068272d 100644 --- a/public/_redirects +++ b/public/_redirects @@ -180,4 +180,6 @@ /*/studio /:splat/deprecated-software/#ethereum-studio 301! -/en/stablecoins /stablecoins 301! \ No newline at end of file +/en/stablecoins /stablecoins 301! + +/*/community/events https://esp.ethereum.foundation/devcon-grants 301! diff --git a/src/components/DevconGrantsBanner.tsx b/src/components/DevconGrantsBanner.tsx index ce6eed370d4..eb4186ac2fb 100644 --- a/src/components/DevconGrantsBanner.tsx +++ b/src/components/DevconGrantsBanner.tsx @@ -2,6 +2,7 @@ import { Text } from "@chakra-ui/react" import DismissableBanner from "./Banners/DismissableBanner" import Link from "./Link" +import Emoji from "react-emoji-render" interface IProps { pathname: string @@ -13,7 +14,8 @@ const DevconGrantsBanner: React.FC = ({ pathname }) => { The Road to Devcon Grants support Ethereum education initiatives in - and close to Southeast Asia 🌏🦄 Learn more{" "} + and close to Southeast Asia + Learn more{" "} here. diff --git a/src/layouts/Static.tsx b/src/layouts/Static.tsx index 798f0b2a7c7..c664ed81e6d 100644 --- a/src/layouts/Static.tsx +++ b/src/layouts/Static.tsx @@ -7,6 +7,7 @@ import type { MdPageContent, StaticFrontmatter } from "@/lib/interfaces" import Breadcrumbs from "@/components/Breadcrumbs" import Callout from "@/components/Callout" import Contributors from "@/components/Contributors" +import DevconGrantsBanner from "@/components/DevconGrantsBanner" import EnergyConsumptionChart from "@/components/EnergyConsumptionChart" import FeedbackCard from "@/components/FeedbackCard" import GlossaryDefinition from "@/components/Glossary/GlossaryDefinition" @@ -35,7 +36,6 @@ import { getLocaleTimestamp } from "@/lib/utils/time" import { isLangRightToLeft } from "@/lib/utils/translations" import GuideHeroImage from "@/public/heroes/guides-hub-hero.jpg" -import DevconGrantsBanner from "@/components/DevconGrantsBanner" const Heading1 = (props: HeadingProps) => ( From 4b3c1ca5d87db08eed2649c4719f2498b3302899 Mon Sep 17 00:00:00 2001 From: jennyg0 Date: Tue, 13 Feb 2024 19:46:13 -0500 Subject: [PATCH 3/7] fix imports --- src/components/DevconGrantsBanner.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/DevconGrantsBanner.tsx b/src/components/DevconGrantsBanner.tsx index eb4186ac2fb..0fe48217d5d 100644 --- a/src/components/DevconGrantsBanner.tsx +++ b/src/components/DevconGrantsBanner.tsx @@ -1,8 +1,8 @@ import { Text } from "@chakra-ui/react" +import Emoji from "react-emoji-render" import DismissableBanner from "./Banners/DismissableBanner" import Link from "./Link" -import Emoji from "react-emoji-render" interface IProps { pathname: string From e288edb9bbd01db84728cd90596202f1e69c8c92 Mon Sep 17 00:00:00 2001 From: Corwin Smith Date: Wed, 14 Feb 2024 12:33:43 -0700 Subject: [PATCH 4/7] linter --- src/components/DevconGrantsBanner.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/DevconGrantsBanner.tsx b/src/components/DevconGrantsBanner.tsx index 0fe48217d5d..8f07b8df3a9 100644 --- a/src/components/DevconGrantsBanner.tsx +++ b/src/components/DevconGrantsBanner.tsx @@ -1,6 +1,6 @@ +import Emoji from "react-emoji-render" import { Text } from "@chakra-ui/react" -import Emoji from "react-emoji-render" import DismissableBanner from "./Banners/DismissableBanner" import Link from "./Link" From 89626c960f8bb58b7ae5bdd6e355e1f8b94e1988 Mon Sep 17 00:00:00 2001 From: jennyg0 Date: Wed, 14 Feb 2024 14:39:52 -0500 Subject: [PATCH 5/7] fix from review --- public/_redirects | 2 -- 1 file changed, 2 deletions(-) diff --git a/public/_redirects b/public/_redirects index 242b068272d..59711548c56 100644 --- a/public/_redirects +++ b/public/_redirects @@ -181,5 +181,3 @@ /*/studio /:splat/deprecated-software/#ethereum-studio 301! /en/stablecoins /stablecoins 301! - -/*/community/events https://esp.ethereum.foundation/devcon-grants 301! From 8324189b00215fd48d1b17e3167ad453f900d2f5 Mon Sep 17 00:00:00 2001 From: Corwin Smith Date: Wed, 14 Feb 2024 12:52:19 -0700 Subject: [PATCH 6/7] cleanup --- public/_redirects | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/_redirects b/public/_redirects index 59711548c56..5ee30bff053 100644 --- a/public/_redirects +++ b/public/_redirects @@ -180,4 +180,4 @@ /*/studio /:splat/deprecated-software/#ethereum-studio 301! -/en/stablecoins /stablecoins 301! +/en/stablecoins /stablecoins 301! \ No newline at end of file From 8959d76e3c145a2242dd5d1fc0e37fcaee73ac52 Mon Sep 17 00:00:00 2001 From: Corwin Smith Date: Wed, 14 Feb 2024 12:54:36 -0700 Subject: [PATCH 7/7] add a space between emoji --- src/components/DevconGrantsBanner.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/DevconGrantsBanner.tsx b/src/components/DevconGrantsBanner.tsx index 8f07b8df3a9..1fac033ff62 100644 --- a/src/components/DevconGrantsBanner.tsx +++ b/src/components/DevconGrantsBanner.tsx @@ -14,7 +14,7 @@ const DevconGrantsBanner: React.FC = ({ pathname }) => { The Road to Devcon Grants support Ethereum education initiatives in - and close to Southeast Asia + and close to Southeast Asia {" "} Learn more{" "} here.