Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from quran:master #25

Merged
merged 10 commits into from
Sep 2, 2022
280 changes: 280 additions & 0 deletions data/hizb-to-chapter-mappings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,280 @@
{
"1": [
"1",
"2"
],
"2": [
"2"
],
"3": [
"2"
],
"4": [
"2"
],
"5": [
"2",
"3"
],
"6": [
"3"
],
"7": [
"3"
],
"8": [
"3",
"4"
],
"9": [
"4"
],
"10": [
"4"
],
"11": [
"4",
"5"
],
"12": [
"5"
],
"13": [
"5",
"6"
],
"14": [
"6"
],
"15": [
"6"
],
"16": [
"7"
],
"17": [
"7"
],
"18": [
"7",
"8"
],
"19": [
"8",
"9"
],
"20": [
"9"
],
"21": [
"9",
"10"
],
"22": [
"10",
"11"
],
"23": [
"11"
],
"24": [
"11",
"12"
],
"25": [
"12",
"13"
],
"26": [
"13",
"14"
],
"27": [
"15",
"16"
],
"28": [
"16"
],
"29": [
"17"
],
"30": [
"17",
"18"
],
"31": [
"18",
"19"
],
"32": [
"20"
],
"33": [
"21"
],
"34": [
"22"
],
"35": [
"23",
"24"
],
"36": [
"24",
"25"
],
"37": [
"25",
"26"
],
"38": [
"26",
"27"
],
"39": [
"27",
"28"
],
"40": [
"28",
"29"
],
"41": [
"29",
"30",
"31"
],
"42": [
"31",
"32",
"33"
],
"43": [
"33",
"34"
],
"44": [
"34",
"35",
"36"
],
"45": [
"36",
"37"
],
"46": [
"37",
"38",
"39"
],
"47": [
"39",
"40"
],
"48": [
"40",
"41"
],
"49": [
"41",
"42",
"43"
],
"50": [
"43",
"44",
"45"
],
"51": [
"46",
"47",
"48"
],
"52": [
"48",
"49",
"50",
"51"
],
"53": [
"51",
"52",
"53",
"54"
],
"54": [
"55",
"56",
"57"
],
"55": [
"58",
"59",
"60",
"61"
],
"56": [
"62",
"63",
"64",
"65",
"66"
],
"57": [
"67",
"68",
"69",
"70",
"71"
],
"58": [
"72",
"73",
"74",
"75",
"76",
"77"
],
"59": [
"78",
"79",
"80",
"81",
"82",
"83",
"84",
"85",
"86"
],
"60": [
"87",
"88",
"89",
"90",
"91",
"92",
"93",
"94",
"95",
"96",
"97",
"98",
"99",
"100",
"101",
"102",
"103",
"104",
"105",
"106",
"107",
"108",
"109",
"110",
"111",
"112",
"113",
"114"
]
}
1 change: 1 addition & 0 deletions i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"/[chapterId]/[verseId]/tafsirs": ["quran-reader"],
"/page/[pageId]": ["quran-reader"],
"/juz/[juzId]": ["quran-reader"],
"/hizb/[hizbId]": ["quran-reader"],
"/surah/[chapterId]/info": ["surah-info"],
"/chapter_info/[chapterId]": ["surah-info"],
"/surah-info/[chapterId]": ["surah-info"],
Expand Down
1 change: 1 addition & 0 deletions locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@
"shared": "Link has been copied to the clipboard!",
"sidebar": {
"search-juz": "Search Juz",
"search-hizb": "Search Hizb",
"search-page": "Search Page",
"search-surah": "Search surah",
"try-navigating-with": "Tip: try navigating with"
Expand Down
3 changes: 3 additions & 0 deletions locales/en/quran-reader.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@
"go-ayah": "Go to Ayah",
"include-translator": "Include translator name?",
"juz-beginning": "Beginning of Juz",
"hizb-beginning": "Beginning of Hizb",
"load-more": "Load More",
"next-juz": "Next Juz",
"next-hizb": "Next Hizb",
"next-page": "Next page",
"next-surah": "Next Surah",
"new-collection-name": "New Collection Name",
"prev-ayah": "Previous Ayah",
"prev-juz": "Previous Juz",
"prev-hizb": "Previous Hizb",
"prev-page": "Previous page",
"prev-surah": "Previous Surah",
"query-param-message": "You are using <0><\/0> settings from the url that are different from default ones, you can use your default settings by clicking <1>here<\/1> or you can make the settings from the url your default by clicking <2>here<\/2>.",
Expand Down
8 changes: 6 additions & 2 deletions next-sitemap.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,15 @@ module.exports = {
range(1, 31).forEach(async (juzId) => {
result.push(await config.transform(config, `/juz/${juzId}`));
});
// 8. /page/[pageId]
// 8. /hizb/[hizbId]
range(1, 61).forEach(async (hizbId) => {
result.push(await config.transform(config, `/hizb/${hizbId}`));
});
// 9. /page/[pageId]
range(1, 605).forEach(async (pageId) => {
result.push(await config.transform(config, `/page/${pageId}`));
});
// 9. /reciters/[reciterId]
// 10. /reciters/[reciterId]
reciterIds.forEach((reciterId) => {
const location = `/reciters/${reciterId}`;
result.push({
Expand Down
16 changes: 16 additions & 0 deletions src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
makeTranslationsUrl,
makeVersesUrl,
makeJuzVersesUrl,
makeHizbVersesUrl,
makeChapterInfoUrl,
makePageVersesUrl,
makeFootnoteUrl,
Expand Down Expand Up @@ -230,6 +231,21 @@ export const getJuzVerses = async (
params?: Record<string, unknown>,
): Promise<VersesResponse> => fetcher(makeJuzVersesUrl(id, locale, params));

/**
* Get the verses of a specific Hizb.
*
* @param {string} id the ID of the Hizb.
* @param {string} locale the locale.
* @param {string} params the params that we might need to include that differs from the default ones.
*
* @returns {Promise<VersesResponse>}
*/
export const getHizbVerses = async (
id: string,
locale: string,
params?: Record<string, unknown>,
): Promise<VersesResponse> => fetcher(makeHizbVersesUrl(id, locale, params));

/**
* Get the verses of a specific page.
*
Expand Down
5 changes: 5 additions & 0 deletions src/components/CommandBar/CommandBarBody/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ const NAVIGATE_TO = [
key: 1,
resultType: SearchNavigationType.JUZ,
},
{
name: 'Hizb 1',
key: 1,
resultType: SearchNavigationType.HIZB,
},
{
name: 'Page 1',
key: 1,
Expand Down
Loading