Skip to content
This repository was archived by the owner on Jun 28, 2021. It is now read-only.

Commit 9b90557

Browse files
authored
Fix staging (#731)
* Fix search * Fixes #727 highlight word by word * Fixes #728 * ontop of master
1 parent 3440ea8 commit 9b90557

File tree

8 files changed

+20
-21
lines changed

8 files changed

+20
-21
lines changed

src/components/Audioplayer/Segments/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import Helmet from 'react-helmet';
44
import debug from 'helpers/debug';
55

66
class Segments extends Component {
7-
87
shouldComponentUpdate(nextProps) {
98
return [
109
this.props.currentVerse !== nextProps.currentVerse,

src/components/Audioplayer/index.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ export class Audioplayer extends Component {
5252
return false;
5353
}
5454

55-
// When you go directly to the chapter page, /2, the files are not loaded yet
56-
if (this.props.isLoadedOnClient !== nextProps.isLoadedOnClient) {
55+
// First load
56+
if (this.props.currentFile !== nextProps.currentFile) {
5757
return this.handleAddFileListeners(nextProps.currentFile);
5858
}
5959

@@ -384,7 +384,6 @@ export class Audioplayer extends Component {
384384
duration,
385385
chapter,
386386
isPlaying,
387-
isLoadedOnClient,
388387
repeat, // eslint-disable-line no-shadow
389388
shouldScroll, // eslint-disable-line no-shadow
390389
setRepeat // eslint-disable-line no-shadow
@@ -406,15 +405,15 @@ export class Audioplayer extends Component {
406405
return (
407406
<div className={`${isPlaying && style.isPlaying} ${style.container} ${className}`}>
408407
<div className={style.wrapper}>
409-
{isLoadedOnClient ?
408+
{
409+
currentFile &&
410410
<Track
411411
progress={(currentTime / duration) * 100}
412412
onTrackChange={this.handleTrackChange}
413-
/> : null}
413+
/>
414+
}
414415
{
415-
isLoadedOnClient &&
416416
segments &&
417-
segments[currentVerse] &&
418417
segments[currentVerse] &&
419418
<Segments
420419
segments={segments[currentVerse]}

src/components/ContentDropdown/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ class ContentDropdown extends Component {
6464
<Checkbox
6565
id={translation.id + translation.languageName}
6666
name="translation"
67-
checked={checked}
67+
checked={checked || false}
6868
handleChange={() => this.handleOptionSelected(translation.id)}
6969
>
70-
{render(translation)}
70+
<span>{render(translation)}</span>
7171
</Checkbox>
7272
</MenuItem>
7373
);

src/components/ReciterDropdown/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,13 @@ class ReciterDropdown extends Component {
2727
>
2828
<Radio
2929
checked={slug.id === audio}
30-
id={slug.id}
30+
id={`slug-${slug.id}`}
3131
name="reciter"
3232
handleChange={() => onOptionChange({ audio: slug.id })}
3333
>
34-
{slug.reciterNameEng} {slug.style ? `(${slug.style})` : ''}
34+
<span>
35+
{slug.reciterNameEng} {slug.style ? `(${slug.style})` : ''}
36+
</span>
3537
</Radio>
3638
</MenuItem>
3739
));

src/components/Verse/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ const Share = Loadable({
2424
});
2525

2626
class Verse extends Component {
27-
2827
// TODO: Should this belong here?
2928
componentDidMount() {
3029
const { verse, audio } = this.props;
@@ -145,7 +144,7 @@ class Verse extends Component {
145144
tooltip={tooltip}
146145
isPlaying={isPlaying}
147146
audioActions={audioActions}
148-
audioPosition={word.wordId ? wordAudioPosition += 1 : null}
147+
audioPosition={word.charType === 'word' ? wordAudioPosition += 1 : null}
149148
isSearched={isSearched}
150149
useTextFont={renderText}
151150
/>
@@ -316,7 +315,7 @@ Verse.propTypes = {
316315
currentWord: PropTypes.number, // gets passed in an integer, null by default
317316
iscurrentVerse: PropTypes.bool,
318317
currentVerse: PropTypes.string,
319-
userAgent: PropTypes.func,
318+
userAgent: PropTypes.object, // eslint-disable-line
320319
audio: PropTypes.number.isRequired,
321320
loadAudio: PropTypes.func.isRequired
322321
};

src/components/Verse/style.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@
2929
display: block;
3030
text-decoration: none;
3131
font-size: 12px;
32+
cursor: pointer;
3233

33-
&:hover{
34-
cursor: pointer;
34+
&:focus{
35+
color: $text-muted;
3536
}
3637
}
3738
.label{
@@ -142,4 +143,3 @@
142143
width: 100%;
143144
margin: 0px auto;
144145
}
145-

src/components/Word/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ const CHAR_TYPE_RUB = 'rub';
1010
const CHAR_TYPE_SAJDAH = 'sajdah';
1111

1212
class Word extends Component {
13-
1413
buildTooltip = (word, tooltip) => {
1514
let title;
1615

@@ -57,7 +56,7 @@ class Word extends Component {
5756
let spacer;
5857
const highlight = currentVerse === word.verseKey && isPlaying ? 'highlight' : '';
5958
const className = `${useTextFont ? 'text-' : ''}${word.charType === CHAR_TYPE_WORD ? word.className : 'p0'} ${word.charType} ${highlight} ${word.highlight ? word.highlight : ''}`;
60-
const id = `word-${word.verseKey.replace(/:/, '-')}-${audioPosition || word.position}`;
59+
const id = `word-${word.verseKey.replace(/:/, '-')}-${audioPosition}`;
6160

6261
if (word.charType === CHAR_TYPE_END) {
6362
text = zeroPad(word.verseKey.split(':')[1], 3, 0);
@@ -94,7 +93,7 @@ Word.propTypes = {
9493
tooltip: PropTypes.string,
9594
audioActions: PropTypes.object.isRequired, // eslint-disable-line
9695
audioPosition: PropTypes.number,
97-
currentVerse: PropTypes.string.isRequired,
96+
currentVerse: PropTypes.string,
9897
isPlaying: PropTypes.bool,
9998
isSearched: PropTypes.bool,
10099
useTextFont: PropTypes.bool // tmp change to compare text and code based rendering

src/containers/Search/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ class Search extends Component {
130130
match={entities[result].match}
131131
key={entities[result].verseKey}
132132
tooltip={options.tooltip}
133+
userAgent={options.userAgent}
133134
isSearched
134135
/>
135136
));

0 commit comments

Comments
 (0)