try subrouter
This commit is contained in:
parent
563a80c6ba
commit
bb6af73dcc
|
|
@ -10,7 +10,7 @@ import { MantineProvider } from '@mantine/styles'
|
||||||
import { Box } from '@mantine/core'
|
import { Box } from '@mantine/core'
|
||||||
import { theme } from '@/theme'
|
import { theme } from '@/theme'
|
||||||
|
|
||||||
const MY_FOLDER = '/orionreed.github.io'
|
const MY_FOLDER = '/orionreed'
|
||||||
class SubfolderRouter extends Router {
|
class SubfolderRouter extends Router {
|
||||||
render(props: RouterProps, state: any) {
|
render(props: RouterProps, state: any) {
|
||||||
if (state.url.indexOf(MY_FOLDER) === 0) {
|
if (state.url.indexOf(MY_FOLDER) === 0) {
|
||||||
|
|
@ -27,13 +27,13 @@ export function App() {
|
||||||
return (
|
return (
|
||||||
<MantineProvider withGlobalStyles withNormalizeCSS theme={theme}>
|
<MantineProvider withGlobalStyles withNormalizeCSS theme={theme}>
|
||||||
<Box mb="xl">
|
<Box mb="xl">
|
||||||
<Router>
|
<SubfolderRouter>
|
||||||
<Home path="/" />
|
<Home path="/" />
|
||||||
<Posts path="/posts" />
|
<Posts path="/posts" />
|
||||||
<Post path="/posts/:title" />
|
<Post path="/posts/:title" />
|
||||||
<Stream path="/stream" />
|
<Stream path="/stream" />
|
||||||
<NotFound default />
|
<NotFound default />
|
||||||
</Router>
|
</SubfolderRouter>
|
||||||
</Box>
|
</Box>
|
||||||
</MantineProvider>
|
</MantineProvider>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue