Skip to content

Commit

Permalink
Merge pull request #710 from centrifuge/update-banner-copy
Browse files Browse the repository at this point in the history
Update banner copy and enable banner
  • Loading branch information
sophialittlejohn authored Sep 19, 2023
2 parents 9a94693 + 24a28cc commit bd8be4c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
- name: Build
env:
GATSBY_FUNCTIONS_URL: ${{ needs.prepare-deploy.outputs.function_URL }}
SHOW_ANNOUNCEMENT_BANNER: false
SHOW_ANNOUNCEMENT_BANNER: true
run: |
yarn build
Expand Down
13 changes: 11 additions & 2 deletions src/components/Banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,16 @@ type BannerProps = {
}

export function Banner({ children }: BannerProps) {
return process.env.SHOW_ANNOUNCEMENT_BANNER === 'true' ? (
const [hasMounted, setHasMounted] = React.useState(false)

React.useEffect(() => {
setHasMounted(true)
}, [])

if (!hasMounted) {
return null
}
return (
<Box
as="div"
py={1}
Expand All @@ -19,5 +28,5 @@ export function Banner({ children }: BannerProps) {
>
<Text variant="body2">{children}</Text>
</Box>
) : null
)
}
4 changes: 2 additions & 2 deletions src/components/header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function Header({ menuButtonVariant }: HeaderProps) {
return (
<>
<Banner>
Centrifuge is Everywhere. {' '}
Centrifuge Everywhere:{' '}
<Text
as="a"
style={{ textDecoration: 'underline' }}
Expand All @@ -30,7 +30,7 @@ export function Header({ menuButtonVariant }: HeaderProps) {
target="_blank"
variant="body2"
>
Read the press release.
Read the announcement
</Text>
</Banner>
<Root
Expand Down

0 comments on commit bd8be4c

Please sign in to comment.