diff --git a/.editorconfig b/.editorconfig index 2536d66bf..5760be583 100644 --- a/.editorconfig +++ b/.editorconfig @@ -3,7 +3,7 @@ root = true [*] indent_style = space -indent_size = 4 +indent_size = 2 charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true diff --git a/client.js b/client.js index 7a6cf8e1b..b4491dd80 100644 --- a/client.js +++ b/client.js @@ -24,7 +24,11 @@ const client = new ApiClient(); const store = createStore(browserHistory, client, window.reduxData); const history = syncHistoryWithStore(browserHistory, store); -Raven.config(config.sentryClient).install(); +try { + Raven.config(config.sentryClient).install(); +} catch (error) { + console.log(error); +} window.quranDebug = debug; window.ReactDOM = ReactDOM; // For chrome dev tool support diff --git a/package.json b/package.json index 57e1bfbf2..d88d26674 100644 --- a/package.json +++ b/package.json @@ -59,6 +59,7 @@ "express-useragent": "^0.2.0", "extract-text-webpack-plugin": "^1.0.1", "file-loader": "^0.8.4", + "fontfaceobserver": "^1.7.1", "html-webpack-plugin": "^1.4.0", "http-proxy": "^1.13.2", "humps": "^1.0.0", @@ -92,6 +93,7 @@ "react-scroll": "^1.0.4", "redux": "^3.3.1", "redux-connect": "^2.4.0", + "reselect": "^2.5.1", "resolve-url": "^0.2.1", "sass-loader": "2.0.1", "scroll-behavior": "^0.3.3", diff --git a/server.js b/server.js index 3b1ae7f13..55413f0f8 100644 --- a/server.js +++ b/server.js @@ -101,11 +101,9 @@ const port = process.env.PORT || 8000; export default function serve(cb) { return server.listen(port, function() { - console.info(` - ==> 🌎 ENV=${process.env.NODE_ENV} - ==> ✅ Server is listening at http://localhost:${port} - ==> 🎯 API at ${process.env.API_URL} - `); + console.info(`==> 🌎 ENV=${process.env.NODE_ENV}`); + console.info(`==> ✅ Server is listening at http://localhost:${port}`); + console.info(`==> 🎯 API at ${process.env.API_URL}`); Object.keys(config).forEach(key => config[key].constructor.name !== 'Object' && console.info(`==> ${key}`, config[key])); cb && cb(this); diff --git a/src/components/Ayah/index.js b/src/components/Ayah/index.js index ab71d3eff..0d5d7cd2c 100644 --- a/src/components/Ayah/index.js +++ b/src/components/Ayah/index.js @@ -88,13 +88,14 @@ export default class Ayah extends Component { } renderText() { - if (!this.props.ayah.words[0].code) { + const { ayah, currentWord } = this.props; + + if (!ayah.words[0].code) { return false; } - const { currentWord } = this.props; let position = 0; - let text = this.props.ayah.words.map(word => { + let text = ayah.words.map(word => { let id = null; const active = word.charTypeId === CHAR_TYPE_WORD && currentWord === position; const className = `${word.className} ${word.highlight && word.highlight} ${active && styles.active}`; // eslint-disable-line max-len @@ -138,6 +139,12 @@ export default class Ayah extends Component { return (

{text} +

); } diff --git a/src/components/FontStyles/index.js b/src/components/FontStyles/index.js index 014af1425..90face967 100644 --- a/src/components/FontStyles/index.js +++ b/src/components/FontStyles/index.js @@ -1,48 +1,55 @@ import React, { Component, PropTypes } from 'react'; import { connect } from 'react-redux'; +import { fontFaceStyle, fontFaceStyleLoaded } from '../../helpers/buildFontFaces'; +import { load } from 'redux/modules/fontFaces'; -const bismillah = `@font-face {font-family: 'bismillah'; - src: url('http://quran-1f14.kxcdn.com/fonts/ttf/bismillah.ttf') format('truetype')} - .bismillah{font-family: 'bismillah'; font-size: 36px !important; color: #000; padding: 25px 0px;}`; // eslint-disable-line - -class FontStyle extends Component { - static propTypes = { - fontFace: PropTypes.string.isRequired - } - - static defaultProps = { - fontFace: '' - } - - shouldComponentUpdate(nextProps) { - return this.props.fontFace !== nextProps.fontFace; - } - - render() { - return