@@ -4,49 +4,90 @@ import "./banner.css"
44
55import { useState } from "react" ;
66
7- export default function Banner ( ) {
7+ type BannerType = "text" | "image" ;
8+
9+ interface BannerProps {
10+ type ?: BannerType ;
11+ }
12+
13+ export default function Banner ( { type = "text" } : BannerProps ) {
814 const [ bannerVisible , setBannerVisible ] = useState ( true ) ;
915
16+ if ( ! bannerVisible ) return null ;
17+
1018 return (
11- bannerVisible && (
12- < >
13- < div id = "near-event" >
14- < div className = "near-event-banner" >
15- < button
16- className = ""
17- style = { {
18- position : "absolute" ,
19- top : "-15px" ,
20- right : "0" ,
21- background : "black" ,
22- border : "none" ,
23- color : "#00EC97" ,
24- fontSize : "12px" ,
25- cursor : "pointer" ,
26- zIndex : 9999999 ,
27- fontWeight : "bold" ,
28- } }
29- onClick = { ( ) => {
30- console . log ( "set banner hide: " , bannerVisible ) ;
31- setBannerVisible ( false ) ;
32- } }
33- >
34- [×]
35- </ button >
36- < a
37- href = "https://onetrillionagents.com/"
38- target = "_blank"
39- rel = "noopener noreferrer"
40- title = "One Trillion Agents Hackathon - Bring order to chaos. Buidl the resistance"
41- >
42- < Image
43- src = "https://indexer.nearcatalog.org/wp-content/uploads/2025/01/nearaihackathon.jpeg"
44- alt = "One Trillion Agents Hackathon - Bring order to chaos. Buidl the resistance"
45- />
46- </ a >
19+ < div id = "near-event" >
20+ { type === "text" ? (
21+ < div className = "near-event-banner near-event-banner-text" style = { { background : "linear-gradient(90deg, #65D56E 0%, #59C2E8 50%, #F98372 75%, #F1B139 100%)" } } >
22+ < div className = "w-full" style = { { opacity : 1 } } >
23+ < div className = "block w-full mx-auto max-w-[1480px]" >
24+ < div className = "px-3 md:px-28 py-2 md:py-1 flex flex-row items-center justify-between gap-3" >
25+ < div className = "flex-grow flex flex-col md:flex-row md:items-center justify-start md:justify-between gap-2 md:gap-6" >
26+ < h3 className = "text-black text-sm md:text-base form-label-m text-center md:text-left" >
27+ NEARCON, the flagship gathering of the NEAR ecosystem, February 23–24 in San Francisco
28+ </ h3 >
29+ < a
30+ target = "_blank"
31+ className = "animated-text-hover group relative block overflow-hidden font-grotesk text-xs md:text-base leading-normal no-underline transform transition-all duration-150 text-white font-medium rounded px-2 py-1 md:py-2 bg-black shrink-0 mx-auto md:mr-0 md:ml-auto text-center"
32+ rel = "noopener noreferrer"
33+ href = "https://nearcon.org/"
34+ >
35+ < div className = "relative md:pl-2" >
36+ < span className = "anim-characters-span block py-0 md:py-1 pr-1 md:pr-2 relative transition-all duration-300 delay-150" aria-label = "NEARCON 2026" >
37+ NEARCON 2026
38+ </ span >
39+ </ div >
40+ </ a >
41+ </ div >
42+ < button
43+ onClick = { ( ) => setBannerVisible ( false ) }
44+ className = "p-1 md:py-2 md:px-6 flex justify-center items-center relative bg-transparent border-none cursor-pointer text-white"
45+ aria-label = "Close"
46+ >
47+ < svg xmlns = "http://www.w3.org/2000/svg" width = "20" height = "20" fill = "currentColor" viewBox = "0 0 256 256" className = "block" >
48+ < path d = "M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z" > </ path >
49+ </ svg >
50+ < span className = "sr-only" > Close</ span >
51+ </ button >
52+ </ div >
4753 </ div >
4854 </ div >
49- </ >
50- )
51- ) ;
55+ </ div >
56+ ) : (
57+ < div className = "near-event-banner near-event-banner-image" >
58+ < button
59+ className = ""
60+ style = { {
61+ position : "absolute" ,
62+ top : "-15px" ,
63+ right : "0" ,
64+ background : "black" ,
65+ border : "none" ,
66+ color : "#00EC97" ,
67+ fontSize : "12px" ,
68+ cursor : "pointer" ,
69+ zIndex : 9999999 ,
70+ fontWeight : "bold" ,
71+ } }
72+ onClick = { ( ) => setBannerVisible ( false ) }
73+ >
74+ [×]
75+ </ button >
76+ < a
77+ href = "https://onetrillionagents.com/"
78+ target = "_blank"
79+ rel = "noopener noreferrer"
80+ title = "One Trillion Agents Hackathon - Bring order to chaos. Buidl the resistance"
81+ >
82+ < Image
83+ src = "https://indexer.nearcatalog.org/wp-content/uploads/2025/01/nearaihackathon.jpeg"
84+ alt = "One Trillion Agents Hackathon - Bring order to chaos. Buidl the resistance"
85+ width = { 1200 }
86+ height = { 400 }
87+ />
88+ </ a >
89+ </ div >
90+ ) }
91+ </ div >
92+ ) ;
5293}
0 commit comments