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
fixed lint rules
  • Loading branch information
naveed-ahmad committed Mar 7, 2017
commit fa059ba9f37f5346435170041fcf52be91214543
14 changes: 7 additions & 7 deletions src/components/Translation/index.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import React, { PropTypes } from 'react';
/* eslint-disable react/prefer-stateless-function */
import React, { Component, PropTypes } from 'react';

import { translationType } from 'types';

const styles = require('./style.scss');

export default class Translation extends React.Component {
export default class Translation extends Component {
static propTypes = {
translation: translationType.isRequired
translation: translationType.isRequired,
index: PropTypes.number
};

render() {
const { translation } = this.props;
const { translation, index } = this.props;
const lang = translation.languageName;
const isArabic = lang === 'arabic';

return (
<div
className={`${styles.translation} ${isArabic && 'arabic'} translation`}
>
<div id={index} className={`${styles.translation} ${isArabic && 'arabic'} translation`}>
<h4 className="montserrat">{translation.resourceName}</h4>
<h2 className={`${isArabic ? 'text-right' : 'text-left'} text-translation times-new`}>
<small
Expand Down
8 changes: 3 additions & 5 deletions src/components/Verse/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,9 @@ export default class Verse extends Component {

const array = match || verse.translations || [];

return array.map((translation, index) => {
return(
<Translation translation={translation} />
);
});
return array.map((translation, index) => (
<Translation translation={translation} index={index} />
));
}

renderMedia() {
Expand Down
4 changes: 2 additions & 2 deletions src/components/Word/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { PropTypes } from 'react';
import React, { Component, PropTypes } from 'react';
import bindTooltip from 'utils/bindTooltip';
/* eslint-disable no-unused-vars */
const CHAR_TYPE_WORD = 'word';
Expand All @@ -7,7 +7,7 @@ const CHAR_TYPE_PAUSE = 'pause';
const CHAR_TYPE_RUB = 'rub';
const CHAR_TYPE_SAJDAH = 'sajdah';

export default class Word extends React.Component {
export default class Word extends Component {
static propTypes = {
word: PropTypes.object.isRequired, // eslint-disable-line
tooltip: PropTypes.string,
Expand Down
2 changes: 1 addition & 1 deletion src/redux/actions/verses.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function load(id, from, to, options = defaultOptions) {
from,
to,
recitation: audio,
translations: translations
translations
}
}),
chapterId: id
Expand Down
6 changes: 3 additions & 3 deletions src/types/translationType.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { PropTypes } from 'react';

export default PropTypes.shape({
languageName:PropTypes.string.isRequired,
text: PropTypes.string.isRequired,
resourceName: PropTypes.string.isRequired
languageName: PropTypes.string.isRequired,
text: PropTypes.string.isRequired,
resourceName: PropTypes.string.isRequired
});