mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-15 07:34:42 -04:00
added redirector component (#199)
* added redirector component * it will redirect every request to /$something that is not handled otherwise (/intro, /login and such) to /n/$something * added getNote API Call * added NotFound component * added LandingLayout around the NotFound component, so users can easily navigate away from the component Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
773fc60f07
commit
c679f5524c
5 changed files with 85 additions and 0 deletions
|
@ -4,6 +4,7 @@ import { Provider } from 'react-redux'
|
|||
import { BrowserRouter as Router, Redirect, Route, Switch } from 'react-router-dom'
|
||||
import { ApplicationLoader } from './components/application-loader/application-loader'
|
||||
import { Editor } from './components/editor/editor'
|
||||
import { NotFound } from './components/error/not-found'
|
||||
import { LandingLayout } from './components/landing/landing-layout'
|
||||
import { History } from './components/landing/pages/history/history'
|
||||
import { Intro } from './components/landing/pages/intro/intro'
|
||||
|
@ -12,6 +13,7 @@ import { Profile } from './components/landing/pages/profile/profile'
|
|||
import './global-style/index.scss'
|
||||
import * as serviceWorker from './service-worker'
|
||||
import { store } from './utils/store'
|
||||
import { Redirector } from './components/redirector/redirector'
|
||||
|
||||
ReactDOM.render(
|
||||
<Provider store={store}>
|
||||
|
@ -41,9 +43,15 @@ ReactDOM.render(
|
|||
<Route path="/n/:id">
|
||||
<Editor/>
|
||||
</Route>
|
||||
<Route path="/:id">
|
||||
<Redirector/>
|
||||
</Route>
|
||||
<Route path="/">
|
||||
<Redirect to="/intro"/>
|
||||
</Route>
|
||||
<Route>
|
||||
<NotFound/>
|
||||
</Route>
|
||||
</Switch>
|
||||
</ApplicationLoader>
|
||||
</Router>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue