1- import React from 'react'
2- import PropTypes from 'prop-types'
3- import { HashRouter as Router , Route } from 'react-router-dom'
4- import { withStyles , createMuiTheme } from 'material-ui/styles'
5- import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'
1+ // @flow
2+ import React , { Component } from 'react'
3+ import { Route , HashRouter as Router } from 'react-router-dom'
4+ import { createMuiTheme , withStyles } from 'material-ui/styles'
65
7- import StartScene from './StartScene'
86import BuyScene from './BuyScene'
9- import PaymentsScene from './PaymentsScene'
107import EventsScene from './EventsScene'
8+ import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'
9+ import { PendingSellFromURL } from './components'
10+ import SellScene from './SellScene'
11+ import StartScene from './StartScene'
12+ import TransactionsScene from './TransactionsScene'
1113
1214const theme = createMuiTheme ( {
1315 palette : {
@@ -21,46 +23,63 @@ const theme = createMuiTheme({
2123 typography : {
2224 fontFamily : "'Source Sans Pro', sans-serif !important"
2325 } ,
24- shadows : [ 'none' ]
26+ shadows : Array ( 25 ) . fill ( 'none' )
2527} )
2628
27- export const routes = [ {
28- path : '/' ,
29- main : StartScene ,
30- exact : true
31- } , {
32- path : '/buy/' ,
33- main : BuyScene ,
34- exact : true
35- } , {
36- path : '/payments/' ,
37- main : PaymentsScene ,
38- exact : true
39- } , {
40- path : '/events/:paymentId/' ,
41- main : EventsScene ,
42- exact : true
43- } ]
29+ export const routes = [
30+ {
31+ path : '/' ,
32+ main : StartScene ,
33+ exact : true
34+ } ,
35+ {
36+ path : '/buy/' ,
37+ main : BuyScene ,
38+ exact : true
39+ } ,
40+ {
41+ path : '/sell/' ,
42+ main : SellScene ,
43+ exact : true
44+ } ,
45+ {
46+ path : '/sell/execution-orders/:executionOrderId' ,
47+ main : PendingSellFromURL ,
48+ exact : true
49+ } ,
50+ {
51+ path : '/transactions/' ,
52+ main : TransactionsScene ,
53+ exact : true
54+ } ,
55+ {
56+ path : '/:type/events/:transactionId/' ,
57+ main : EventsScene ,
58+ exact : true
59+ }
60+ ]
4461
45- const appStyles = ( theme ) => ( {
62+ const appStyles = theme => ( {
4663 content : {
47- height : '100%'
64+ height : '100%' ,
65+ display : 'flex' ,
66+ flexDirection : 'column'
4867 }
4968} )
5069
51- class App extends React . Component {
70+ type Props = {
71+ classes : Object
72+ }
73+ type State = { }
74+
75+ class App extends Component < Props , State > {
5276 render ( ) {
5377 return (
5478 < MuiThemeProvider theme = { theme } >
5579 < Router >
5680 < div className = { this . props . classes . content } >
5781 { routes . map ( ( route , index ) => (
58- < Route
59- key = { index }
60- path = { route . path }
61- exact = { route . exact }
62- component = { route . main }
63- />
82+ < Route key = { index } path = { route . path } exact = { route . exact } component = { route . main } />
6483 ) ) }
6584 </ div >
6685 </ Router >
@@ -69,8 +88,4 @@ class App extends React.Component {
6988 }
7089}
7190
72- App . propTypes = {
73- classes : PropTypes . object
74- }
75-
7691export default withStyles ( appStyles ) ( App )
0 commit comments