2018-11-27 21:29:56 +00:00
|
|
|
import { render, Component } from 'inferno';
|
2018-11-28 01:16:29 +00:00
|
|
|
import { HashRouter, Route, Switch } from 'inferno-router';
|
2018-10-11 21:59:30 +00:00
|
|
|
|
2018-11-27 21:29:56 +00:00
|
|
|
import { Navbar } from './components/navbar';
|
|
|
|
import { Home } from './components/home';
|
|
|
|
import { Search } from './components/search';
|
2018-10-11 21:59:30 +00:00
|
|
|
|
|
|
|
import './Main.css';
|
|
|
|
|
|
|
|
const container = document.getElementById('app');
|
|
|
|
|
2018-11-27 21:29:56 +00:00
|
|
|
class Index extends Component<any, any> {
|
2018-10-11 22:20:17 +00:00
|
|
|
render() {
|
|
|
|
return (
|
2018-11-27 21:29:56 +00:00
|
|
|
<HashRouter>
|
|
|
|
<div>
|
|
|
|
<Navbar />
|
|
|
|
<Switch>
|
|
|
|
<Route exact path="/" component={Home} />
|
|
|
|
<Route path={`/search/:q/:page`} component={Search} />
|
|
|
|
</Switch>
|
2018-10-11 22:20:17 +00:00
|
|
|
</div>
|
2018-11-27 21:29:56 +00:00
|
|
|
</HashRouter>
|
|
|
|
)
|
2018-10-11 22:20:17 +00:00
|
|
|
}
|
2018-10-11 21:59:30 +00:00
|
|
|
}
|
2018-11-27 21:29:56 +00:00
|
|
|
render(<Index />, container);
|