@moustafahelmi/react-native-quran-app 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/.bundle/config +2 -0
  2. package/.eslintrc.js +4 -0
  3. package/.prettierrc.js +7 -0
  4. package/.watchmanconfig +1 -0
  5. package/App.tsx +23 -0
  6. package/Gemfile +9 -0
  7. package/Gemfile.lock +105 -0
  8. package/MIGRATION.md +163 -0
  9. package/README.md +210 -0
  10. package/ReactotronConfig.js +7 -0
  11. package/__tests__/App.test.tsx +17 -0
  12. package/android/app/build.gradle +118 -0
  13. package/android/app/debug.keystore +0 -0
  14. package/android/app/proguard-rules.pro +10 -0
  15. package/android/app/src/debug/AndroidManifest.xml +9 -0
  16. package/android/app/src/main/AndroidManifest.xml +25 -0
  17. package/android/app/src/main/assets/fonts/Cairo.ttf +0 -0
  18. package/android/app/src/main/assets/fonts/QCF_BSML.ttf +0 -0
  19. package/android/app/src/main/assets/fonts/QCF_P001.ttf +0 -0
  20. package/android/app/src/main/java/com/quranapp/MainActivity.kt +22 -0
  21. package/android/app/src/main/java/com/quranapp/MainApplication.kt +43 -0
  22. package/android/app/src/main/res/drawable/rn_edit_text_material.xml +37 -0
  23. package/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  24. package/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  25. package/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  26. package/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  27. package/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  28. package/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  29. package/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  30. package/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  31. package/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  32. package/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  33. package/android/app/src/main/res/values/strings.xml +3 -0
  34. package/android/app/src/main/res/values/styles.xml +9 -0
  35. package/android/build.gradle +21 -0
  36. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  37. package/android/gradle/wrapper/gradle-wrapper.properties +7 -0
  38. package/android/gradle.properties +41 -0
  39. package/android/gradlew +249 -0
  40. package/android/gradlew.bat +92 -0
  41. package/android/link-assets-manifest.json +17 -0
  42. package/android/settings.gradle +4 -0
  43. package/app.json +4 -0
  44. package/babel.config.js +3 -0
  45. package/index.js +11 -0
  46. package/ios/.xcode.env +11 -0
  47. package/ios/Podfile +40 -0
  48. package/ios/Podfile.lock +1460 -0
  49. package/ios/QuranApp/AppDelegate.h +6 -0
  50. package/ios/QuranApp/AppDelegate.mm +31 -0
  51. package/ios/QuranApp/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
  52. package/ios/QuranApp/Images.xcassets/Contents.json +6 -0
  53. package/ios/QuranApp/Info.plist +57 -0
  54. package/ios/QuranApp/LaunchScreen.storyboard +47 -0
  55. package/ios/QuranApp/PrivacyInfo.xcprivacy +38 -0
  56. package/ios/QuranApp/main.m +10 -0
  57. package/ios/QuranApp.xcodeproj/project.pbxproj +729 -0
  58. package/ios/QuranApp.xcodeproj/xcshareddata/xcschemes/QuranApp.xcscheme +88 -0
  59. package/ios/QuranApp.xcworkspace/contents.xcworkspacedata +10 -0
  60. package/ios/QuranAppTests/Info.plist +24 -0
  61. package/ios/QuranAppTests/QuranAppTests.m +66 -0
  62. package/ios/link-assets-manifest.json +17 -0
  63. package/jest.config.js +3 -0
  64. package/metro.config.js +11 -0
  65. package/package.json +54 -0
  66. package/react-native.config.js +7 -0
  67. package/screenshots/1.png +0 -0
  68. package/screenshots/2.png +0 -0
  69. package/screenshots/3.png +0 -0
  70. package/screenshots/4.png +0 -0
  71. package/screenshots/5.png +0 -0
  72. package/src/assets/fonts/Cairo.ttf +0 -0
  73. package/src/assets/fonts/QCF_BSML.ttf +0 -0
  74. package/src/assets/fonts/QCF_P001.ttf +0 -0
  75. package/src/assets/images/bookmark.png +0 -0
  76. package/src/assets/images/close.png +0 -0
  77. package/src/assets/images/copy.png +0 -0
  78. package/src/assets/images/down-chevron.png +0 -0
  79. package/src/assets/images/mushafFrame.png +0 -0
  80. package/src/assets/images/pause.png +0 -0
  81. package/src/assets/images/play-button.png +0 -0
  82. package/src/assets/images/play.svg +16 -0
  83. package/src/assets/images/playNext.png +0 -0
  84. package/src/assets/images/surahNameFrame.png +0 -0
  85. package/src/common/chapters.ts +1346 -0
  86. package/src/common/constants.ts +27 -0
  87. package/src/common/images.ts +13 -0
  88. package/src/common/index.ts +8 -0
  89. package/src/common/juzs.ts +411 -0
  90. package/src/common/priorityPages.ts +46 -0
  91. package/src/common/themes.ts +7 -0
  92. package/src/components/index.ts +3 -0
  93. package/src/components/lists/index.ts +3 -0
  94. package/src/components/lists/pageVersesList.tsx +220 -0
  95. package/src/components/lists/verseLinesWordsList.tsx +90 -0
  96. package/src/components/modals/index.ts +3 -0
  97. package/src/components/modals/optionsModal.tsx +126 -0
  98. package/src/components/modals/recitersModal.tsx +118 -0
  99. package/src/components/sections/audioPlayer.tsx +185 -0
  100. package/src/components/sections/audioPlayerControls.tsx +100 -0
  101. package/src/components/sections/index.ts +4 -0
  102. package/src/components/sections/loader.tsx +33 -0
  103. package/src/helpers/index.ts +1 -0
  104. package/src/helpers/quranHelpers.tsx +17 -0
  105. package/src/hooks/apis/index.ts +10 -0
  106. package/src/hooks/apis/useGetChapterAudio.ts +111 -0
  107. package/src/hooks/apis/useGetChapterByPage.ts +166 -0
  108. package/src/hooks/apis/useGetChapterLookup.ts +31 -0
  109. package/src/hooks/apis/useGetReciters.ts +44 -0
  110. package/src/hooks/controllers/index.ts +25 -0
  111. package/src/hooks/controllers/useAudioPlayerController.tsx +63 -0
  112. package/src/hooks/controllers/useOptionsModalController.ts +99 -0
  113. package/src/hooks/controllers/usePageFontFileController.ts +255 -0
  114. package/src/hooks/controllers/usePageLineController.ts +108 -0
  115. package/src/hooks/helpers/index.ts +6 -0
  116. package/src/hooks/helpers/useQuranFontPreloader.ts +225 -0
  117. package/src/hooks/index.ts +3 -0
  118. package/src/index.ts +5 -0
  119. package/src/layouts/bismillahText.tsx +18 -0
  120. package/src/layouts/index.ts +4 -0
  121. package/src/layouts/quranChapterHeader.tsx +49 -0
  122. package/src/layouts/quranPageLayout.tsx +178 -0
  123. package/src/types/global.d.ts +7 -0
  124. package/src/types/index.ts +212 -0
  125. package/src/utils/axiosInstance.ts +7 -0
  126. package/src/utils/fileHandlers.ts +96 -0
  127. package/src/utils/handleBeforeAndAfterCurrentVerse.ts +41 -0
  128. package/src/utils/index.ts +6 -0
  129. package/src/utils/matrics.ts +37 -0
  130. package/tsconfig.json +3 -0
  131. package/videos/1.gif +0 -0
