Skip to content

Commit 60142c9

Browse files
authored
Merge pull request #243 from Developer-DAO/feat/banner
feat: added marketing banner
2 parents 7ca8de0 + 4033b02 commit 60142c9

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

components/Banner.tsx

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import { Center, Flex, Text, chakra } from '@chakra-ui/react'
2+
import { CloseIcon } from '@chakra-ui/icons'
3+
4+
const Banner = () => {
5+
const dismissBanner = () => {
6+
localStorage.setItem('bannerDismissed', 'true')
7+
const banner = document.getElementById('banner')
8+
if (banner) {
9+
banner.style.display = 'none'
10+
}
11+
}
12+
13+
return (
14+
<Center
15+
py="2"
16+
px="3"
17+
bgGradient="linear(to-r,cyan.700, purple.500)"
18+
color="white"
19+
textAlign="center"
20+
id="banner"
21+
>
22+
<Flex align="center" fontSize="sm">
23+
<Text fontWeight="medium" maxW={{ base: '32ch', md: 'unset' }}>
24+
Acamdey V2 is coming soon 👀... Subscribe to our newsletter for
25+
updates!
26+
</Text>
27+
<chakra.a
28+
flexShrink={0}
29+
href="https://developerdao.substack.com/s/probably-nothing"
30+
target="_blank"
31+
ms="6"
32+
bg="blackAlpha.300"
33+
color="whiteAlpha.900"
34+
fontWeight="semibold"
35+
px="3"
36+
py="1"
37+
rounded="base"
38+
>
39+
Subscribe now!{' '}
40+
</chakra.a>
41+
<chakra.button
42+
onClick={dismissBanner}
43+
ms="6"
44+
color="whiteAlpha.900"
45+
fontWeight="semibold"
46+
px="3"
47+
py="1"
48+
rounded="base"
49+
>
50+
<CloseIcon />
51+
</chakra.button>
52+
</Flex>
53+
</Center>
54+
)
55+
}
56+
57+
export default Banner

components/Layout.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import NavBar from '@components/NavBar'
22
import Footer from '@components/footer/Footer'
33
import { Box } from '@chakra-ui/react'
4+
import Banner from './Banner'
45

56
const Layout = ({ children }: { children: React.ReactNode }) => {
67
return (
78
<>
9+
<Banner />
810
<NavBar />
911
<Box
1012
p="1.25em"

0 commit comments

Comments
 (0)