mirror of
https://github.com/He4eT/elseifplayer.git
synced 2026-05-04 17:07:22 +00:00
Bootstrap app
This commit is contained in:
parent
66690ed4e0
commit
5f5d23f4de
3 changed files with 66 additions and 2 deletions
40
src/index.js
Normal file
40
src/index.js
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
import { h, render } from 'preact'
|
||||
import {
|
||||
Redirect, Switch, Route, Link, Router
|
||||
} from 'wouter-preact'
|
||||
|
||||
import { useHashLocation } from '/src/utils/utils.routing'
|
||||
|
||||
function App () {
|
||||
return (
|
||||
<Router hook={useHashLocation}>
|
||||
<div className='App'>
|
||||
<nav>
|
||||
<Link href='/'>Root</Link>
|
||||
<Link href='/#/about'>About</Link>
|
||||
<Link href='/#/info'>Redirect</Link>
|
||||
<Link href='/#/404'>404</Link>
|
||||
</nav>
|
||||
|
||||
<main>
|
||||
<Switch>
|
||||
<Route path='/'>
|
||||
Root
|
||||
</Route>
|
||||
<Route path='/about'>
|
||||
About
|
||||
</Route>
|
||||
<Route path='/info'>
|
||||
<Redirect to='/about' />
|
||||
</Route>
|
||||
<Route path='/:anything*'>
|
||||
404
|
||||
</Route>
|
||||
</Switch>
|
||||
</main>
|
||||
</div>
|
||||
</Router>
|
||||
)
|
||||
}
|
||||
|
||||
render(<App />, document.getElementById('root'))
|
||||
Loading…
Add table
Add a link
Reference in a new issue