@fadyshawky/react-native-magic 1.0.4 → 1.0.6

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 (37) hide show
  1. package/.vscode/settings.json +7 -0
  2. package/CHANGELOG.md +23 -0
  3. package/README.md +2 -4
  4. package/local.properties +1 -0
  5. package/package.json +1 -3
  6. package/template/.env.development +3 -0
  7. package/template/.env.production +4 -1
  8. package/template/.env.staging +4 -1
  9. package/template/App.tsx +0 -5
  10. package/template/android/app/build.gradle +71 -6
  11. package/template/android/app/src/main/AndroidManifest.xml +2 -0
  12. package/template/android/gradle.properties +0 -1
  13. package/template/babel.config.js +1 -0
  14. package/template/index.js +1 -1
  15. package/template/ios/Podfile +37 -6
  16. package/template/ios/Podfile.lock +2 -2
  17. package/template/ios/reactnativemagic/Info.plist +4 -0
  18. package/template/ios/reactnativemagic.xcodeproj/project.pbxproj +74 -74
  19. package/template/ios/tmp.xcconfig +2 -0
  20. package/template/metro.config.js +6 -1
  21. package/template/package-lock.json +4 -3
  22. package/template/package.json +7 -6
  23. package/template/src/common/components/Background.tsx +0 -1
  24. package/template/src/common/components/ImageCropPickerButton.tsx +4 -5
  25. package/template/src/common/components/LoadingComponent.tsx +1 -6
  26. package/template/src/common/localization/translations/loginLocalization.ts +18 -2
  27. package/template/src/core/store/user/userActions.ts +47 -3
  28. package/template/src/core/store/user/userSlice.ts +59 -2
  29. package/template/src/core/theme/fonts.ts +1 -7
  30. package/template/src/navigation/AuthStack.tsx +16 -0
  31. package/template/src/navigation/HeaderComponents.tsx +3 -5
  32. package/template/src/navigation/MainStack.tsx +0 -1
  33. package/template/src/navigation/types.ts +7 -1
  34. package/template/src/screens/Login/Login.tsx +54 -3
  35. package/template/src/screens/registration/RegistrationScreen.tsx +198 -0
  36. package/template/src/screens/resetPassword/ForgotPasswordScreen.tsx +129 -0
  37. package/template/src/types/react-native-config.d.ts +8 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "workbench.colorCustomizations": {
3
+ "activityBar.background": "#342D0C",
4
+ "titleBar.activeBackground": "#493F10",
5
+ "titleBar.activeForeground": "#FCFAF0"
6
+ }
7
+ }
package/CHANGELOG.md CHANGED
@@ -2,6 +2,29 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [1.0.6] - 2024-12-24
6
+
7
+ ### Added
8
+ - Added missing password reset handlers (`resetPasswordErrorHandler` and `resetPasswordLoadingHandler`) to user slice
9
+ - Added password reset flow with the following states:
10
+ - Loading state during password reset request
11
+ - Error handling for failed password reset attempts
12
+ - Success handling for completed password reset
13
+ - Added complete user registration flow:
14
+ - User input validation
15
+ - Registration request handling
16
+ - Success state with automatic login
17
+ - Error handling for failed registration attempts
18
+ - Loading states during registration process
19
+
20
+ ## [1.0.5] - 2024-12-23
21
+
22
+ ### Fixed
23
+ - Resolved Android build configuration issues
24
+ - Fixed package dependencies setup and initialization
25
+ - Optimized Gradle build settings for Android
26
+ - Fixed iOS permissions configuration
27
+
5
28
  ## [1.0.4] - 2024-12-22
6
29
 
7
30
  ### Fixed
package/README.md CHANGED
@@ -249,11 +249,9 @@ This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md
249
249
 
250
250
  ## Support
251
251
 
252
- If you find this template helpful, consider buying me a coffee! ☕️
252
+ If you find this template helpful, consider buying me a beer! 🍺
253
253
 
254
- <a href="https://www.buymeacoffee.com/fadytshawke" target="_blank">
255
- <img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" height="60px" width="217px">
256
- </a>
254
+ <a href="https://www.buymeacoffee.com/fadytshawke"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a beer&emoji=🍺&slug=fadytshawke&button_colour=FFDD00&font_colour=000000&font_family=Cookie&outline_colour=000000&coffee_colour=ffffff" /></a>
257
255
 
