|
1 | | -import React, {useEffect, useState} from "react"; |
| 1 | +import React, {useState} from "react"; |
2 | 2 | import quickstarts from "./QuickStartList"; |
3 | 3 | import Link from "@docusaurus/Link"; |
4 | 4 | import {FaGolang} from "react-icons/fa6"; |
@@ -31,25 +31,9 @@ const IconWrapper = ({icon, bg}) => ( |
31 | 31 | </div> |
32 | 32 | ); |
33 | 33 |
|
34 | | - |
35 | | -export function useMediaQuery(query) { |
36 | | - const [matches, setMatches] = useState(false); |
37 | | - |
38 | | - useEffect(() => { |
39 | | - const media = window.matchMedia(query); |
40 | | - setMatches(media.matches); |
41 | | - const listener = () => setMatches(media.matches); |
42 | | - media.addEventListener("change", listener); |
43 | | - return () => media.removeEventListener("change", listener); |
44 | | - }, [query]); |
45 | | - |
46 | | - return matches; |
47 | | -} |
48 | | - |
49 | 34 | export default function QuickstartFilter({defaultLanguage = null}) { |
50 | 35 | const {colorMode} = useColorMode(); |
51 | 36 | const isDark = colorMode === "dark"; |
52 | | - const isMobile = useMediaQuery("(max-width: 480px)"); |
53 | 37 | // 👇 initialize with defaultLanguage if provided |
54 | 38 | const [language, setLanguage] = useState(defaultLanguage); |
55 | 39 | const [server, setServer] = useState(null); |
@@ -196,8 +180,16 @@ export default function QuickstartFilter({defaultLanguage = null}) { |
196 | 180 | // ----- Render ----- |
197 | 181 | return ( |
198 | 182 | <div style={{marginTop: "2rem"}}> |
| 183 | + <style>{` |
| 184 | + @media (max-width: 480px) { |
| 185 | + .responsive-heading { |
| 186 | + margin-left: 0.75rem !important; |
| 187 | + font-size: 1.2rem !important; |
| 188 | + } |
| 189 | + } |
| 190 | + `}</style> |
199 | 191 | {/* Language Selection */} |
200 | | - <h2 style={headingStyle}>Choose your language</h2> |
| 192 | + <h2 className="responsive-heading" style={headingStyle}>Choose your language</h2> |
201 | 193 | <div style={stepContainer}> |
202 | 194 | {languages.map((lang) => ( |
203 | 195 | <button |
@@ -237,7 +229,7 @@ export default function QuickstartFilter({defaultLanguage = null}) { |
237 | 229 | </div> |
238 | 230 |
|
239 | 231 | {/* Server Selection */} |
240 | | - <h2 style={{...headingStyle, marginTop: "2rem"}}> |
| 232 | + <h2 className="responsive-heading" style={{...headingStyle, marginTop: "2rem"}}> |
241 | 233 | Where do you want to run the app server? |
242 | 234 | </h2> |
243 | 235 | <div style={serverContainer}> |
@@ -279,7 +271,7 @@ export default function QuickstartFilter({defaultLanguage = null}) { |
279 | 271 | {/* Quickstarts */} |
280 | 272 | {language && server && ( |
281 | 273 | <> |
282 | | - <h2 style={{...headingStyle, marginTop: "2rem"}}> |
| 274 | + <h2 className="responsive-heading" style={{...headingStyle, marginTop: "2rem"}}> |
283 | 275 | ✨ AI Suggested Sample Apps |
284 | 276 | </h2> |
285 | 277 | <div style={gridContainer}> |
|
0 commit comments