Skip to content
This repository was archived by the owner on Jun 28, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
…into word-by-word-audio
  • Loading branch information
naveed-ahmad committed Jan 10, 2017
commit 1c9be1dee23f5269163d607b1b15c99a2750d71e
25 changes: 19 additions & 6 deletions src/components/Ayah/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,25 @@ const CHAR_TYPE_SAJDAH = 5;
export default class Ayah extends Component {
static propTypes = {
isSearched: PropTypes.bool,
ayah: PropTypes.object.isRequired,
bookmarked: PropTypes.bool.isRequired,
mediaActions: PropTypes.object.isRequired,
bookmarkActions: PropTypes.object,
match: PropTypes.array,
isSearch: PropTypes.bool,
ayah: ayahType.isRequired,
bookmarked: PropTypes.bool, // TODO: Add this for search
bookmarkActions: PropTypes.shape({
isLoaded: PropTypes.func.isRequired,
load: PropTypes.func.isRequired,
addBookmark: PropTypes.func.isRequired,
removeBookmark: PropTypes.func.isRequired,
}),
mediaActions: PropTypes.shape({
setMedia: PropTypes.func.isRequired,
removeMedia: PropTypes.func.isRequired,
}),
audioActions: PropTypes.shape({
pause: PropTypes.func.isRequired,
setAyah: PropTypes.func.isRequired,
play: PropTypes.func.isRequired,
setCurrentWord: PropTypes.func.isRequired,
}), // not required because in search it is not.
match: PropTypes.arrayOf(matchType),
isPlaying: PropTypes.bool,
isAuthenticated: PropTypes.bool,
tooltip: PropTypes.string,
Expand Down
32 changes: 16 additions & 16 deletions src/components/Line/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default class Line extends React.Component {
}
let position;

let text = line.map((word, index) => {
const text = line.map((word, index) => {
const highlight = currentAyah == word.ayahKey ? 'highlight' : '';
const className = `${word.className} ${highlight} ${word.highlight ? word.highlight : ''}`;
let id = null;
Expand All @@ -68,22 +68,22 @@ export default class Line extends React.Component {
}

return (
<b
id={id}
rel="tooltip"
data-key={`${word.ayahKey}:${position}`}
key={`${word.pageNum}${word.lineNum}${word.position}${word.code}`}
className={`${className} pointer`}
data-ayah={word.ayahKey}
data-line={word.lineNun}
data-page={word.pageNum}
data-position={word.position}
onClick={(event) => this.handleWordClick(event.target)}
title={this.buildTooltip(word, tooltip)}
dangerouslySetInnerHTML={{__html: word.code}}
/>
<b
id={id}
rel="tooltip"
data-key={`${word.ayahKey}:${position}`}
key={`${word.pageNum}${word.lineNum}${word.position}${word.code}`}
className={`${className} pointer`}
data-ayah={word.ayahKey}
data-line={word.lineNun}
data-page={word.pageNum}
data-position={word.position}
onClick={(event) => this.handleWordClick(event.target)}
title={this.buildTooltip(word, tooltip)}
dangerouslySetInnerHTML={{__html: word.code}}
/>
);
});
}

return (
<span className={`${styles.line} text-center`}>
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.