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

Commit be9f0a7

Browse files
authored
Merge pull request #838 from UmanShahzad/refactor
Simple refactorizations (v2).
2 parents b848576 + 919fdb9 commit be9f0a7

File tree

6 files changed

+314
-186
lines changed

6 files changed

+314
-186
lines changed

src/config.js

Lines changed: 156 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,26 @@ const environment = {
88
}[process.env.NODE_ENV || 'development'];
99

1010
const title = "Al-Qur'an al-Kareem - القرآن الكريم";
11-
const description =
12-
'The Quran translated into many languages in a simple and easy interface.';
11+
const description = 'The Quran translated into many languages in a simple and easy interface.';
12+
const keywords = [
13+
'القران الكريم',
14+
'قران كريم',
15+
'القرآن',
16+
'قران',
17+
'quran',
18+
'qur\'an',
19+
'koran',
20+
'kareem',
21+
'surah',
22+
'yasin',
23+
'yaseen',
24+
'kahf',
25+
'mulk',
26+
'rahman',
27+
'muslim',
28+
'islam',
29+
'Allah'
30+
].join(', ');
1331
const locales = {
1432
en: 'English',
1533
ar: 'العربية',
@@ -28,24 +46,43 @@ const config = {
2846
sentryClient: process.env.SENTRY_KEY_CLIENT,
2947
sentryServer: process.env.SENTRY_KEY_SERVER,
3048
facebookAppId: process.env.FACEBOOK_APP_ID,
31-
// Supported locales
3249
locales,
3350
defaultLocale: 'en',
3451
app: {
3552
head: {
3653
titleTemplate: `%s - ${title}`,
3754
meta: [
38-
{ charset: 'utf-8' },
39-
{ 'http-equiv': 'Content-Type', content: 'text/html; charset=utf-8' },
40-
{ 'http-equiv': 'Content-Language', content: 'EN; AR' },
41-
{ name: 'description', content: description },
55+
{
56+
charset: 'utf-8'
57+
},
58+
{
59+
'http-equiv': 'Content-Type',
60+
content: 'text/html; charset=utf-8'
61+
},
62+
{
63+
'http-equiv': 'Content-Language',
64+
content: 'EN; AR'
65+
},
66+
{
67+
name: 'description',
68+
content: description
69+
},
4270
{
4371
name: 'keywords',
44-
content: "quran, koran, qur'an, kareem, قران, القرآن, قران كريم, القران الكريم, surah, yasin, yaseen, kahf, mulk, rahman, muslim, islam, Allah"
45-
}, // eslint-disable-line max-l en
46-
{ name: 'Charset', content: 'UTF-8' },
47-
{ name: 'Distribution', content: 'Global' },
48-
{ name: 'Rating', content: 'General' },
72+
content: keywords
73+
},
74+
{
75+
name: 'Charset',
76+
content: 'UTF-8'
77+
},
78+
{
79+
name: 'Distribution',
80+
content: 'Global'
81+
},
82+
{
83+
name: 'Rating',
84+
content: 'General'
85+
},
4986
{
5087
name: 'viewport',
5188
content: 'width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no'
@@ -54,40 +91,106 @@ const config = {
5491
name: 'google-site-verification',
5592
content: 'ehFz7FvmL7V9MzP40F8_kLABhCzqGzMDMrCnUP44Too'
5693
},
57-
{ name: 'theme-color', content: '#004f54' },
58-
{ property: 'og:site_name', content: title },
94+
{
95+
name: 'theme-color',
96+
content: '#004f54'
97+
},
98+
{
99+
property: 'og:site_name',
100+
content: title
101+
},
59102
{
60103
property: 'og:image',
61104
content: 'https://quran.com/images/thumbnail.png'
62105
},
63-
{ property: 'og:locale', content: 'en_US' },
64-
{ property: 'og:title', content: title },
65-
{ property: 'og:description', content: description },
66-
{ property: 'og:url', content: 'https://quran.com' },
67-
{ property: 'og:type', content: 'website' },
68-
{ name: 'twitter:card', content: 'summary' },
69-
{ name: 'twitter:title', content: title },
70-
{ name: 'twitter:description', content: description },
106+
{
107+
property: 'og:locale',
108+
content: 'en_US'
109+
},
110+
{
111+
property: 'og:title',
112+
content: title
113+
},
114+
{
115+
property: 'og:description',
116+
content: description
117+
},
118+
{
119+
property: 'og:url',
120+
content: 'https://quran.com'
121+
},
122+
{
123+
property: 'og:type',
124+
content: 'website'
125+
},
126+
{
127+
name: 'twitter:card',
128+
content: 'summary'
129+
},
130+
{
131+
name: 'twitter:title',
132+
content: title
133+
},
134+
{
135+
name: 'twitter:description',
136+
content: description
137+
},
71138
{
72139
name: 'twitter:image',
73140
content: 'https://quran.com/images/thumbnail.png'
74141
},
75-
{ name: 'twitter:image:width', content: '200' },
76-
{ name: 'twitter:image:height', content: '200' },
142+
{
143+
name: 'twitter:image:width',
144+
content: '200'
145+
},
146+
{
147+
name: 'twitter:image:height',
148+
content: '200'
149+
},
77150
{
78151
name: 'google-play-app',
79152
content: 'app-id=com.quran.labs.androidquran'
80153
},
81-
{ name: 'apple-itunes-app', content: 'app-id=1118663303' },
82-
{ name: 'mobile-web-app-capable', content: 'yes' },
83-
{ name: 'apple-mobile-web-app-capable', content: 'yes' },
84-
{ name: 'apple-mobile-web-app-title', content: title },
85-
{ name: 'apple-mobile-web-app-status-bar-style', content: 'black' },
86-
{ name: 'application-name', content: 'Al-Quran - القرآن الكريم' },
87-
{ name: 'msapplication-TileColor', content: '#004f54' },
88-
{ name: 'msapplication-tooltip', content: description },
89-
{ name: 'msapplication-starturl', content: 'https://quran.com' },
90-
{ name: 'msapplication-navbutton-color', content: '#004f54' },
154+
{
155+
name: 'apple-itunes-app',
156+
content: 'app-id=1118663303'
157+
},
158+
{
159+
name: 'mobile-web-app-capable',
160+
content: 'yes'
161+
},
162+
{
163+
name: 'apple-mobile-web-app-capable',
164+
content: 'yes'
165+
},
166+
{
167+
name: 'apple-mobile-web-app-title',
168+
content: title
169+
},
170+
{
171+
name: 'apple-mobile-web-app-status-bar-style',
172+
content: 'black'
173+
},
174+
{
175+
name: 'application-name',
176+
content: 'Al-Quran - القرآن الكريم'
177+
},
178+
{
179+
name: 'msapplication-TileColor',
180+
content: '#004f54'
181+
},
182+
{
183+
name: 'msapplication-tooltip',
184+
content: description
185+
},
186+
{
187+
name: 'msapplication-starturl',
188+
content: 'https://quran.com'
189+
},
190+
{
191+
name: 'msapplication-navbutton-color',
192+
content: '#004f54'
193+
},
91194
{
92195
name: 'msapplication-square70x70logo',
93196
content: '/mstitle-70x70.jpg'
@@ -106,7 +209,10 @@ const config = {
106209
}
107210
],
108211
link: [
109-
{ rel: 'manifest', href: 'manifest.json' },
212+
{
213+
rel: 'manifest',
214+
href: '/manifest.json'
215+
},
110216
{
111217
rel: 'search',
112218
type: 'application/opensearchdescription+xml',
@@ -136,9 +242,20 @@ const config = {
136242
href: '/favicon-16x16.png',
137243
sizes: '16x16'
138244
},
139-
{ rel: 'mask-icon', href: '/safari-pinned-tab.svg', color: '#004f54' },
140-
{ rel: 'shortcut icon', href: '/favicon.ico', type: 'image/x-icon' },
141-
{ rel: 'apple-touch-icon', href: 'apple-touch-icon.png' },
245+
{
246+
rel: 'mask-icon',
247+
href: '/safari-pinned-tab.svg',
248+
color: '#004f54'
249+
},
250+
{
251+
rel: 'shortcut icon',
252+
type: 'image/x-icon',
253+
href: '/favicon.ico'
254+
},
255+
{
256+
rel: 'apple-touch-icon',
257+
href: '/apple-touch-icon.png'
258+
},
142259
{
143260
rel: 'apple-touch-icon',
144261
sizes: '57x57',
@@ -191,7 +308,7 @@ const config = {
191308
},
192309
...Object.keys(locales).map(key => ({
193310
rel: 'alternate',
194-
hreflang: key,
311+
hrefLang: key,
195312
href: `https://quran.com?local=${key}`
196313
}))
197314
],

src/containers/About/index.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,27 @@ export default () => (
1010
<div className="row">
1111
<div className="col-md-8 col-md-offset-2">
1212
<h4 className="source-sans">
13-
The Noble Quran is the central
13+
The Noble Qur&apos;an is the central
1414
religious text of Islam. Muslims believe the Qur’an is the
1515
book of Divine guidance and direction for mankind, and
1616
consider the original Arabic text the final revelation of
1717
Allah (God).[<a href="en.wikipedia.org/wiki/Quran">1</a>]
1818
All translations of the original Arabic text
1919
are thus interpretations of the original meanings and should
2020
be embraced as such. For more information about the Noble
21-
Quran, you may visit its <a href="https://en.wikipedia.org/wiki/Quran">Wikipedia article.</a>
21+
Qur&apos;an, you may visit its <a href="https://en.wikipedia.org/wiki/Quran">Wikipedia article.</a>
2222
</h4>
2323
</div>
2424
</div>
2525
<div className="row">
2626
<div className="col-md-8 col-md-offset-2">
2727
<h3>MECCAN SURAHS</h3>
2828
<h4 className="source-sans">
29-
The Meccan suras are the chronologically earlier chapters
30-
(suras) of the Quran that were, according to Islamic
29+
The Meccan Surahs are the chronologically earlier chapters
30+
(Surahs) of the Qur&apos;an that were, according to Islamic
3131
tradition, revealed anytime before the migration of the
3232
Islamic prophet Muhammed and his followers from Mecca to
33-
Medina (Hijra). The Medinan suras are those revelations that
33+
Medina (Hijra). The Medinan Surahs are those revelations that
3434
occurred after the move to the city of that name.
3535
</h4>
3636
</div>
@@ -39,10 +39,10 @@ export default () => (
3939
<div className="col-md-8 col-md-offset-2">
4040
<h3>MEDINAN SURAHS</h3>
4141
<h4 className="source-sans">
42-
The Medinan suras or Medinan chapters of the Quran are the
43-
latest 24 suras that, according to Islamic tradition, were
44-
revealed at Medina after Muhammad&apos;s hijra from Mecca. These
45-
suras were revealed by Allah when the Muslim community was
42+
The Medinan Surahs or Medinan Chapters of the Qur&apos;an are the
43+
latest 24 Surahs that, according to Islamic tradition, were
44+
revealed at Medina after Muhammad&apos;s Hijra from Mecca. These
45+
Surahs were revealed by Allah when the Muslim community was
4646
larger and more developed, as opposed to their minority position
4747
in Mecca.
4848
</h4>
@@ -53,10 +53,10 @@ export default () => (
5353
<h3>BROWSING SURAHS ON THIS WEBSITE</h3>
5454
<h4 className="source-sans">
5555
We have redesigned the website with a user friendly approach in
56-
mind. To browse through the surahs, click on the button
57-
(shown left) in the READ & LISTEN page and navigate surah by
56+
mind. To browse through the Surahs, click on the button
57+
(shown left) in the READ & LISTEN page and navigate Surah by
5858
title or by page. In future iterations, we will be integrating
59-
more search and audio features inshaAllah. If you have any
59+
more search and audio features, ان شاء الله. If you have any
6060
suggestions on how we can make the website a better experience
6161
please do not hesitate to <a href="https://quran.zendesk.com/hc/en-us">contact us</a>.
6262
</h4>
@@ -70,10 +70,10 @@ export default () => (
7070
possible with the will of Allah (Glory be unto Him) and with the
7171
help of the open source Muslim community online. Data sources
7272
include <a href="http://www.tanzil.info">Tanzil</a>,
73-
<a href="http://www.qurancomplex.com"> QuranComplex</a>,
74-
<a href="https://github.com/cpfair/quran-align">Colin Fair&apos;s work on audio segments</a>,
73+
<a href="http://www.qurancomplex.com"> Qur&apos;anComplex</a>,
74+
<a href="https://github.com/cpfair/quran-align"> Colin Fair&apos;s work on audio segments</a>,
7575
<a href="http://www.zekr.org"> Zekr</a> and
76-
<a href="http://www.al-quran.info"> Online Quran Project</a>.
76+
<a href="http://www.al-quran.info"> Online Qur&apos;an Project</a>.
7777
Special thanks to the
7878
<a href="http://elmohafez.com"> Elmohafez team</a> for word by
7979
word timing files.

src/containers/AyatulKursi/index.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ const TopOptions = Loadable({
5050
});
5151

5252
const title = 'Ayatul Kursi';
53-
54-
const description =
55-
'Ayatul Kursi is verse 255 of the second chapter, surah Baqarah of the Holy Quran, Surah al-Baqarah (The Chapter of the Cow). It is also known as the Throne Verse.';
53+
const description = 'Ayatul Kursi is verse 255 of the second chapter, ' +
54+
'Surah al-Baqarah (The Chapter of the Cow), in the ' +
55+
'Holy Quran. It is also known as the Throne Verse.';
5656

5757
class AyatulKursi extends Component {
5858
state = {
@@ -109,7 +109,13 @@ class AyatulKursi extends Component {
109109
}
110110

111111
renderLines() {
112-
const { lines, options, currentVerse, isPlaying, actions } = this.props;
112+
const {
113+
lines,
114+
options,
115+
currentVerse,
116+
isPlaying,
117+
actions
118+
} = this.props;
113119
const keys = Object.keys(lines);
114120

115121
return (
@@ -125,7 +131,11 @@ class AyatulKursi extends Component {
125131
}
126132

127133
render() {
128-
const { chapter, verses, options } = this.props; // eslint-disable-line no-shadow
134+
const {
135+
chapter,
136+
verses,
137+
options
138+
} = this.props; // eslint-disable-line no-shadow
129139
debug('component:AyatulKursi', 'Render');
130140

131141
return (

0 commit comments

Comments
 (0)