File tree Expand file tree Collapse file tree 3 files changed +46
-0
lines changed
Expand file tree Collapse file tree 3 files changed +46
-0
lines changed Original file line number Diff line number Diff line change 1+ import { AppGitHubSettingsKeybinds } from "@/components/libresplit/AppGitHubSettingsKeybinds" ;
2+
3+ export function SettingsKeybinds ( ) {
4+ return (
5+ < div >
6+ < AppGitHubSettingsKeybinds />
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 AppGitHubSettingsKeybinds ( ) {
7+ const [ settingsKeybinds , setSettingsKeybinds ] =
8+ useState < string > ( "Loading..." ) ;
9+ const [ isLoading , setIsLoading ] = useState ( true ) ;
10+
11+ const urlSettingsKeybinds =
12+ "https://raw.githubusercontent.com/LibreSplit/LibreSplit/refs/heads/main/docs/settings-keybinds.md" ;
13+
14+ // Fetch markdown from GitHub page for LibreSplit, place into the readme state.
15+ useEffect ( ( ) => {
16+ fetch ( urlSettingsKeybinds )
17+ . then ( ( res ) => {
18+ if ( ! res . ok ) throw new Error ( `HTTP Error! Status: ${ res . status } ` ) ;
19+ return res . text ( ) ;
20+ } )
21+ . then ( ( text ) => setSettingsKeybinds ( text ) )
22+ . catch ( ( ) => setSettingsKeybinds ( "Failed to load README from GitHub." ) )
23+ . finally ( ( ) => setIsLoading ( false ) ) ;
24+ } , [ ] ) ;
25+
26+ if ( isLoading ) {
27+ return < AppLoading /> ;
28+ }
29+
30+ return (
31+ < div >
32+ < Markdown content = { settingsKeybinds } />
33+ </ div >
34+ ) ;
35+ }
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { AutoSplitters } from "./app/auto-splitters";
22import { Converter } from "./app/converter" ;
33import { Home } from "./app/home" ;
44import { NotFound } from "./app/not-found" ;
5+ import { SettingsKeybinds } from "./app/settings-keybinds" ;
56import { Themes } from "./app/themes" ;
67import { Route , Routes } from "react-router" ;
78
@@ -13,6 +14,7 @@ export default function AppRouter() {
1314
1415 { /* Documentation Pages */ }
1516 < Route path = "/docs/auto-splitters.md" element = { < AutoSplitters /> } />
17+ < Route path = "/docs/settings-keybinds.md" element = { < SettingsKeybinds /> } />
1618 < Route path = "/docs/themes.md" element = { < Themes /> } />
1719
1820 { /* Fall back on app's 404 page. This is because of the SPA routing trick with 404.html used in GitHub Pages. */ }
You can’t perform that action at this time.
0 commit comments