try subrouter

This commit is contained in:
Orion Reed 2023-08-12 21:11:27 +01:00
parent 563a80c6ba
commit bb6af73dcc
1 changed files with 3 additions and 3 deletions

View File

@ -10,7 +10,7 @@ import { MantineProvider } from '@mantine/styles'
import { Box } from '@mantine/core'
import { theme } from '@/theme'
const MY_FOLDER = '/orionreed.github.io'
const MY_FOLDER = '/orionreed'
class SubfolderRouter extends Router {
render(props: RouterProps, state: any) {
if (state.url.indexOf(MY_FOLDER) === 0) {
@ -27,13 +27,13 @@ export function App() {
return (
<MantineProvider withGlobalStyles withNormalizeCSS theme={theme}>
<Box mb="xl">
<Router>
<SubfolderRouter>
<Home path="/" />
<Posts path="/posts" />
<Post path="/posts/:title" />
<Stream path="/stream" />
<NotFound default />
</Router>
</SubfolderRouter>
</Box>
</MantineProvider>
)