-
Notifications
You must be signed in to change notification settings - Fork 13
/
Runner.js
54 lines (50 loc) · 1.34 KB
/
Runner.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
48
49
50
51
52
53
54
import React from 'react'
import FontAwesome from 'react-fontawesome'
import { connect } from 'react-redux'
import { Link } from 'react-router-dom'
import Details from '../components/Details'
import Header from '../components/Header'
import { stringifyConfig } from '../config'
import VideoPlayer from './VideoPlayer'
const Runner = ({
config,
vastLoaded,
mediaFileIsVpaid,
hasVerificationScripts
}) =>
config == null
? null
: (
<main className="runner">
<Header />
<div className="contents">
<VideoPlayer />
<Details
logOnly={!vastLoaded}
vpaidEnabled={mediaFileIsVpaid}
verificationEnabled={hasVerificationScripts}
/>
</div>
<div className="actions">
<nav>
<ul>
<li>
<Link to={{ pathname: '/', search: stringifyConfig(config) }}>
<FontAwesome name="arrow-left" /> New Test
</Link>
</li>
</ul>
</nav>
</div>
</main>
)
const mapStateToProps = ({
config,
vast: { chain, mediaFile, verifications }
}) => ({
config,
vastLoaded: chain != null,
mediaFileIsVpaid: mediaFile != null && mediaFile.apiFramework === 'VPAID',
hasVerificationScripts: verifications != null && verifications.length > 0
})
export default connect(mapStateToProps)(Runner)