2018-11-27 21:29:56 +00:00
|
|
|
import { render, Component } from 'inferno';
|
|
|
|
import { HashRouter, Route, Switch, Link } 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);
|