aboutsummaryrefslogtreecommitdiff
path: root/frontend/src
diff options
context:
space:
mode:
authorArda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>2023-07-20 00:31:36 +0300
committerArda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>2023-07-20 00:31:36 +0300
commit887ec4af81dd56b798e360194299eea6b81d99ac (patch)
tree38c241ed4ad696636447e704a599ce35536d204e /frontend/src
parentquick link fix (diff)
downloadlphub-887ec4af81dd56b798e360194299eea6b81d99ac.tar.gz
lphub-887ec4af81dd56b798e360194299eea6b81d99ac.tar.bz2
lphub-887ec4af81dd56b798e360194299eea6b81d99ac.zip
feat: about page
Former-commit-id: 103850ab3128cf9042565a59b216cd2dac553682
Diffstat (limited to 'frontend/src')
-rw-r--r--frontend/src/App.js3
-rw-r--r--frontend/src/components/pages/about.css17
-rw-r--r--frontend/src/components/pages/about.js32
3 files changed, 51 insertions, 1 deletions
diff --git a/frontend/src/App.js b/frontend/src/App.js
index c1745a7..d75636f 100644
--- a/frontend/src/App.js
+++ b/frontend/src/App.js
@@ -6,6 +6,7 @@ import Main from "./components/main.js"
6import "./App.css"; 6import "./App.css";
7 7
8import Summary from "./components/pages/summary.js" 8import Summary from "./components/pages/summary.js"
9import About from './components/pages/about.js';
9 10
10 11
11export default function App() { 12export default function App() {
@@ -31,7 +32,7 @@ export default function App() {
31 <Route path="/scorelog" element={<Main text="Score logs"/>}></Route> 32 <Route path="/scorelog" element={<Main text="Score logs"/>}></Route>
32 <Route path="/profile" element={<Main text="Profile"/>}></Route> 33 <Route path="/profile" element={<Main text="Profile"/>}></Route>
33 <Route path="/rules" element={<Main text="Rules"/>}></Route> 34 <Route path="/rules" element={<Main text="Rules"/>}></Route>
34 <Route path="/about" element={<Main text="About"/>}></Route> 35 <Route path="/about" element={<About/>}></Route>
35 <Route path="/maps/*" element={<Summary token={token} mod={mod}/>}></Route> 36 <Route path="/maps/*" element={<Summary token={token} mod={mod}/>}></Route>
36 <Route path="*" element={<Main text="404 Page not found"/>}></Route> 37 <Route path="*" element={<Main text="404 Page not found"/>}></Route>
37 </Routes> 38 </Routes>
diff --git a/frontend/src/components/pages/about.css b/frontend/src/components/pages/about.css
new file mode 100644
index 0000000..0dec300
--- /dev/null
+++ b/frontend/src/components/pages/about.css
@@ -0,0 +1,17 @@
1
2#about {
3 overflow: auto;
4 overflow-x: hidden;
5 position: relative;
6
7 width: calc(100% - 380px);
8 height: 100vh;
9 left: 350px;
10
11 padding-right: 30px;
12
13 font-size: 40px;
14 font-family: BarlowSemiCondensed-Regular;
15 color: #cdcfdf;
16
17}
diff --git a/frontend/src/components/pages/about.js b/frontend/src/components/pages/about.js
new file mode 100644
index 0000000..a265006
--- /dev/null
+++ b/frontend/src/components/pages/about.js
@@ -0,0 +1,32 @@
1import React, { useState, useEffect } from 'react';
2import ReactMarkdown from 'react-markdown';
3
4import "./about.css";
5
6export default function About() {
7 const [aboutText, setAboutText] = useState('');
8
9 useEffect(() => {
10 const fetchReadme = async () => {
11 try {
12 const response = await fetch(
13 'https://raw.githubusercontent.com/pektezol/LeastPortals/main/README.md'
14 );
15 if (!response.ok) {
16 throw new Error('Failed to fetch README');
17 }
18 const readmeText = await response.text();
19 setAboutText(readmeText);
20 } catch (error) {
21 console.error('Error fetching README:', error);
22 }
23 };
24 fetchReadme();
25 }, []);
26
27 return (
28 <div id="about">
29 <ReactMarkdown>{aboutText}</ReactMarkdown>
30 </div>
31 );
32};