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

Commit

Permalink
Descriptions for surahs (#331)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmahalwy committed Jun 2, 2016
1 parent 9a11515 commit 78d0bcb
Show file tree
Hide file tree
Showing 3 changed files with 121 additions and 15 deletions.
16 changes: 2 additions & 14 deletions src/components/SurahInfo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,11 @@ import React, { Component, PropTypes } from 'react';
import Row from 'react-bootstrap/lib/Row';
import Col from 'react-bootstrap/lib/Col';

import html from './htmls';

const style = require('./style.scss');
export default class SurahInfo extends Component {

state = {
html: ''
}

componentWillReceiveProps(nextProps) {
if (nextProps.isShowingSurahInfo && nextProps.surah && nextProps.surah.id) {
html[`html${nextProps.surah.id}`]((module) => this.setState({html: module}));
}
}

render() {
const { surah, isShowingSurahInfo, onClose } = this.props;
const html = require(`./htmls/${surah.id}.html.js`);

return (
<Col xs={12} className={`${style.container} ${isShowingSurahInfo ? style.show : ''}`}>
Expand All @@ -39,7 +27,7 @@ export default class SurahInfo extends Component {
</dl>
</Col>
<Col md={8} className={`${style.info} times-new`}>
<div dangerouslySetInnerHTML={{__html: this.state.html}} />
<div dangerouslySetInnerHTML={{__html: html}} />
<div>
<p>
<em>Source: Sayyid Abul Ala Maududi - Tafhim al-Qur'an - The Meaning of the Quran</em>
Expand Down
Loading

0 comments on commit 78d0bcb

Please sign in to comment.