aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/pages
diff options
context:
space:
mode:
authorNidboj132 <28981031+Nidboj132@users.noreply.github.com>2024-09-14 18:02:38 +0200
committerNidboj132 <28981031+Nidboj132@users.noreply.github.com>2024-09-14 18:02:38 +0200
commitb0bddd40b9743f78d48a45ae802fbe4ac3a59961 (patch)
tree932524a95b7510f1fe31ffbb356c3670e795b7e0 /frontend/src/pages
parentrefactor: unofficial rankings implementation (diff)
downloadlphub-b0bddd40b9743f78d48a45ae802fbe4ac3a59961.tar.gz
lphub-b0bddd40b9743f78d48a45ae802fbe4ac3a59961.tar.bz2
lphub-b0bddd40b9743f78d48a45ae802fbe4ac3a59961.zip
refactor: rules
Diffstat (limited to 'frontend/src/pages')
-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;