diff options
| author | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2024-09-09 19:29:42 +0300 |
|---|---|---|
| committer | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2024-09-09 19:29:42 +0300 |
| commit | 89560a61bc6e41d86acaea596762eda2da38fe50 (patch) | |
| tree | 1cf4b7c73c17f045d3f4837b480ddf7a61230a94 /frontend/src/pages/About.tsx | |
| parent | refactor: rankings page (diff) | |
| download | lphub-89560a61bc6e41d86acaea596762eda2da38fe50.tar.gz lphub-89560a61bc6e41d86acaea596762eda2da38fe50.tar.bz2 lphub-89560a61bc6e41d86acaea596762eda2da38fe50.zip | |
refactor: upload run form, lots of random shit
Diffstat (limited to 'frontend/src/pages/About.tsx')
| -rw-r--r-- | frontend/src/pages/About.tsx | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/frontend/src/pages/About.tsx b/frontend/src/pages/About.tsx new file mode 100644 index 0000000..886808b --- /dev/null +++ b/frontend/src/pages/About.tsx | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | import React from 'react'; | ||
| 2 | import ReactMarkdown from 'react-markdown'; | ||
| 3 | |||
| 4 | import '../css/About.css'; | ||
| 5 | |||
| 6 | const About: React.FC = () => { | ||
| 7 | |||
| 8 | const [aboutText, setAboutText] = React.useState<string>(""); | ||
| 9 | |||
| 10 | React.useEffect(() => { | ||
| 11 | const fetchReadme = 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 readmeText = await response.text(); | ||
| 20 | setAboutText(readmeText); | ||
| 21 | } catch (error) { | ||
| 22 | console.error('Error fetching README:', error); | ||
| 23 | } | ||
| 24 | }; | ||
| 25 | fetchReadme(); | ||
| 26 | }, []); | ||
| 27 | |||
| 28 | |||
| 29 | return ( | ||
| 30 | <div id="about"> | ||
| 31 | <ReactMarkdown>{aboutText}</ReactMarkdown> | ||
| 32 | </div> | ||
| 33 | ); | ||
| 34 | }; | ||
| 35 | |||
| 36 | export default About; | ||