Initial commit
This commit is contained in:
28
frontend/src/app.js
Normal file
28
frontend/src/app.js
Normal file
@ -0,0 +1,28 @@
|
||||
|
||||
import { Component, Fragment } from 'react'
|
||||
import { hot } from 'react-hot-loader'
|
||||
import { HashRouter } from 'react-router-dom' // ou BrowserRouter
|
||||
import { Route, Switch, Redirect } from 'react-router'
|
||||
import LoginPage from './pages/login';
|
||||
import ChatPage from './pages/chat';
|
||||
|
||||
require('bulma/css/bulma.min.css')
|
||||
|
||||
class App extends Component {
|
||||
render () {
|
||||
return (
|
||||
<Fragment>
|
||||
<HashRouter>
|
||||
<Switch>
|
||||
<Route path='/login' exact component={LoginPage} />
|
||||
<Route path='/chat/:channel' component={ChatPage} />
|
||||
<Route path='/chat' component={ChatPage} />
|
||||
<Route component={() => <Redirect to="/login" />} />
|
||||
</Switch>
|
||||
</HashRouter>
|
||||
</Fragment>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default hot(module)(App)
|
Reference in New Issue
Block a user