diff options
author | Dessalines <tyhou13@gmx.com> | 2019-03-20 18:22:31 -0700 |
---|---|---|
committer | Dessalines <tyhou13@gmx.com> | 2019-03-20 18:22:31 -0700 |
commit | 816aa0b15f3766e340d8722f03e8b3a7633ab6fb (patch) | |
tree | 23dd0fc329e8f08c71dc6f10dd398b35d92c047c /ui/src/index.tsx | |
parent | 064d7f84b25236195eeb33a8671935bc9df37e57 (diff) |
Adding initial UI and Websocket server.
Diffstat (limited to 'ui/src/index.tsx')
-rw-r--r-- | ui/src/index.tsx | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/ui/src/index.tsx b/ui/src/index.tsx new file mode 100644 index 00000000..36e5681d --- /dev/null +++ b/ui/src/index.tsx @@ -0,0 +1,42 @@ +import { render, Component } from 'inferno'; +import { HashRouter, Route, Switch } from 'inferno-router'; + +import { Navbar } from './components/navbar'; +import { Home } from './components/home'; +import { Login } from './components/login'; + +import './main.css'; + +import { WebSocketService } from './services'; + +const container = document.getElementById('app'); + +class Index extends Component<any, any> { + + constructor(props, context) { + super(props, context); + WebSocketService.Instance; + } + + render() { + return ( + <HashRouter> + <Navbar /> + <div class="mt-3 p-0"> + <Switch> + <Route exact path="/" component={Home} /> + <Route path={`/login`} component={Login} /> + {/* + <Route path={`/search/:type_/:q/:page`} component={Search} /> + <Route path={`/submit`} component={Submit} /> + <Route path={`/user/:id`} component={Login} /> + <Route path={`/community/:id`} component={Login} /> + */} + </Switch> + </div> + </HashRouter> + ); + } +} + +render(<Index />, container); |