1
1
import React , { PropTypes } from 'react' ;
2
+ import { connect } from 'react-redux' ;
2
3
3
4
import Line from 'components/Line' ;
4
5
import PageBreak from 'components/PageBreak' ;
5
6
6
- const PageView = ( { lines, keys, currentVerse, options, isPlaying, audioActions } ) => {
7
+ const PageView = ( { lines, keys, currentVerse, options, isPlaying, audioActions, userAgent } ) => {
7
8
const elements = keys . map ( ( lineNum , index ) => {
8
9
const nextNum = keys [ index + 1 ] ;
9
10
const pageNum = lineNum . split ( '-' ) [ 0 ] ;
10
11
const line = lines [ lineNum ] ;
12
+ const renderText = userAgent . isChrome || userAgent . isOpera || userAgent . isBot ;
11
13
12
14
if ( index + 1 !== keys . length && pageNum !== nextNum . split ( '-' ) [ 0 ] ) {
13
15
return [
@@ -18,6 +20,7 @@ const PageView = ({ lines, keys, currentVerse, options, isPlaying, audioActions
18
20
tooltip = { options . tooltip }
19
21
audioActions = { audioActions }
20
22
isPlaying = { isPlaying }
23
+ useTextFont = { renderText }
21
24
/> ,
22
25
< PageBreak pageNum = { parseInt ( pageNum , 10 ) + 1 } />
23
26
] ;
@@ -31,6 +34,7 @@ const PageView = ({ lines, keys, currentVerse, options, isPlaying, audioActions
31
34
tooltip = { options . tooltip }
32
35
audioActions = { audioActions }
33
36
isPlaying = { isPlaying }
37
+ useTextFont = { renderText }
34
38
/>
35
39
) ;
36
40
} ) ;
@@ -47,7 +51,10 @@ PageView.propTypes = {
47
51
currentVerse : PropTypes . string ,
48
52
bookmarks : PropTypes . object . isRequired , // eslint-disable-line
49
53
options : PropTypes . object . isRequired , // eslint-disable-line
50
- isPlaying : PropTypes . bool
54
+ isPlaying : PropTypes . bool ,
55
+ userAgent : PropTypes . func
51
56
} ;
52
57
53
- export default PageView ;
58
+ export default connect ( state => ( {
59
+ userAgent : state . options . userAgent
60
+ } ) ) ( PageView ) ;
0 commit comments