diff --git a/.env b/.env index 92df7e55c..2c85a0ee9 100644 --- a/.env +++ b/.env @@ -1,6 +1,6 @@ NODE_ENV=development PORT=8000 -API_URL=http://quran.com:3000 +API_URL=http://staging.quran.com:3000 ONE_QURAN_URL=http://localhost:3030 SEGMENTS_KEY= SENTRY_KEY_CLIENT= diff --git a/src/components/Ayah/index.js b/src/components/Ayah/index.js index 8d8fde7cb..2e4d24e8d 100644 --- a/src/components/Ayah/index.js +++ b/src/components/Ayah/index.js @@ -22,6 +22,7 @@ export default class Ayah extends Component { ayah: PropTypes.object.isRequired, bookmarked: PropTypes.bool.isRequired, bookmarkActions: PropTypes.object, + mediaActions: PropTypes.object.isRequired, match: PropTypes.array, isSearch: PropTypes.bool, isPlaying: PropTypes.bool, @@ -87,6 +88,41 @@ export default class Ayah extends Component { }); } + renderMedia() { + const { ayah, mediaActions } = this.props; + + if (!ayah.mediaContent.length) return false; + + return ( +
+ { + ayah.mediaContent.map((content, index) => ( +
+

Media: {content.resource.name}

+

+ + mediaActions.setMedia(content)} + data-metrics-event-name="Media Click" + data-metrics-media-content-url={content.url} + data-metrics-media-content-id={content.id} + data-metrics-media-content-ayah-key={ayah.ayahKey} + > + Watch lecture + + +

+
+ )) + } +
+ ); + } + renderText() { const { ayah, audioActions: { setCurrentWord }, tooltip } = this.props; @@ -257,6 +293,7 @@ export default class Ayah extends Component {
{this.renderText()} {this.renderTranslations()} + {this.renderMedia()}
); diff --git a/src/containers/App/index.js b/src/containers/App/index.js index 3753570a0..033335741 100644 --- a/src/containers/App/index.js +++ b/src/containers/App/index.js @@ -9,6 +9,12 @@ import Helmet from 'react-helmet'; import Grid from 'react-bootstrap/lib/Grid'; import Row from 'react-bootstrap/lib/Row'; import Col from 'react-bootstrap/lib/Col'; +import Button from 'react-bootstrap/lib/Button'; +import Modal from 'react-bootstrap/lib/Modal'; +const ModalHeader = Modal.Header; +const ModalTitle = Modal.Title; +const ModalBody = Modal.Body; +const ModalFooter = Modal.Footer; import debug from '../../helpers/debug'; import config from '../../config'; @@ -17,11 +23,15 @@ import { authConnect } from './connect'; import FontStyles from 'components/FontStyles'; +import { removeMedia } from 'redux/actions/media'; + const styles = require('./style.scss'); class App extends Component { static propTypes = { - surahs: PropTypes.object, + surahs: PropTypes.object.isRequired, + media: PropTypes.object.isRequired, + removeMedia: PropTypes.func.isRequired, children: PropTypes.any }; @@ -30,7 +40,7 @@ class App extends Component { }; render() { - const { children } = this.props; + const { children, media, removeMedia } = this.props; debug('component:APPLICATION', 'Render'); return ( @@ -103,6 +113,19 @@ class App extends Component { + + + + {media.content && media.content.resource.name} + + + + { + media.content && +