diff options
| author | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2025-10-22 13:59:12 +0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-22 12:59:12 +0300 |
| commit | 69aeb7889ac136a8e4fbe7de1330298e30345479 (patch) | |
| tree | 6b2cd2d420105dc7ffad3c3649df359f634cae77 /frontend/src/pages/Rules.tsx | |
| parent | feat/rankings: update wr for 3 maps (#279) (diff) | |
| download | lphub-69aeb7889ac136a8e4fbe7de1330298e30345479.tar.gz lphub-69aeb7889ac136a8e4fbe7de1330298e30345479.tar.bz2 lphub-69aeb7889ac136a8e4fbe7de1330298e30345479.zip | |
feat/frontend: switch to vite, update node to v22 (#281)
Diffstat (limited to 'frontend/src/pages/Rules.tsx')
| -rw-r--r-- | frontend/src/pages/Rules.tsx | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/frontend/src/pages/Rules.tsx b/frontend/src/pages/Rules.tsx index 9f57b7e..a07c0c1 100644 --- a/frontend/src/pages/Rules.tsx +++ b/frontend/src/pages/Rules.tsx | |||
| @@ -1,41 +1,41 @@ | |||
| 1 | import React from 'react'; | 1 | import React from "react"; |
| 2 | import ReactMarkdown from 'react-markdown'; | 2 | import ReactMarkdown from "react-markdown"; |
| 3 | import { Helmet } from 'react-helmet'; | 3 | import { Helmet } from "react-helmet"; |
| 4 | 4 | ||
| 5 | import '@css/Rules.css'; | 5 | import "@css/Rules.css"; |
| 6 | 6 | ||
| 7 | const Rules: React.FC = () => { | 7 | const Rules: React.FC = () => { |
| 8 | 8 | ||
| 9 | const [rulesText, setRulesText] = React.useState<string>(""); | 9 | const [rulesText, setRulesText] = React.useState<string>(""); |
| 10 | 10 | ||
| 11 | React.useEffect(() => { | 11 | React.useEffect(() => { |
| 12 | const fetchRules = async () => { | 12 | const fetchRules = async () => { |
| 13 | try { | 13 | try { |
| 14 | const response = await fetch( | 14 | const response = await fetch( |
| 15 | 'https://raw.githubusercontent.com/pektezol/lphub/main/RULES.md' | 15 | "https://raw.githubusercontent.com/pektezol/lphub/main/RULES.md" |
| 16 | ); | 16 | ); |
| 17 | if (!response.ok) { | 17 | if (!response.ok) { |
| 18 | throw new Error('Failed to fetch README'); | 18 | throw new Error("Failed to fetch README"); |
| 19 | } | 19 | } |
| 20 | const rulesText = await response.text(); | 20 | const rulesText = await response.text(); |
| 21 | setRulesText(rulesText); | 21 | setRulesText(rulesText); |
| 22 | } catch (error) { | 22 | } catch (error) { |
| 23 | console.error('Error fetching Rules:', error); | 23 | console.error("Error fetching Rules:", error); |
| 24 | } | 24 | } |
| 25 | // setRulesText(rulesText) | 25 | // setRulesText(rulesText) |
| 26 | }; | 26 | }; |
| 27 | fetchRules(); | 27 | fetchRules(); |
| 28 | }, []); | 28 | }, []); |
| 29 | 29 | ||
| 30 | 30 | ||
| 31 | return ( | 31 | return ( |
| 32 | <main> | 32 | <main> |
| 33 | <Helmet> | 33 | <Helmet> |
| 34 | <title>LPHUB | Rules</title> | 34 | <title>LPHUB | Rules</title> |
| 35 | </Helmet> | 35 | </Helmet> |
| 36 | <ReactMarkdown>{rulesText}</ReactMarkdown> | 36 | <ReactMarkdown>{rulesText}</ReactMarkdown> |
| 37 | </main> | 37 | </main> |
| 38 | ); | 38 | ); |
| 39 | }; | 39 | }; |
| 40 | 40 | ||
| 41 | export default Rules; | 41 | export default Rules; |