11import React , { PropTypes } from 'react' ;
2+ import { connect } from 'react-redux' ;
23
34import Line from 'components/Line' ;
45import PageBreak from 'components/PageBreak' ;
56
6- const PageView = ( { lines, keys, currentVerse, options, isPlaying, audioActions } ) => {
7+ const PageView = ( { lines, keys, currentVerse, options, isPlaying, audioActions, userAgent } ) => {
78 const elements = keys . map ( ( lineNum , index ) => {
89 const nextNum = keys [ index + 1 ] ;
910 const pageNum = lineNum . split ( '-' ) [ 0 ] ;
1011 const line = lines [ lineNum ] ;
12+ const renderText = userAgent . isChrome || userAgent . isOpera || userAgent . isBot ;
1113
1214 if ( index + 1 !== keys . length && pageNum !== nextNum . split ( '-' ) [ 0 ] ) {
1315 return [
@@ -18,6 +20,7 @@ const PageView = ({ lines, keys, currentVerse, options, isPlaying, audioActions
1820 tooltip = { options . tooltip }
1921 audioActions = { audioActions }
2022 isPlaying = { isPlaying }
23+ useTextFont = { renderText }
2124 /> ,
2225 < PageBreak pageNum = { parseInt ( pageNum , 10 ) + 1 } />
2326 ] ;
@@ -31,6 +34,7 @@ const PageView = ({ lines, keys, currentVerse, options, isPlaying, audioActions
3134 tooltip = { options . tooltip }
3235 audioActions = { audioActions }
3336 isPlaying = { isPlaying }
37+ useTextFont = { renderText }
3438 />
3539 ) ;
3640 } ) ;
@@ -47,7 +51,10 @@ PageView.propTypes = {
4751 currentVerse : PropTypes . string ,
4852 bookmarks : PropTypes . object . isRequired , // eslint-disable-line
4953 options : PropTypes . object . isRequired , // eslint-disable-line
50- isPlaying : PropTypes . bool
54+ isPlaying : PropTypes . bool ,
55+ userAgent : PropTypes . func
5156} ;
5257
53- export default PageView ;
58+ export default connect ( state => ( {
59+ userAgent : state . options . userAgent
60+ } ) ) ( PageView ) ;
0 commit comments