From fae68a2fb2999cdb1ed91cace145bd44a567f7e9 Mon Sep 17 00:00:00 2001 From: sophian Date: Fri, 15 Sep 2023 16:58:55 -0400 Subject: [PATCH] Add env variable to show/hide announcement banner --- .env.example | 1 + .github/workflows/website.yml | 1 + src/components/Banner.tsx | 4 +- src/components/header/index.tsx | 73 ++++++++++++++++++--------------- src/theme.ts | 2 +- 5 files changed, 46 insertions(+), 35 deletions(-) diff --git a/.env.example b/.env.example index 89c79146..bc71d0e7 100644 --- a/.env.example +++ b/.env.example @@ -1 +1,2 @@ GATSBY_FUNCTIONS_URL= +SHOW_ANNOUNCEMENT_BANNER=show \ No newline at end of file diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index f5c0f2f9..66e0dc45 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -62,6 +62,7 @@ jobs: - name: Build env: GATSBY_FUNCTIONS_URL: ${{ needs.prepare-deploy.outputs.function_URL }} + SHOW_ANNOUNCEMENT_BANNER: true run: | yarn build diff --git a/src/components/Banner.tsx b/src/components/Banner.tsx index 39e8320b..848362c5 100644 --- a/src/components/Banner.tsx +++ b/src/components/Banner.tsx @@ -7,7 +7,7 @@ type BannerProps = { } export function Banner({ children }: BannerProps) { - return ( + return process.env.SHOW_ANNOUNCEMENT_BANNER === 'true' ? ( {children} - ) + ) : null } diff --git a/src/components/header/index.tsx b/src/components/header/index.tsx index 52157cd8..525d9105 100644 --- a/src/components/header/index.tsx +++ b/src/components/header/index.tsx @@ -19,39 +19,48 @@ export function Header({ menuButtonVariant }: HeaderProps) { const scrollDirection = useScrollDirection(50) return ( - - - - Centrifuge is Everywhere. Read the{' '} - - Announcement - - - + + Centrifuge is Everywhere. Read the{' '} + - - - + Announcement + + + + + + + + - - - - - + + + + + + ) } diff --git a/src/theme.ts b/src/theme.ts index 24680fb6..05c37a25 100644 --- a/src/theme.ts +++ b/src/theme.ts @@ -8,7 +8,7 @@ export const theme: DefaultTheme = { container: '1430px', containerHeader: '1600px', containerNarrow: '1140px', - headerHeight: [85, 90, 90], + headerHeight: [50, 65, 65], }, space: Object.assign([], centrifugeLight.space, { layoutSmall: 80,