-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore(banner): add boss banner * chore(version): updated bdp-ui patch fix
- Loading branch information
Showing
4 changed files
with
19 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,20 @@ | ||
import Image from "next/image"; | ||
import Link from "next/link"; | ||
import React, { useEffect, useState } from "react"; | ||
import { Banner } from "@bitcoin-dev-project/bdp-ui"; | ||
|
||
const BANNER_KEY = "FOSS-banner"; | ||
|
||
const Banner = () => { | ||
const [isOpen, setIsOpen] = useState(false); | ||
|
||
const handleClose = () => { | ||
if (typeof window !== "undefined") { | ||
sessionStorage.setItem(BANNER_KEY, "hidden"); | ||
} | ||
setIsOpen(false); | ||
}; | ||
|
||
useEffect(() => { | ||
const banner_in_session = window.sessionStorage.getItem(BANNER_KEY); | ||
if (banner_in_session === "hidden") { | ||
setIsOpen(false); | ||
} else { | ||
setIsOpen(true); | ||
} | ||
}, []); | ||
|
||
if (!isOpen) return null; | ||
const BossBanner = () => { | ||
return ( | ||
<div className="bg-orange-100 flex items-center w-full sticky top-0 z-[10] p-2"> | ||
<div className="flex flex-col grow items-center text-sm md:text-base text-gray-600 font-medium text-center"> | ||
<p className="">{`Start Your Career in Bitcoin Open Source`}</p> | ||
<div className="flex gap-2 items-center"> | ||
<span>{`Development in 2024 `}</span> | ||
<Link href="https://learning.chaincode.com/#FOSS" target="_blank"> | ||
<span className="uppercase text-custom-brightOrange-200 underline whitespace-nowrap">{`Apply Today!`}</span> | ||
</Link> | ||
</div> | ||
</div> | ||
<button | ||
onClick={handleClose} | ||
className="relative h-[18px] w-[18px] grid place-items-center rounded-full hover:bg-orange-300" | ||
> | ||
<Image src="/close_icon.svg" width={10} height={10} alt="close" /> | ||
</button> | ||
<div className={`w-full bg-bdp-background sticky top-0`}> | ||
<Banner | ||
headingText="Start your career in bitcoin open source —" | ||
linkText="APPLY TODAY" | ||
linkTo="https://learning.chaincode.com/#BOSS" | ||
hasBoss | ||
styles={{ | ||
container: "data-[has-heading='true']:h-auto", | ||
bannerInfoContainer: "py-2", | ||
}} | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Banner; | ||
export default BossBanner; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters