Skip to content

Commit

Permalink
Add annoucement banner
Browse files Browse the repository at this point in the history
  • Loading branch information
sophialittlejohn committed Sep 15, 2023
1 parent f2102e6 commit cdc8d31
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 10 deletions.
1 change: 1 addition & 0 deletions config/links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ export const links = {
prime: 'https://forms.gle/kt1GShLcWapMGzjs7',
primeBlogPost: 'https://centrifuge.mirror.xyz/KyrMWLKMccFCNfSlvjxe7uyhba7oLrUzlBuZ7GQTn6s',
podcast: 'https://linktr.ee/centrifugeconversations',
announcements: '@devin, please add link here',
}
23 changes: 23 additions & 0 deletions src/components/Banner.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { Box, Text } from '@centrifuge/fabric'
import * as React from 'react'
import { theme } from '../theme'

type BannerProps = {
children: React.ReactNode
}

export function Banner({ children }: BannerProps) {
return (
<Box
as="div"
py={1}
display="flex"
backgroundColor={theme.colors.accentSecondary}
justifyContent="center"
height="100%"
width="100%"
>
<Text variant="body2">{children}</Text>
</Box>
)
}
36 changes: 27 additions & 9 deletions src/components/header/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import React from 'react'
import { Container, Shelf } from '@centrifuge/fabric'
import { Box, Container, Shelf, Text } from '@centrifuge/fabric'
import { useTheme } from 'styled-components'
import type { ButtonVariant } from '../desktop-menu/SubMenu'
import { useScrollDirection } from '../../hooks/use-scroll-direction'
import { Logo } from '../Logo'
import { MobileMenu } from '../mobile-menu'
import { DesktopMenu } from '../desktop-menu'
import { Root, LogoLink } from './styles'
import { Banner } from '../Banner'
import { links } from '../../../config/links'

type HeaderProps = {
menuButtonVariant: ButtonVariant
Expand All @@ -22,18 +24,34 @@ export function Header({ menuButtonVariant }: HeaderProps) {
position="fixed"
zIndex={zIndices.sticky}
top={0}
px={2}
px={0}
height={sizes.headerHeight}
isHidden={scrollDirection === 'down'}
>
<Container as={Shelf} justifyContent="space-between" alignItems="center" height="100%" maxWidth="containerHeader">
<LogoLink to="/" title="Home page">
<Logo />
</LogoLink>
<Box>
<Banner>
Centrifuge is Everywhere. Read the{' '}
<Text as="a" href={links.announcements} rel="noopener noreferrer" target="_blank" variant="body2">
Announcement
</Text>
</Banner>
<Container
px={2}
pt={1}
as={Shelf}
justifyContent="space-between"
alignItems="center"
height="100%"
maxWidth="containerHeader"
>
<LogoLink to="/" title="Home page">
<Logo />
</LogoLink>

<MobileMenu />
<DesktopMenu menuButtonVariant={menuButtonVariant} />
</Container>
<MobileMenu />
<DesktopMenu menuButtonVariant={menuButtonVariant} />
</Container>
</Box>
</Root>
)
}
2 changes: 1 addition & 1 deletion src/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const theme: DefaultTheme = {
container: '1430px',
containerHeader: '1600px',
containerNarrow: '1140px',
headerHeight: [50, 65, 65],
headerHeight: [85, 90, 90],
},
space: Object.assign([], centrifugeLight.space, {
layoutSmall: 80,
Expand Down

0 comments on commit cdc8d31

Please sign in to comment.