@@ -16,6 +16,7 @@ import ReciterDropdown from 'components/ReciterDropdown';
1616import SurahsDropdown from 'components/SurahsDropdown' ;
1717import VersesDropdown from 'components/VersesDropdown' ;
1818import FontSizeDropdown from 'components/FontSizeDropdown' ;
19+ import TooltipDropdown from 'components/TooltipDropdown' ;
1920import InformationToggle from 'components/InformationToggle' ;
2021import SurahInfo from 'components/SurahInfo' ;
2122import Header from './Header' ;
@@ -186,18 +187,6 @@ export default class Surah extends Component {
186187 return loadAyahs ( surah . id , from , to , Object . assign ( { } , options , payload ) ) ;
187188 }
188189
189- handleFontSizeChange = ( payload ) => {
190- const { setOption } = this . props ; // eslint-disable-line no-shadow
191-
192- return setOption ( payload ) ;
193- }
194-
195- handleSurahInfoToggle = ( payload ) => {
196- const { setOption } = this . props ; // eslint-disable-line no-shadow
197-
198- return setOption ( payload ) ;
199- }
200-
201190 handleNavbar = ( ) => {
202191 // TODO: This should be done with react!
203192 if ( window . pageYOffset > lastScroll ) {
@@ -338,19 +327,20 @@ export default class Surah extends Component {
338327 }
339328
340329 renderAyahs ( ) {
341- const { ayahs, setCurrentWord } = this . props ; // eslint-disable-line no-shadow
330+ const { ayahs, setCurrentWord, options } = this . props ; // eslint-disable-line no-shadow
342331
343332 return Object . values ( ayahs ) . map ( ayah => (
344333 < Ayah
345334 ayah = { ayah }
335+ tooltip = { options . tooltip }
346336 onWordClick = { setCurrentWord }
347337 key = { `${ ayah . surahId } -${ ayah . ayahNum } -ayah` }
348338 />
349339 ) ) ;
350340 }
351341
352342 renderLines ( ) {
353- const { lines } = this . props ;
343+ const { lines, options } = this . props ;
354344 const keys = Object . keys ( lines ) ;
355345
356346 return keys . map ( ( lineNum , index ) => {
@@ -360,33 +350,45 @@ export default class Surah extends Component {
360350
361351 if ( index + 1 !== keys . length && pageNum !== nextNum . split ( '-' ) [ 0 ] ) {
362352 return [
363- < Line line = { line } key = { lineNum } /> ,
353+ < Line line = { line } key = { lineNum } tooltip = { options . tooltip } /> ,
364354 < PageBreak pageNum = { parseInt ( pageNum , 10 ) + 1 } />
365355 ] ;
366356 }
367357
368- return < Line line = { line } key = { lineNum } /> ;
358+ return < Line line = { line } key = { lineNum } tooltip = { options . tooltip } /> ;
369359 } ) ;
370360 }
371361
372362 renderTopOptions ( ) {
373- const { toggleReadingMode, options, surah } = this . props ; // eslint-disable-line no-shadow
363+ const {
364+ toggleReadingMode, // eslint-disable-line no-shadow
365+ options,
366+ surah,
367+ setOption // eslint-disable-line no-shadow
368+ } = this . props ;
374369
375370 return (
376371 < Row >
377372 < Col md = { 6 } mdOffset = { 6 } className = "text-right" >
378373 < ul className = "list-inline" >
379374 < li >
380375 < InformationToggle
381- onToggle = { this . handleSurahInfoToggle }
376+ onToggle = { setOption }
382377 isShowingSurahInfo = { options . isShowingSurahInfo }
383378 />
384379 </ li >
385380 < li > |</ li >
386381 < li >
387382 < FontSizeDropdown
388383 options = { options }
389- onOptionChange = { this . handleFontSizeChange }
384+ onOptionChange = { setOption }
385+ />
386+ </ li >
387+ < li > |</ li >
388+ < li >
389+ < TooltipDropdown
390+ options = { options }
391+ onOptionChange = { setOption }
390392 />
391393 </ li >
392394 < li > |</ li >
0 commit comments