diff options
| -rw-r--r-- | frontend/src/App.js | 3 | ||||
| -rw-r--r-- | frontend/src/components/pages/about.css | 17 | ||||
| -rw-r--r-- | frontend/src/components/pages/about.js | 32 |
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" | |||
| 6 | import "./App.css"; | 6 | import "./App.css"; |
| 7 | 7 | ||
| 8 | import Summary from "./components/pages/summary.js" | 8 | import Summary from "./components/pages/summary.js" |
| 9 | import About from './components/pages/about.js'; | ||
| 9 | 10 | ||
| 10 | 11 | ||
| 11 | export default function App() { | 12 | export 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 @@ | |||
| 1 | import React, { useState, useEffect } from 'react'; | ||
| 2 | import ReactMarkdown from 'react-markdown'; | ||
| 3 | |||
| 4 | import "./about.css"; | ||
| 5 | |||
| 6 | export 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 | }; | ||