258
256
  ## Author
259
257
 
@@ -0,0 +1 @@
1
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fadyshawky/react-native-magic",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "react native template with ready components, hooks, react navigation, redux, typescript, etc.",
5
5
  "keywords": [
6
6
  "react-native-magic",
@@ -65,8 +65,6 @@
65
65
  "react-native-orientation-locker": "^1.7.0",
66
66
  "react-native-pager-view": "^6.6.1",
67
67
  "react-native-permissions": "^5.2.1",
68
- "react-native-reanimated": "^3.16.6",
69
- "react-native-reanimated-carousel": "^3.5.1",
70
68
  "react-native-safe-area-context": "^5.0.0",
71
69
  "react-native-screens": "^4.4.0",
72
70
  "react-native-sfsymbols": "^1.2.2",
@@ -1,5 +1,8 @@
1
+ # Don't forget to add the .env.development file to the .gitignore file
2
+ ENV=development
1
3
  API_BASE_URL=https://dev-api.example.com
2
4
  API_KEY=dev_key
3
5
  ANDROID_APP_ID=com.reactnativemagic.development
4
6
  ANDROID_VERSION_CODE=1
5
7
  ANDROID_VERSION_NAME=1.0.0
8
+ PROJECT_NAME=YOURAPPNAME
@@ -1,5 +1,8 @@
1
+ # Don't forget to add the .env.production file to the .gitignore file
2
+ ENV=production
1
3
  API_BASE_URL=https://api.example.com
2
4
  API_KEY=production_key
3
5
  ANDROID_APP_ID=com.reactnativemagic
4
6
  ANDROID_VERSION_CODE=1
5
- ANDROID_VERSION_NAME=1.0.0
7
+ ANDROID_VERSION_NAME=1.0.0
8
+ PROJECT_NAME=YOURAPPNAME
@@ -1,5 +1,8 @@
1
+ # Don't forget to add the .env.staging file to the .gitignore file
2
+ ENV=staging
1
3
  API_BASE_URL=https://staging-api.example.com
2
4
  API_KEY=staging_key
3
5
  ANDROID_APP_ID=com.reactnativemagic.staging
4
6
  ANDROID_VERSION_CODE=1
5
- ANDROID_VERSION_NAME=1.0.0
7
+ ANDROID_VERSION_NAME=1.0.0
8
+ PROJECT_NAME=YOURAPPNAME
package/template/App.tsx CHANGED
@@ -4,11 +4,6 @@
4
4
  *
5
5
  * @format
6
6
  */
7
- import '@fontsource/poppins/300.css'; // Light
8
- import '@fontsource/poppins/400.css'; // Regular
9
- import '@fontsource/poppins/500.css'; // Medium
10
- import '@fontsource/poppins/600.css'; // SemiBold
11
- import '@fontsource/poppins/700.css'; // Bold
12
7
  import React from 'react';
13
8
  import {LogBox, SafeAreaView, StatusBar} from 'react-native';
14
9
  import {SheetProvider} from 'react-native-actions-sheet';
@@ -3,12 +3,25 @@ apply plugin: "org.jetbrains.kotlin.android"
3
3
  apply plugin: "com.facebook.react"
4
4
 
5
5
  project.ext.envConfigFiles = [
6
- debug: ".env.debug",
7
- release: ".env.production",
8
- // Add other env files as needed
6
+ production: ".env.production",
7
+ staging: ".env.staging",
8
+ development: ".env.development"
9
+ ]
10
+ apply from: project(":react-native-config").projectDir.getPath() + "/dotenv.gradle"
11
+ project.ext.react = [
12
+ root: "../../",
13
+ bundleAssetName: "index.android.bundle",
14
+ entryFile: "index.js",
15
+ cliPath: "node_modules/haul/bin/cli.js",
16
+ devDisabledInAppDev: true,
17
+ devDisabledInAppTest: true,
18
+ devDisabledInRelease: true,
19
+ bundleInAppDev: true,
20
+ bundleInAppTest: true,
21
+ bundleInRelease: true,
22
+ enableHermes: true,
23
+ enableVmCleanup: false,
9
24
  ]
10
-
11
- apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"
12
25
 
13
26
  /**
14
27
  * This is the configuration block to customize your React Native Android app.
@@ -83,16 +96,47 @@ def jscFlavor = 'org.webkit:android-jsc:+'
83
96
  android {
84
97
  ndkVersion rootProject.ext.ndkVersion
85
98
  buildToolsVersion rootProject.ext.buildToolsVersion
86
- compileSdk rootProject.ext.compileSdkVersion
99
+ compileSdkVersion rootProject.ext.compileSdkVersion
100
+
101
+ flavorDimensions "default"
102
+ productFlavors {
103
+ production {
104
+ minSdkVersion rootProject.ext.minSdkVersion
105
+ applicationId project.env.get("APP_ID")
106
+ targetSdkVersion rootProject.ext.targetSdkVersion
107
+ }
108
+ staging {
109
+ minSdkVersion rootProject.ext.minSdkVersion
110
+ applicationId project.env.get("APP_ID")
111
+ targetSdkVersion rootProject.ext.targetSdkVersion
112
+ }
113
+ development {
114
+ minSdkVersion rootProject.ext.minSdkVersion
115
+ applicationId project.env.get("APP_ID")
116
+ targetSdkVersion rootProject.ext.targetSdkVersion
117
+ }
118
+ }
87
119
 
88
120
  namespace "com.reactnativemagic"
89
121
  defaultConfig {
90
122
  applicationId project.env.get("ANDROID_APP_ID")
91
123
  minSdkVersion rootProject.ext.minSdkVersion
124
+ multiDexEnabled true
92
125
  targetSdkVersion rootProject.ext.targetSdkVersion
93
126
  versionCode project.env.get("ANDROID_VERSION_CODE").toInteger()
94
127
  versionName project.env.get("ANDROID_VERSION_NAME")
95
128
  resValue "string", "build_config_package", project.env.get("ANDROID_APP_ID")
129
+
130
+ ndk {
131
+ abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
132
+ }
133
+
134
+ externalNativeBuild {
135
+ cmake {
136
+ version "3.22.1" // Use the version you see in SDK Manager
137
+ cppFlags ""
138
+ }
139
+ }
96
140
  }
97
141
  signingConfigs {
98
142
  debug {
@@ -114,6 +158,27 @@ android {
114
158
  proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
115
159
  }
116
160
  }
161
+
162
+ applicationVariants.all { variant ->
163
+ variant.outputs.all { output ->
164
+
165
+ // For each separate APK per architecture, set a unique version code as described here:
166
+ // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
167
+
168
+
169
+ def projectName = project.env.get("PROJECT_NAME")
170
+ def SEP = "_"
171
+
172
+ def newApkName = projectName + SEP + project.env.get("ENV") + SEP + project.env.get("ANDROID_VERSION_NAME") + SEP + project.env.get("ANDROID_VERSION_CODE") + ".apk"
173
+
174
+
175
+ println "Naming File ... " + newApkName
176
+
177
+ outputFileName = new File(newApkName)
178
+ output.outputFileName = outputFileName
179
+
180
+ }
181
+ }
117
182
  }
118
183
 
119
184
  dependencies {
@@ -1,6 +1,8 @@
1
1
  <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
2
 
3
3
  <uses-permission android:name="android.permission.INTERNET" />
4
+ <uses-permission android:name="android.permission.CAMERA" />
5
+ <uses-permission android:name="android.permission.RECORD_AUDIO" />
4
6
 
5
7
  <application
6
8
  android:name=".MainApplication"
@@ -21,7 +21,6 @@ org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
21
21
  # Android operating system, and which are packaged with your app's APK
22
22
  # https://developer.android.com/topic/libraries/support-library/androidx-rn
23
23
  android.useAndroidX=true
24
-
25
24
  # Use this property to specify which architecture you want to build.
26
25
  # You can also override it from the CLI using
27
26
  # ./gradlew <task> -PreactNativeArchitectures=x86_64
@@ -1,3 +1,4 @@
1
1
  module.exports = {
2
2
  presets: ['module:@react-native/babel-preset'],
3
+ plugins: ['react-native-reanimated/plugin'],
3
4
  };
package/template/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @format
3
3
  */
4
-
4
+ import 'react-native-gesture-handler';
5
5
  import {AppRegistry} from 'react-native';
6
6
  import App from './App';
7
7
  import {name as appName} from './app.json';
@@ -1,13 +1,44 @@
1
- # Resolve react_native_pods.rb with node to allow for hoisting
2
- require Pod::Executable.execute_command('node', ['-p',
3
- 'require.resolve(
4
- "react-native/scripts/react_native_pods.rb",
5
- {paths: [process.argv[1]]},
6
- )', __dir__]).strip
1
+
2
+ def node_require(script)
3
+ # Resolve script with node to allow for hoisting
4
+ require Pod::Executable.execute_command('node', ['-p',
5
+ "require.resolve(
6
+ '#{script}',
7
+ {paths: [process.argv[1]]},
8
+ )", __dir__]).strip
9
+ end
10
+
11
+ # Use it to require both react-native's and this package's scripts:
12
+ node_require('react-native/scripts/react_native_pods.rb')
13
+ node_require('react-native-permissions/scripts/setup.rb')
7
14
 
8
15
  platform :ios, min_ios_version_supported
9
16
  prepare_react_native_project!
10
17
 
18
+ # ⬇️ uncomment the permissions you need
19
+ setup_permissions([
20
+ # 'AppTrackingTransparency',
21
+ # 'Bluetooth',
22
+ # 'Calendars',
23
+ # 'CalendarsWriteOnly',
24
+ 'Camera',
25
+ # 'Contacts',
26
+ # 'FaceID',
27
+ # 'LocationAccuracy',
28
+ # 'LocationAlways',
29
+ # 'LocationWhenInUse',
30
+ # 'MediaLibrary',
31
+ # 'Microphone',
32
+ # 'Motion',
33
+ # 'Notifications',
34
+ # 'PhotoLibrary',
35
+ # 'PhotoLibraryAddOnly',
36
+ # 'Reminders',
37
+ # 'Siri',
38
+ # 'SpeechRecognition',
39
+ # 'StoreKit',
40
+ ])
41
+
11
42
  linkage = ENV['USE_FRAMEWORKS']
12
43
  if linkage != nil
13
44
  Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
@@ -2424,7 +2424,7 @@ SPEC CHECKSUMS:
2424
2424
  RNFlashList: 2af1645548006fe5e4586c8c3d7e84f060a5478f
2425
2425
  RNGestureHandler: 0e5ae8d72ef4afb855e98dcdbe60f27d938abe13
2426
2426
  RNImageCropPicker: 8e39c01f205e00d739c31e682f068aac315587bf
2427
- RNPermissions: 39a675044df2cacca9216aa2141959e13faea625
2427
+ RNPermissions: a2215c93e4377ee4605de0fdfa68ebba153fd5a4
2428
2428
  RNReanimated: 56fffbede49b5bddb327616096e822f342978794
2429
2429
  RNScreens: d022507f2b6d76c73335e9e35aedcf7bb2f791b0
2430
2430
  RNShare: 05e577d8a74e5647a5cf753cd5e038623676392b
@@ -2436,6 +2436,6 @@ SPEC CHECKSUMS:
2436
2436
  VisionCamera: 598ab83c6bf4d65f5c32ec54361eed866505d388
2437
2437
  Yoga: fcc198acd4a55599b3468cfb6ebc526baff5f06e
2438
2438
 
2439
- PODFILE CHECKSUM: 820db672bab33b85da1c176ce60a11cdbabd6c2d
2439
+ PODFILE CHECKSUM: 03afa8c8b30bf768dd3ad3a051da20bf46eb45ed
2440
2440
 
2441
2441
  COCOAPODS: 1.15.2
@@ -32,6 +32,10 @@
32
32
  <key>NSAllowsLocalNetworking</key>
33
33
  <true/>
34
34
  </dict>
35
+ <key>NSCameraUsageDescription</key>
36
+ <string>$(PRODUCT_NAME) needs access to your Camera.</string>
37
+ <key>NSMicrophoneUsageDescription</key>
38
+ <string>$(PRODUCT_NAME) needs access to your Microphone.</string>
35
39
  <key>NSLocationWhenInUseUsageDescription</key>
36
40
  <string></string>
37
41
  <key>UILaunchStoryboardName</key>