aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/pages/Rules.tsx
diff options
context:
space:
mode:
authorWolfboy248 <georgejvindkarlsen@gmail.com>2024-09-16 18:19:19 +0200
committerWolfboy248 <georgejvindkarlsen@gmail.com>2024-09-16 18:19:19 +0200
commit4c036c9a8bb39abe3bc10a30fdfcf53fb9613e21 (patch)
tree2162b11b64083aca965724f89e658164eec28f25 /frontend/src/pages/Rules.tsx
parentrefactor: rankings page (diff)
parentrefactor: proper game/map ordering (diff)
downloadlphub-4c036c9a8bb39abe3bc10a30fdfcf53fb9613e21.tar.gz
lphub-4c036c9a8bb39abe3bc10a30fdfcf53fb9613e21.tar.bz2
lphub-4c036c9a8bb39abe3bc10a30fdfcf53fb9613e21.zip
Rankings page
Diffstat (limited to 'frontend/src/pages/Rules.tsx')
-rw-r--r--frontend/src/pages/Rules.tsx37
1 files changed, 37 insertions, 0 deletions
diff --git a/frontend/src/pages/Rules.tsx b/frontend/src/pages/Rules.tsx
new file mode 100644
index 0000000..516b73c
--- /dev/null
+++ b/frontend/src/pages/Rules.tsx
@@ -0,0 +1,37 @@
1import React from 'react';
2import ReactMarkdown from 'react-markdown';
3
4import '../css/Rules.css';
5
6const Rules: React.FC = () => {
7
8 const [rulesText, setRulesText] = React.useState<string>("");
9
10 React.useEffect(() => {
11 const fetchRules = async () => {
12 try {
13 const response = await fetch(
14 'https://raw.githubusercontent.com/pektezol/leastportalshub/main/README.md'
15 );
16 if (!response.ok) {
17 throw new Error('Failed to fetch README');
18 }
19 const rulesText = await response.text();
20 setRulesText(rulesText);
21 } catch (error) {
22 console.error('Error fetching Rules:', error);
23 }
24 setRulesText(rulesText)
25 };
26 fetchRules();
27 }, []);
28
29
30 return (
31 <main>
32 <ReactMarkdown>{rulesText}</ReactMarkdown>
33 </main>
34 );
35};
36
37export default Rules;