@@ -4,6 +4,7 @@ import Heading from "@theme/Heading";
44import Layout from "@theme/Layout" ;
55import Image from "@theme/ThemedImage" ;
66import clsx from "clsx" ;
7+ import { useState } from "react" ;
78
89import Admonition from "../components/Admonition" ;
910import styles from "./index.module.css" ;
@@ -47,69 +48,87 @@ const socials = [
4748 } ,
4849] ;
4950
51+ const SocialIcons = ( ) => {
52+ return (
53+ < div className = { styles . socialLinks } >
54+ { socials . map ( ( social , index ) => (
55+ < a
56+ key = { index }
57+ href = { social . href }
58+ className = { styles . socialLink }
59+ target = "_blank"
60+ rel = "noopener noreferrer"
61+ aria-label = { social . alt }
62+ >
63+ < Image
64+ sources = { {
65+ light : social . src ,
66+ dark : social . src
67+ } }
68+ alt = { social . alt }
69+ width = { social . size }
70+ height = { social . size }
71+ className = { styles . socialIcon }
72+ />
73+ </ a >
74+ ) ) }
75+ </ div >
76+ ) ;
77+ } ;
78+
5079const HomepageHeader = ( ) => {
80+ const [ showAnnouncement , setShowAnnouncement ] = useState ( true ) ;
5181
52- const SocialIcons = ( ) => {
53- return (
54- < div className = { styles . socialLinks } >
55- { socials . map ( ( social , index ) => (
56- < a
57- key = { index }
58- href = { social . href }
59- className = { styles . socialLink }
60- target = "_blank"
61- rel = "noopener noreferrer"
62- aria-label = { social . alt }
63- >
64- < Image
65- sources = { {
66- light : social . src ,
67- dark : social . src
68- } }
69- alt = { social . alt }
70- width = { social . size }
71- height = { social . size }
72- className = { styles . socialIcon }
73- />
74- </ a >
75- ) ) }
76- </ div >
77- ) ;
82+ const closeAnnouncement = ( ) => {
83+ setShowAnnouncement ( false ) ;
7884 } ;
7985
8086 return (
8187 < header className = { styles . heroBanner } >
8288
83- < Admonition
84- className = { styles . announcement }
85- type = "tip"
86- title = "A new version of open.mp server and launcher is out now!"
87- >
88- Version < b > 1.4.0.2779</ b > of open.mp server is out with many fixes,
89- performance boosts, and new features!{ " " }
90- < Link
91- to = "https://www.open.mp/docs/changelog"
92- className = { styles . enhancedLink }
93- >
94- Changelog
95- </ Link > |{ " " }
96- < Link
97- to = "https://github.com/openmultiplayer/open.mp/releases/latest"
98- className = { styles . enhancedLink }
99- >
100- Download
101- </ Link >
102- .
103- < br />
104- The launcher also got an update!{ " " }
105- < Link
106- to = "https://github.com/openmultiplayer/launcher/releases/latest"
107- className = { styles . enhancedLink }
108- >
109- See what's new
110- </ Link >
111- .
112- </ Admonition >
89+ { showAnnouncement && (
90+ < div className = { styles . announcementWrapper } >
91+ < Admonition
92+ className = { styles . announcement }
93+ type = "tip"
94+ title = "A new version of open.mp server and launcher is out now!"
95+ >
96+ Version < b > 1.4.0.2779</ b > of open.mp server is out with many fixes,
97+ performance boosts, and new features!{ " " }
98+ < Link
99+ to = "https://www.open.mp/docs/changelog"
100+ className = { styles . enhancedLink }
101+ >
102+ Changelog
103+ </ Link > |{ " " }
104+ < Link
105+ to = "https://github.com/openmultiplayer/open.mp/releases/latest"
106+ className = { styles . enhancedLink }
107+ >
108+ Download
109+ </ Link >
110+ .
111+ < br />
112+ The launcher also got an update!{ " " }
113+ < Link
114+ to = "https://github.com/openmultiplayer/launcher/releases/latest"
115+ className = { styles . enhancedLink }
116+ >
117+ See what's new
118+ </ Link >
119+ .
120+ < div className = { styles . dismissContainer } >
121+ < button
122+ onClick = { closeAnnouncement }
123+ className = { styles . dismissButton }
124+ aria-label = "Dismiss announcement"
125+ >
126+ Dismiss this message
127+ </ button >
128+ </ div >
129+ </ Admonition >
130+ </ div >
131+ ) }
113132
114133 < div className = { styles . heroContent } >
115134 < div className = { styles . heroText } >
0 commit comments