40 lines
1.3 KiB
TypeScript
40 lines
1.3 KiB
TypeScript
import React, {FunctionComponent} from 'react';
|
|
import './App.scss';
|
|
import {BrowserRouter as Router, Route, Switch, Redirect} from 'react-router-dom';
|
|
|
|
import {library} from "@fortawesome/fontawesome-svg-core";
|
|
import {faArrowCircleLeft, faArrowCircleRight} from "@fortawesome/free-solid-svg-icons";
|
|
import MainPage, {IMainPageProps} from "./pages/MainPage/MainPage";
|
|
|
|
library.add(faArrowCircleLeft, faArrowCircleRight)
|
|
|
|
const App: FunctionComponent = () => (
|
|
<Router>
|
|
<Switch>
|
|
{/*<Route exact path={'/'} component={(props: IMainPageProps) => (<MainPage {...props}/>)} />*/}
|
|
<Route path={'/season/:id'} component={(props: IMainPageProps) => (<MainPage {...props}/>)} />
|
|
<Redirect to={'/season'} />
|
|
</Switch>
|
|
</Router>
|
|
);
|
|
|
|
export default App;
|
|
|
|
|
|
// export default class App extends React.Component {
|
|
|
|
// componentDidMount() {
|
|
// this.setState({loading: false, mock: this.mockService.getStatsWithoutPromise()});
|
|
// this.apiService.getStats()
|
|
// .then(data => this.setState({
|
|
// isLoaded: true,
|
|
// users: data
|
|
// }))
|
|
// .catch(error => {
|
|
// error.response.json()
|
|
// .then((err: any) => this.setState({
|
|
// isLoaded: true,
|
|
// error: err.error
|
|
// }))
|
|
// });
|
|
// }
|