@@ -9,6 +9,7 @@ import {TbBrandCSharp} from "react-icons/tb";
99import { FaPython } from "react-icons/fa" ;
1010import { FaDocker } from "react-icons/fa" ;
1111import { IoLogoJavascript } from "react-icons/io5" ;
12+ import { useColorMode } from "@docusaurus/theme-common" ;
1213
1314// 🔹 Wrapper for icons to make them uniform
1415const IconWrapper = ( { icon, bg} ) => (
@@ -20,7 +21,7 @@ const IconWrapper = ({icon, bg}) => (
2021 alignItems : "center" ,
2122 justifyContent : "center" ,
2223 borderRadius : "50%" ,
23- backgroundColor : bg || "#f3f4f6" ,
24+ backgroundColor : bg ,
2425 boxShadow : "0 3px 6px rgba(0,0,0,0.1)" ,
2526 transition : "transform 0.2s ease" ,
2627 } }
@@ -31,6 +32,9 @@ const IconWrapper = ({icon, bg}) => (
3132) ;
3233
3334export default function QuickstartFilter ( { defaultLanguage = null } ) {
35+ const { colorMode} = useColorMode ( ) ;
36+ const isDark = colorMode === "dark" ;
37+
3438 // 👇 initialize with defaultLanguage if provided
3539 const [ language , setLanguage ] = useState ( defaultLanguage ) ;
3640 const [ server , setServer ] = useState ( null ) ;
@@ -42,6 +46,18 @@ export default function QuickstartFilter({defaultLanguage = null}) {
4246 ) ;
4347 } ) ;
4448
49+ // Icon backgrounds for dark mode
50+ const darkIconBgs = {
51+ Go : "#223044" ,
52+ Python : "#243447" ,
53+ Java : "#392a2a" ,
54+ "JS/TS" : "#3b3924" ,
55+ Rust : "#44392b" ,
56+ "C#" : "#332e44" ,
57+ Local : "#44392b" ,
58+ Docker : "#233044" ,
59+ } ;
60+
4561 const languages = [
4662 {
4763 name : "Go" ,
@@ -88,6 +104,79 @@ export default function QuickstartFilter({defaultLanguage = null}) {
88104 } ,
89105 ] ;
90106
107+ // ----- Styles -----
108+ const headingStyle = {
109+ textAlign : "left" ,
110+ marginLeft : "1rem" ,
111+ fontSize : "1.4rem" ,
112+ fontWeight : "600" ,
113+ color : isDark ? "#fff" : "#222" ,
114+ } ;
115+
116+ const serverContainer = {
117+ display : "flex" ,
118+ flexWrap : "wrap" ,
119+ gap : "1.5rem" ,
120+ justifyContent : "flex-start" ,
121+ marginTop : "1.5rem" ,
122+ marginLeft : "1rem" ,
123+ } ;
124+
125+ const stepContainer = {
126+ display : "flex" ,
127+ flexWrap : "wrap" ,
128+ gap : "1.5rem" ,
129+ marginLeft : "1rem" ,
130+ justifyContent : "flex-start" ,
131+ marginTop : "1.5rem" ,
132+ } ;
133+
134+ const buttonCard = {
135+ border : isDark ? "2px solid #333" : "2px solid #ddd" ,
136+ borderRadius : "12px" ,
137+ padding : "1rem 2rem" ,
138+ cursor : "pointer" ,
139+ background : isDark ? "#222428" : "#fff" ,
140+ transition : "all 0.2s ease" ,
141+ textAlign : "center" ,
142+ display : "flex" ,
143+ flexDirection : "column" ,
144+ alignItems : "center" ,
145+ justifyContent : "center" ,
146+ gap : "0.5rem" ,
147+ color : isDark ? "#fff" : "#222" ,
148+ boxShadow : isDark
149+ ? "0 2px 10px rgba(0,0,0,0.5)"
150+ : "0 2px 6px rgba(0, 0, 0, 0.08)" ,
151+ } ;
152+
153+ const gridContainer = {
154+ display : "grid" ,
155+ gap : "1.5rem" ,
156+ gridTemplateColumns : "repeat(auto-fit, minmax(250px, 1fr))" ,
157+ marginTop : "2rem" ,
158+ } ;
159+
160+ const cardStyle = {
161+ border : isDark ? "1px solid #333" : "1px solid #eee" ,
162+ borderRadius : "12px" ,
163+ padding : "1rem" ,
164+ background : isDark ? "#23272f" : "#fff" ,
165+ boxShadow : isDark
166+ ? "0 2px 10px rgba(0,0,0,0.6)"
167+ : "0 2px 6px rgba(0, 0, 0, 0.08)" ,
168+ color : isDark ? "#fff" : "#222" ,
169+ } ;
170+
171+ const linkStyle = {
172+ marginTop : "0.8rem" ,
173+ display : "inline-block" ,
174+ color : "#f97316" ,
175+ fontWeight : "bold" ,
176+ textDecoration : "none" ,
177+ } ;
178+
179+ // ----- Render -----
91180 return (
92181 < div style = { { marginTop : "2rem" } } >
93182 { /* Language Selection */ }
@@ -100,15 +189,32 @@ export default function QuickstartFilter({defaultLanguage = null}) {
100189 style = { {
101190 ...buttonCard ,
102191 border :
103- language === lang . name ? "2px solid #f97316" : "2px solid #ddd" ,
192+ language === lang . name
193+ ? "2px solid #f97316"
194+ : buttonCard . border ,
104195 boxShadow :
105196 language === lang . name
106- ? "0 3px 8px rgba(249, 115, 22, 0.3)"
107- : "none" ,
197+ ? isDark
198+ ? "0 3px 12px rgba(249,115,22,0.2)"
199+ : "0 3px 8px rgba(249, 115, 22, 0.3)"
200+ : buttonCard . boxShadow ,
108201 } }
109202 >
110- < IconWrapper icon = { lang . icon } bg = { lang . bg } />
111- < p style = { { marginTop : "0.5rem" , fontWeight : "500" } } > { lang . name } </ p >
203+ < IconWrapper
204+ icon = { lang . icon }
205+ bg = { isDark ? darkIconBgs [ lang . name ] || "#222" : lang . bg }
206+ />
207+ < p
208+ style = { {
209+ margin : 0 ,
210+ fontWeight : "500" ,
211+ color : isDark ? "#fff" : "#222" ,
212+ opacity : language === lang . name ? 1 : 0.7 ,
213+ transition : "color 0.2s, opacity 0.2s" ,
214+ } }
215+ >
216+ { lang . name }
217+ </ p >
112218 </ button >
113219 ) ) }
114220 </ div >
@@ -125,15 +231,30 @@ export default function QuickstartFilter({defaultLanguage = null}) {
125231 style = { {
126232 ...buttonCard ,
127233 border :
128- server === srv . name ? "2px solid #f97316" : "2px solid #ddd" ,
234+ server === srv . name ? "2px solid #f97316" : buttonCard . border ,
129235 boxShadow :
130236 server === srv . name
131- ? "0 3px 8px rgba(249, 115, 22, 0.3)"
132- : "none" ,
237+ ? isDark
238+ ? "0 3px 12px rgba(249,115,22,0.2)"
239+ : "0 3px 8px rgba(249, 115, 22, 0.3)"
240+ : buttonCard . boxShadow ,
133241 } }
134242 >
135- < IconWrapper icon = { srv . icon } bg = { srv . bg } />
136- < p style = { { marginTop : "0.5rem" , fontWeight : "500" } } > { srv . name } </ p >
243+ < IconWrapper
244+ icon = { srv . icon }
245+ bg = { isDark ? darkIconBgs [ srv . name ] || "#222" : srv . bg }
246+ />
247+ < p
248+ style = { {
249+ margin : 0 ,
250+ fontWeight : "500" ,
251+ color : isDark ? "#fff" : "#222" ,
252+ opacity : server === srv . name ? 1 : 0.7 ,
253+ transition : "color 0.2s, opacity 0.2s" ,
254+ } }
255+ >
256+ { srv . name }
257+ </ p >
137258 </ button >
138259 ) ) }
139260 </ div >
@@ -148,10 +269,21 @@ export default function QuickstartFilter({defaultLanguage = null}) {
148269 { filteredQuickstarts . length > 0 ? (
149270 filteredQuickstarts . map ( ( app , idx ) => (
150271 < div key = { idx } style = { cardStyle } >
151- < h3 style = { { margin : "0 0 0.5rem 0" , fontSize : "1.2rem" } } >
272+ < h3
273+ style = { {
274+ margin : "0 0 0.5rem 0" ,
275+ fontSize : "1.2rem" ,
276+ color : isDark ? "#fff" : "#222" ,
277+ } }
278+ >
152279 { app . title }
153280 </ h3 >
154- < p style = { { color : "#555" , fontSize : "0.95rem" } } >
281+ < p
282+ style = { {
283+ color : isDark ? "#ccc" : "#555" ,
284+ fontSize : "0.95rem" ,
285+ } }
286+ >
155287 { app . description }
156288 </ p >
157289 < Link to = { app . link } style = { linkStyle } >
@@ -160,70 +292,13 @@ export default function QuickstartFilter({defaultLanguage = null}) {
160292 </ div >
161293 ) )
162294 ) : (
163- < p > No quickstarts available for this selection.</ p >
295+ < p style = { { color : isDark ? "#fff" : "#222" } } >
296+ No quickstarts available for this selection.
297+ </ p >
164298 ) }
165299 </ div >
166300 </ >
167301 ) }
168302 </ div >
169303 ) ;
170304}
171-
172- // Styles
173- const headingStyle = {
174- textAlign : "left" ,
175- marginLeft : "1rem" ,
176- fontSize : "1.4rem" ,
177- fontWeight : "600" ,
178- } ;
179-
180- const serverContainer = {
181- display : "flex" ,
182- flexWrap : "wrap" ,
183- gap : "1.5rem" ,
184- justifyContent : "flex-start" ,
185- marginTop : "1.5rem" ,
186- marginLeft : "1rem" ,
187- } ;
188-
189- const stepContainer = {
190- display : "flex" ,
191- flexWrap : "wrap" ,
192- gap : "1.5rem" ,
193- marginLeft : "1rem" ,
194- justifyContent : "flex-start" ,
195- marginTop : "1.5rem" ,
196- } ;
197-
198- const buttonCard = {
199- border : "2px solid #ddd" ,
200- borderRadius : "12px" ,
201- padding : "1rem 2rem" ,
202- cursor : "pointer" ,
203- background : "#fff" ,
204- transition : "all 0.2s ease" ,
205- textAlign : "center" ,
206- } ;
207-
208- const gridContainer = {
209- display : "grid" ,
210- gap : "1.5rem" ,
211- gridTemplateColumns : "repeat(auto-fit, minmax(250px, 1fr))" ,
212- marginTop : "2rem" ,
213- } ;
214-
215- const cardStyle = {
216- border : "1px solid #eee" ,
217- borderRadius : "12px" ,
218- padding : "1rem" ,
219- background : "#fff" ,
220- boxShadow : "0 2px 6px rgba(0, 0, 0, 0.08)" ,
221- } ;
222-
223- const linkStyle = {
224- marginTop : "0.8rem" ,
225- display : "inline-block" ,
226- color : "#f97316" ,
227- fontWeight : "bold" ,
228- textDecoration : "none" ,
229- } ;
0 commit comments