@@ -0,0 +1,88 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Scheme
3
+ LastUpgradeVersion = "1210"
4
+ version = "1.3">
5
+ <BuildAction
6
+ parallelizeBuildables = "YES"
7
+ buildImplicitDependencies = "YES">
8
+ <BuildActionEntries>
9
+ <BuildActionEntry
10
+ buildForTesting = "YES"
11
+ buildForRunning = "YES"
12
+ buildForProfiling = "YES"
13
+ buildForArchiving = "YES"
14
+ buildForAnalyzing = "YES">
15
+ <BuildableReference
16
+ BuildableIdentifier = "primary"
17
+ BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
18
+ BuildableName = "QuranApp.app"
19
+ BlueprintName = "QuranApp"
20
+ ReferencedContainer = "container:QuranApp.xcodeproj">
21
+ </BuildableReference>
22
+ </BuildActionEntry>
23
+ </BuildActionEntries>
24
+ </BuildAction>
25
+ <TestAction
26
+ buildConfiguration = "Debug"
27
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29
+ shouldUseLaunchSchemeArgsEnv = "YES">
30
+ <Testables>
31
+ <TestableReference
32
+ skipped = "NO">
33
+ <BuildableReference
34
+ BuildableIdentifier = "primary"
35
+ BlueprintIdentifier = "00E356ED1AD99517003FC87E"
36
+ BuildableName = "QuranAppTests.xctest"
37
+ BlueprintName = "QuranAppTests"
38
+ ReferencedContainer = "container:QuranApp.xcodeproj">
39
+ </BuildableReference>
40
+ </TestableReference>
41
+ </Testables>
42
+ </TestAction>
43
+ <LaunchAction
44
+ buildConfiguration = "Debug"
45
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
46
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
47
+ launchStyle = "0"
48
+ useCustomWorkingDirectory = "NO"
49
+ ignoresPersistentStateOnLaunch = "NO"
50
+ debugDocumentVersioning = "YES"
51
+ debugServiceExtension = "internal"
52
+ allowLocationSimulation = "YES">
53
+ <BuildableProductRunnable
54
+ runnableDebuggingMode = "0">
55
+ <BuildableReference
56
+ BuildableIdentifier = "primary"
57
+ BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
58
+ BuildableName = "QuranApp.app"
59
+ BlueprintName = "QuranApp"
60
+ ReferencedContainer = "container:QuranApp.xcodeproj">
61
+ </BuildableReference>
62
+ </BuildableProductRunnable>
63
+ </LaunchAction>
64
+ <ProfileAction
65
+ buildConfiguration = "Release"
66
+ shouldUseLaunchSchemeArgsEnv = "YES"
67
+ savedToolIdentifier = ""
68
+ useCustomWorkingDirectory = "NO"
69
+ debugDocumentVersioning = "YES">
70
+ <BuildableProductRunnable
71
+ runnableDebuggingMode = "0">
72
+ <BuildableReference
73
+ BuildableIdentifier = "primary"
74
+ BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
75
+ BuildableName = "QuranApp.app"
76
+ BlueprintName = "QuranApp"
77
+ ReferencedContainer = "container:QuranApp.xcodeproj">
78
+ </BuildableReference>
79
+ </BuildableProductRunnable>
80
+ </ProfileAction>
81
+ <AnalyzeAction
82
+ buildConfiguration = "Debug">
83
+ </AnalyzeAction>
84
+ <ArchiveAction
85
+ buildConfiguration = "Release"
86
+ revealArchiveInOrganizer = "YES">
87
+ </ArchiveAction>
88
+ </Scheme>
@@ -0,0 +1,10 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Workspace
3
+ version = "1.0">
4
+ <FileRef
5
+ location = "group:QuranApp.xcodeproj">
6
+ </FileRef>
7
+ <FileRef
8
+ location = "group:Pods/Pods.xcodeproj">
9
+ </FileRef>
10
+ </Workspace>
@@ -0,0 +1,24 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>CFBundleDevelopmentRegion</key>
6
+ <string>en</string>
7
+ <key>CFBundleExecutable</key>
8
+ <string>$(EXECUTABLE_NAME)</string>
9
+ <key>CFBundleIdentifier</key>
10
+ <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11
+ <key>CFBundleInfoDictionaryVersion</key>
12
+ <string>6.0</string>
13
+ <key>CFBundleName</key>
14
+ <string>$(PRODUCT_NAME)</string>
15
+ <key>CFBundlePackageType</key>
16
+ <string>BNDL</string>
17
+ <key>CFBundleShortVersionString</key>
18
+ <string>1.0</string>
19
+ <key>CFBundleSignature</key>
20
+ <string>????</string>
21
+ <key>CFBundleVersion</key>
22
+ <string>1</string>
23
+ </dict>
24
+ </plist>
@@ -0,0 +1,66 @@
1
+ #import <UIKit/UIKit.h>
2
+ #import <XCTest/XCTest.h>
3
+
4
+ #import <React/RCTLog.h>
5
+ #import <React/RCTRootView.h>
6
+
7
+ #define TIMEOUT_SECONDS 600
8
+ #define TEXT_TO_LOOK_FOR @"Welcome to React"
9
+
10
+ @interface QuranAppTests : XCTestCase
11
+
12
+ @end
13
+
14
+ @implementation QuranAppTests
15
+
16
+ - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL (^)(UIView *view))test
17
+ {
18
+ if (test(view)) {
19
+ return YES;
20
+ }
21
+ for (UIView *subview in [view subviews]) {
22
+ if ([self findSubviewInView:subview matching:test]) {
23
+ return YES;
24
+ }
25
+ }
26
+ return NO;
27
+ }
28
+
29
+ - (void)testRendersWelcomeScreen
30
+ {
31
+ UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController];
32
+ NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS];
33
+ BOOL foundElement = NO;
34
+
35
+ __block NSString *redboxError = nil;
36
+ #ifdef DEBUG
37
+ RCTSetLogFunction(
38
+ ^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
39
+ if (level >= RCTLogLevelError) {
40
+ redboxError = message;
41
+ }
42
+ });
43
+ #endif
44
+
45
+ while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) {
46
+ [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
47
+ [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
48
+
49
+ foundElement = [self findSubviewInView:vc.view
50
+ matching:^BOOL(UIView *view) {
51
+ if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) {
52
+ return YES;
53
+ }
54
+ return NO;
55
+ }];
56
+ }
57
+
58
+ #ifdef DEBUG
59
+ RCTSetLogFunction(RCTDefaultLogFunction);
60
+ #endif
61
+
62
+ XCTAssertNil(redboxError, @"RedBox error: %@", redboxError);
63
+ XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS);
64
+ }
65
+
66
+ @end
@@ -0,0 +1,17 @@
1
+ {
2
+ "migIndex": 1,
3
+ "data": [
4
+ {
5
+ "path": "src/assets/fonts/Cairo.ttf",
6
+ "sha1": "665ae399222c5c4e2cf11d14921df4c96b017d1d"
7
+ },
8
+ {
9
+ "path": "src/assets/fonts/QCF_BSML.ttf",
10
+ "sha1": "36fc556b753e3c359147efb5c346b0012e44e0b6"
11
+ },
12
+ {
13
+ "path": "src/assets/fonts/QCF_P001.ttf",
14
+ "sha1": "d18804217272bc978a3344d53d5a4c5fad3cf429"
15
+ }
16
+ ]
17
+ }
package/jest.config.js ADDED
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ preset: 'react-native',
3
+ };
@@ -0,0 +1,11 @@
1
+ const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config');
2
+
3
+ /**
4
+ * Metro configuration
5
+ * https://reactnative.dev/docs/metro
6
+ *
7
+ * @type {import('metro-config').MetroConfig}
8
+ */
9
+ const config = {};
10
+
11
+ module.exports = mergeConfig(getDefaultConfig(__dirname), config);
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "@moustafahelmi/react-native-quran-app",
3
+ "version": "1.4.0",
4
+ "description": "React Native Quran application with Hafs recitation",
5
+ "main": "src/index.ts",
6
+ "keywords": ["react-native", "quran", "hafs", "islamic", "mobile"],
7
+ "author": "Moustafa Helmi",
8
+ "license": "MIT",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/moustafahelmi/react-native-quran-app"
12
+ },
13
+ "scripts": {
14
+ "android": "react-native run-android",
15
+ "ios": "react-native run-ios --simulator='iPhone 15 Pro'",
16
+ "lint": "eslint .",
17
+ "start": "react-native start",
18
+ "test": "jest"
19
+ },
20
+ "dependencies": {
21
+ "@react-native-async-storage/async-storage": "^1.23.1",
22
+ "@react-native-clipboard/clipboard": "^1.14.1",
23
+ "@react-native-community/slider": "^4.5.2",
24
+ "axios": "^1.6.8",
25
+ "react": "18.2.0",
26
+ "react-native": "0.74.0",
27
+ "react-native-dynamic-fonts": "^0.3.2",
28
+ "react-native-fs": "^2.20.0",
29
+ "react-native-quran-hafs": "^1.0.3",
30
+ "react-native-responsive-fontsize": "^0.5.1",
31
+ "react-native-track-player": "^4.1.1"
32
+ },
33
+ "devDependencies": {
34
+ "@babel/core": "^7.20.0",
35
+ "@babel/preset-env": "^7.20.0",
36
+ "@babel/runtime": "^7.20.0",
37
+ "@react-native/babel-preset": "0.74.81",
38
+ "@react-native/eslint-config": "0.74.81",
39
+ "@react-native/metro-config": "0.74.81",
40
+ "@react-native/typescript-config": "0.74.81",
41
+ "@types/react": "^18.2.6",
42
+ "@types/react-test-renderer": "^18.0.0",
43
+ "babel-jest": "^29.6.3",
44
+ "eslint": "^8.19.0",
45
+ "jest": "^29.6.3",
46
+ "prettier": "2.8.8",
47
+ "react-test-renderer": "18.2.0",
48
+ "reactotron-react-native": "^5.1.6",
49
+ "typescript": "5.0.4"
50
+ },
51
+ "engines": {
52
+ "node": ">=18"
53
+ }
54
+ }
@@ -0,0 +1,7 @@
1
+ module.exports = {
2
+ project: {
3
+ ios: {},
4
+ android: {},
5
+ },
6
+ assets: ['./src/assets/fonts'],
7
+ };
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,16 @@
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
3
+ "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
4
+ <svg version="1.0" xmlns="http://www.w3.org/2000/svg"
5
+ width="512.000000pt" height="512.000000pt" viewBox="0 0 512.000000 512.000000"
6
+ preserveAspectRatio="xMidYMid meet">
7
+
8
+ <g transform="translate(0.000000,512.000000) scale(0.100000,-0.100000)"
9
+ fill="#000000" stroke="none">
10
+ <path d="M425 5105 c-60 -22 -110 -68 -139 -127 l-26 -52 0 -2366 0 -2366 26
11
+ -52 c31 -63 81 -106 148 -128 72 -24 141 -14 229 34 40 21 974 546 2077 1166
12
+ 1250 703 2019 1142 2043 1164 54 53 77 106 77 182 0 76 -23 129 -77 182 -24
13
+ 22 -793 461 -2043 1164 -1103 620 -2038 1145 -2078 1167 -86 46 -168 57 -237
14
+ 32z"/>
15
+ </g>
16
+ </svg>
Binary file