-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
47 lines (39 loc) · 1.06 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import React from 'react'
import ReactDOM from 'react-dom'
import { Provider } from 'redux/react'
import { createDispatcher, createRedux, composeStores } from 'redux'
import { Router, Route } from 'react-router'
import { history } from 'react-router/lib/HashHistory'
import * as stores from './lib/stores'
import scanners from './lib/scanners'
import { thunkMiddleware, loggerMiddleware } from './lib/middleware'
const dispatcher = createDispatcher(
composeStores(stores),
getState => [ thunkMiddleware(getState), loggerMiddleware ]
)
const redux = createRedux(dispatcher)
// base background
// controls
// app
var App = React.createClass({
render () {
var query = this.props.location.query
console.dir(this.props)
var scanner = scanners[0]
return (
<div>
<audio id='scan1' src={ scanner.url } autoPlay />
</div>
)
}
})
let routes = (
<Router history={ history }>
<Route path='/' component={ App } />
</Router>
)
ReactDOM.render((
<Provider redux={ redux }>
{ () => routes }
</Provider>
), document.getElementById('app'))