import * as React from 'react' ; import { render } from "react-dom" ; import { Provider } from 'react-redux' ; import * as Redux from 'redux' ; import { CompactdState } from 'definitions' ; import { Route , Switch , Redirect } from 'react-router-dom' ; import { ConnectedRouter } from 'react-router-redux' ; import { history } from './CompactdStore' ; import AppView from 'features/app/components/AppView' ; import { ArtistsView } from 'features/library/components/ArtistsView' ; import { HolisticView } from 'features/library/components/HolisticView' ; import LibraryView from 'features/library/components/LibraryView' ; import PlayerView from 'features/player/components/PlayerView' ; import { PlaylistView } from 'features/player/components/PlaylistView' ; import { PlayerStatus } from 'features/player/components/PlayerStatus' ; import Sandbox from 'components/Sandbox' ; const { Flex , Box } = require ( 'reflexbox' ) ; require ( '../styles/base.scss' ) ; interface CompactdApplicationProps { store : Redux . Store < CompactdState > ; } const doNothing = ( ... args ) => { return ( args ) ; } ; export class CompactdApplication extends React . Component < CompactdApplicationProps , { } > { render ( ) { doNothing ( Route , LibraryView , HolisticView , PlayerView , PlaylistView , PlayerStatus , Sandbox ) ; return ( < Provider store = { this . props . store } > < ConnectedRouter history = { history } > < AppView { ... this . props as any } > < PlayerView component = { PlayerStatus } /> < Flex > < Box col = { 10 } > < Switch > < Route exact path = "/" children = { < Redirect to = "/library" / > } /> < Route path = "/library/all/:artist?/:album?" children = { ( props ) => < LibraryView component = { HolisticView } all = { true } { ... props } />}/ > < Route path = "/library/:artist?/:album?" children = { ( props ) => < LibraryView component = { HolisticView } { ... props } />}/ > < Route path = "/sandbox" children = { ( props ) => < Sandbox { ... props } / > } /> < /Switch> < /Box> < Box col = { 2 } style = { { backgroundColor : '#fff' , boxShadow : '0 0 4px rgba(0, 0, 0, 0.2)' } } > < PlayerView component = { PlaylistView } /> < /Box> < /Flex> < /AppView> < /ConnectedRouter> < /Provider>); } }