2019-01-23 11:15:27 +01:00
|
|
|
import React, { Component } from 'react'
|
2019-02-08 13:29:29 +01:00
|
|
|
import { BrowserRouter as Router } from 'react-router-dom'
|
2019-03-25 18:03:49 +01:00
|
|
|
import Header from './components/organisms/Header'
|
|
|
|
import Footer from './components/organisms/Footer'
|
2019-02-13 12:39:04 +01:00
|
|
|
import Spinner from './components/atoms/Spinner'
|
2019-04-15 11:40:25 +02:00
|
|
|
import { User } from './context'
|
2019-01-30 17:33:56 +01:00
|
|
|
import Routes from './Routes'
|
2019-01-23 13:03:41 +01:00
|
|
|
import './styles/global.scss'
|
2019-02-08 13:29:29 +01:00
|
|
|
import styles from './App.module.scss'
|
2019-01-23 13:03:41 +01:00
|
|
|
|
2019-04-15 11:40:25 +02:00
|
|
|
export default class App extends Component {
|
2019-02-08 13:29:29 +01:00
|
|
|
public render() {
|
|
|
|
return (
|
2019-04-30 19:19:28 +02:00
|
|
|
<div className={styles.app}>
|
|
|
|
<Router>
|
|
|
|
<>
|
|
|
|
<Header />
|
2019-02-08 14:06:55 +01:00
|
|
|
|
2019-04-30 19:19:28 +02:00
|
|
|
<main className={styles.main}>
|
|
|
|
{this.context.isLoading ? (
|
|
|
|
<div className={styles.loader}>
|
|
|
|
<Spinner message={this.context.message} />
|
|
|
|
</div>
|
|
|
|
) : (
|
|
|
|
<Routes />
|
|
|
|
)}
|
|
|
|
</main>
|
2019-02-08 14:06:55 +01:00
|
|
|
|
2019-04-30 19:19:28 +02:00
|
|
|
<Footer />
|
|
|
|
</>
|
|
|
|
</Router>
|
|
|
|
</div>
|
2019-02-08 13:29:29 +01:00
|
|
|
)
|
|
|
|
}
|
2019-01-18 17:34:40 +01:00
|
|
|
}
|
2019-04-30 19:19:28 +02:00
|
|
|
|
|
|
|
App.contextType = User
|