Skip to content

Commit de31942

Browse files
authored
Add boss banner on Main (#304)
1 parent 684dd3f commit de31942

File tree

6 files changed

+52
-5
lines changed

6 files changed

+52
-5
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"compile:scripts": "tsc --project tsconfig.scripts.json"
1212
},
1313
"dependencies": {
14+
"@bitcoin-dev-project/bdp-ui": "^1.5.2",
1415
"@chakra-ui/react": "^2.8.0",
1516
"@emotion/react": "^11.11.1",
1617
"@emotion/styled": "^11.11.0",
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { Banner } from "@bitcoin-dev-project/bdp-ui";
2+
import { Box } from "@chakra-ui/react";
3+
4+
const BossBanner = ({ top }: { top: number }) => {
5+
return (
6+
<Box
7+
className={`bg-bdp-background`}
8+
zIndex={100}
9+
position={"fixed"}
10+
top={top}
11+
background={"white"}
12+
width={"full"}
13+
>
14+
<Banner
15+
headingText="Start your career in bitcoin open source —"
16+
linkText="APPLY TODAY"
17+
linkTo="https://learning.chaincode.com/#BOSS"
18+
hasBoss
19+
/>
20+
</Box>
21+
);
22+
};
23+
24+
export default BossBanner;

src/components/home/HeroSection.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const HeroSection = ({ getStarted }: { getStarted: () => void }) => {
2424
className="hero-section "
2525
flexDir={"column"}
2626
width={"100%"}
27+
pt={{ lg: 14 }}
2728
id="hero-section"
2829
position={"relative"}
2930
>

src/layout/index.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@ import { useRouter } from "next/router";
88
import Navbar from "@/components/navbar/Navbar";
99
import config from "@/config/config.json";
1010
import Script from "next/script";
11+
import BossBanner from "@/components/banner/BossBanner";
1112

1213
const Layout = ({ children }: { children: React.ReactNode }) => {
1314
const [isReviewSite, setIsReviewSite] = useState(false);
1415
const { noRestriction } = useNoContainerLimit();
1516
const router = useRouter();
16-
const isHomePage = router.pathname === "/";
17+
const isRoot = router.pathname === "/";
1718
const isHomeRouter = router.pathname === "/home";
1819

1920
useEffect(() => {
@@ -53,16 +54,17 @@ const Layout = ({ children }: { children: React.ReactNode }) => {
5354
content="https://review.btctranscripts.com/btctranscripts.png"
5455
></meta>
5556
</Head>
56-
{!isHomePage && <Navbar />}
57+
{!isRoot && <Navbar />}
58+
{(isRoot || isHomeRouter) && <BossBanner top={isRoot ? 0 : 12} />}
5759
<GlobalContainer
5860
flexGrow={1}
59-
py={!isHomePage ? 4 : 0}
60-
mt={!isHomePage ? 12 : 0}
61+
py={!isRoot ? 4 : 0}
62+
mt={!isRoot ? 12 : 0}
6163
{...(noRestriction ? { maxW: "none", p: 0 } : {})}
6264
>
6365
{children}
6466
</GlobalContainer>
65-
{!isHomePage && !isHomeRouter && <Footer />}
67+
{!isRoot && !isHomeRouter && <Footer />}
6668
{isReviewSite && (
6769
<Script
6870
async

src/pages/_app.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import theme from "@/chakra/chakra-theme";
22
import Layout from "@/layout";
33
import { ApiProvider } from "@/services/api/provider";
44
import "@splidejs/react-splide/css";
5+
import "@bitcoin-dev-project/bdp-ui/styles.css";
56
import "@/styles/globals.css";
67
import { ChakraProvider, ColorModeScript } from "@chakra-ui/react";
78
import { SessionProvider } from "next-auth/react";

yarn.lock

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@
5757
"@babel/helper-validator-identifier" "^7.22.5"
5858
to-fast-properties "^2.0.0"
5959

60+
"@bitcoin-dev-project/bdp-ui@^1.5.2":
61+
version "1.5.2"
62+
resolved "https://registry.yarnpkg.com/@bitcoin-dev-project/bdp-ui/-/bdp-ui-1.5.2.tgz#018183023b4bfc0d8d3640a09e2c1be63aee2993"
63+
integrity sha512-lZy/DZlp0ih7w6immMT6iEOuoVS55P6eOtd0UJab4JusxuUX16P1zknr4eIuLiwWQ3j8h8FPoS92m/wxjGE90g==
64+
dependencies:
65+
clsx "^2.1.1"
66+
tailwind-merge "^2.5.2"
67+
6068
"@chakra-ui/[email protected]":
6169
version "2.3.0"
6270
resolved "https://registry.yarnpkg.com/@chakra-ui/accordion/-/accordion-2.3.0.tgz#2c85fd2d2734b176f019f8db9f4e075007b4e1fb"
@@ -1811,6 +1819,11 @@ [email protected]:
18111819
resolved "https://registry.yarnpkg.com/client-only/-/client-only-0.0.1.tgz#38bba5d403c41ab150bff64a95c85013cf73bca1"
18121820
integrity sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==
18131821

1822+
clsx@^2.1.1:
1823+
version "2.1.1"
1824+
resolved "https://registry.yarnpkg.com/clsx/-/clsx-2.1.1.tgz#eed397c9fd8bd882bfb18deab7102049a2f32999"
1825+
integrity sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==
1826+
18141827
color-convert@^1.9.0:
18151828
version "1.9.3"
18161829
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8"
@@ -4173,6 +4186,11 @@ synckit@^0.8.5:
41734186
"@pkgr/utils" "^2.3.1"
41744187
tslib "^2.5.0"
41754188

4189+
tailwind-merge@^2.5.2:
4190+
version "2.5.5"
4191+
resolved "https://registry.yarnpkg.com/tailwind-merge/-/tailwind-merge-2.5.5.tgz#98167859b856a2a6b8d2baf038ee171b9d814e39"
4192+
integrity sha512-0LXunzzAZzo0tEPxV3I297ffKZPlKDrjj7NXphC8V5ak9yHC5zRmxnOe2m/Rd/7ivsOMJe3JZ2JVocoDdQTRBA==
4193+
41764194
tapable@^2.2.0:
41774195
version "2.2.1"
41784196
resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0"

0 commit comments

Comments
 (0)