Skip to content

Commit

Permalink
add banner
Browse files Browse the repository at this point in the history
  • Loading branch information
talentlessguy committed Nov 7, 2024
1 parent 3a86d20 commit 114a262
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,10 @@
"twitter": "X (Twitter)",
"dao": "DAO forums"
}
},
"banner": {
"title": "Namechain is coming!",
"caption": "Keep up with ENSv2 development",
"cta": "ENSv2 hub"
}
}
45 changes: 45 additions & 0 deletions src/components/pages/AnnouncementBanner.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import Link from 'next/link'
import { useTranslation } from 'react-i18next'
import styled, { css } from 'styled-components'

import { Button, Typography } from '@ensdomains/thorin'

const Container = styled(Link)(
({ theme }) => css`
display: flex;
flex-direction: row;
width: ${theme.space.full};
max-width: 466px;
padding: ${theme.space['4']};
align-items: center;
gap: ${theme.space['4']};
align-self: center;
border-radius: ${theme.radii['2xLarge']};
background-color: ${theme.colors.backgroundPrimary};
`,
)

const Text = styled.span(
({ theme }) => css`
width: ${theme.space.full};
`,
)

export const AnnouncementBanner = () => {
const { t } = useTranslation('ensv2')

return (
<Container href="/ens-v2">
<img src="/migrate/confetti.png" alt="" height={33} width={33} />
<Text>
<Typography fontVariant="largeBold">{t('banner.title')}</Typography>
<Typography fontVariant="small" color="grey">
{t('banner.caption')}
</Typography>
</Text>
<Button colorStyle="greenPrimary" width="max">
{t('banner.cta')}
</Button>
</Container>
)
}
2 changes: 1 addition & 1 deletion src/pages/ens-v2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ const Video = styled.video(
)

export default function ENSv2() {
const { t } = useTranslation('ensvs2')
const { t } = useTranslation('ensv2')
return (
<Main>
<TopNav>
Expand Down
3 changes: 3 additions & 0 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import FaucetBanner from '@app/components/@molecules/FaucetBanner'
import Hamburger from '@app/components/@molecules/Hamburger/Hamburger'
import { SearchInput } from '@app/components/@molecules/SearchInput/SearchInput'
import { LeadingHeading } from '@app/components/LeadingHeading'
import { AnnouncementBanner } from '@app/components/pages/AnnouncementBanner'
import { VerificationErrorDialog } from '@app/components/pages/VerificationErrorDialog'
import { useVerificationOAuthHandler } from '@app/hooks/verification/useVerificationOAuthHandler/useVerificationOAuthHandler'

Expand Down Expand Up @@ -114,6 +115,8 @@ export default function Page() {
</Typography>
</SubtitleWrapper>
<SearchInput />

<AnnouncementBanner />
</Stack>
</Container>
<VerificationErrorDialog {...(dialogProps ?? {})} />
Expand Down

0 comments on commit 114a262

Please sign in to comment.