File tree Expand file tree Collapse file tree 3 files changed +44
-0
lines changed
Expand file tree Collapse file tree 3 files changed +44
-0
lines changed Original file line number Diff line number Diff line change 1+ import { AppGitHubTroubleshooting } from "@/components/libresplit/AppGitHubTroubleshooting" ;
2+
3+ export function Troubleshooting ( ) {
4+ return (
5+ < div >
6+ < AppGitHubTroubleshooting />
7+ </ div >
8+ ) ;
9+ }
Original file line number Diff line number Diff line change 1+ import { useEffect , useState } from "react" ;
2+
3+ import { AppLoading } from "./AppLoading" ;
4+ import { Markdown } from "@/lib/markdown" ;
5+
6+ export function AppGitHubTroubleshooting ( ) {
7+ const [ troubleshooting , setTroubleshooting ] = useState < string > ( "Loading..." ) ;
8+ const [ isLoading , setIsLoading ] = useState ( true ) ;
9+
10+ const urlTroubleshooting =
11+ "https://raw.githubusercontent.com/LibreSplit/LibreSplit/refs/heads/main/docs/troubleshooting.md" ;
12+
13+ useEffect ( ( ) => {
14+ fetch ( urlTroubleshooting )
15+ . then ( ( res ) => {
16+ if ( ! res . ok ) throw new Error ( `HTTP Error! Status: ${ res . status } ` ) ;
17+ return res . text ( ) ;
18+ } )
19+ . then ( ( text ) => setTroubleshooting ( text ) )
20+ . catch ( ( ) => setTroubleshooting ( "Failed to load README from GitHub." ) )
21+ . finally ( ( ) => setIsLoading ( false ) ) ;
22+ } , [ ] ) ;
23+
24+ if ( isLoading ) {
25+ return < AppLoading /> ;
26+ }
27+
28+ return (
29+ < div >
30+ < Markdown content = { troubleshooting } />
31+ </ div >
32+ ) ;
33+ }
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { Home } from "./app/home";
44import { NotFound } from "./app/not-found" ;
55import { SettingsKeybinds } from "./app/settings-keybinds" ;
66import { Themes } from "./app/themes" ;
7+ import { Troubleshooting } from "./app/troubleshooting" ;
78import { AppGitHubSplitFiles } from "./components/libresplit/AppGitHubSplitFiles" ;
89import { Route , Routes } from "react-router" ;
910
@@ -18,6 +19,7 @@ export default function AppRouter() {
1819 < Route path = "/docs/settings-keybinds.md" element = { < SettingsKeybinds /> } />
1920 < Route path = "/docs/split-files.md" element = { < AppGitHubSplitFiles /> } />
2021 < Route path = "/docs/themes.md" element = { < Themes /> } />
22+ < Route path = "/docs/troubleshooting.md" element = { < Troubleshooting /> } />
2123
2224 { /* Fall back on app's 404 page. This is because of the SPA routing trick with 404.html used in GitHub Pages. */ }
2325 < Route path = "*" element = { < NotFound /> } />
You can’t perform that action at this time.
0 commit comments