@fadyshawky/react-native-magic 1.0.3 → 1.0.5

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 (41) hide show
  1. package/CHANGELOG.md +74 -0
  2. package/README.md +2 -4
  3. package/local.properties +1 -0
  4. package/package.json +2 -3
  5. package/template/.env.development +3 -0
  6. package/template/.env.production +4 -1
  7. package/template/.env.staging +4 -1
  8. package/template/App.tsx +0 -1
  9. package/template/android/app/build.gradle +71 -6
  10. package/template/android/app/src/main/AndroidManifest.xml +2 -0
  11. package/template/android/app/src/main/java/com/reactnativemagic/MainActivity.kt +5 -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 +67 -67
  19. package/template/ios/tmp.xcconfig +2 -0
  20. package/template/metro.config.js +6 -1
  21. package/template/package-lock.json +13 -12
  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/components/PhotoTakingButton.tsx +5 -7
  27. package/template/src/common/components/PrimaryTextInput.tsx +4 -15
  28. package/template/src/common/components/RadioButton.tsx +2 -9
  29. package/template/src/common/components/RadioIcon.tsx +4 -12
  30. package/template/src/common/components/Separator.tsx +2 -9
  31. package/template/src/common/components/TouchablePlatform.tsx +2 -11
  32. package/template/src/common/components/TryAgain.tsx +2 -9
  33. package/template/src/core/store/user/userActions.ts +0 -3
  34. package/template/src/core/theme/colors.ts +42 -71
  35. package/template/src/core/theme/fonts.ts +1 -12
  36. package/template/src/navigation/HeaderComponents.tsx +3 -5
  37. package/template/src/navigation/MainNavigation.tsx +8 -6
  38. package/template/src/navigation/MainStack.tsx +0 -1
  39. package/template/src/screens/Login/Login.tsx +0 -6
  40. package/template/src/types/react-native-config.d.ts +8 -0
  41. package/template/src/common/helpers/colorHelpers.ts +0 -34
package/CHANGELOG.md ADDED
@@ -0,0 +1,74 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ ## [1.0.5] - 2024-12-23
6
+
7
+ ### Fixed
8
+ - Resolved Android build configuration issues
9
+ - Fixed package dependencies setup and initialization
10
+ - Optimized Gradle build settings for Android
11
+ - Fixed iOS permissions configuration
12
+
13
+ ## [1.0.4] - 2024-12-22
14
+
15
+ ### Fixed
16
+ - Updated React Native Screens configuration for React Navigation v7 compatibility
17
+ - Fixed navigation theme implementation for Poppins font family
18
+
19
+ ### Changed
20
+ - Simplified navigation container theme configuration
21
+ - Removed deprecated font configurations
22
+
23
+ ## [1.0.3] - 2024-12-21
24
+
25
+ ### Added
26
+ - Enhanced template structure with additional hooks and utilities
27
+ - Added new dependencies:
28
+ - @react-native-camera-roll/camera-roll ^7.9.0
29
+ - @react-native-community/datetimepicker ^8.2.0
30
+ - @react-native-community/image-editor ^4.2.1
31
+ - @react-native-community/netinfo ^11.4.1
32
+ - @react-native-community/slider ^4.5.5
33
+ - @shopify/flash-list ^1.7.2
34
+
35
+ ### Updated
36
+ - Updated React Navigation to v7
37
+ - Updated dependencies to latest versions:
38
+ - @react-navigation/bottom-tabs ^7.2.0
39
+ - @react-navigation/drawer ^7.1.1
40
+ - @react-navigation/material-top-tabs ^7.1.0
41
+ - @react-navigation/native ^7.0.14
42
+ - @react-navigation/native-stack ^7.2.0
43
+ - @reduxjs/toolkit ^2.5.0
44
+
45
+ ### Changed
46
+ - Improved project structure and organization
47
+ - Enhanced iOS configuration
48
+ - Updated Android Gradle configuration
49
+
50
+ ## [1.0.2] - 2024-12-20
51
+
52
+ ### Added
53
+ - Initial template setup with TypeScript support
54
+ - Basic navigation structure
55
+ - Redux integration with persist storage
56
+ - Common hooks and utilities
57
+
58
+ ### Changed
59
+ - Updated project dependencies
60
+ - Improved documentation
61
+
62
+ ## [1.0.1] - 2024-12-19
63
+
64
+ ### Added
65
+ - Basic React Native template structure
66
+ - Essential project configuration
67
+ - Initial README documentation
68
+
69
+ ## [1.0.0] - 2024-12-18
70
+
71
+ ### Added
72
+ - Initial release
73
+ - Basic project setup
74
+ - Core dependencies
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.3",
3
+ "version": "1.0.5",
4
4
  "description": "react native template with ready components, hooks, react navigation, redux, typescript, etc.",
5
5
  "keywords": [
6
6
  "react-native-magic",
@@ -20,6 +20,7 @@
20
20
  "type": "commonjs",
21
21
  "main": "index.js",
22
22
  "dependencies": {
23
+ "@fontsource/poppins": "^5.1.0",
23
24
  "@react-native-async-storage/async-storage": "^2.1.0",
24
25
  "@react-native-camera-roll/camera-roll": "^7.9.0",
25
26
  "@react-native-community/datetimepicker": "^8.2.0",
@@ -64,8 +65,6 @@
64
65
  "react-native-orientation-locker": "^1.7.0",
65
66
  "react-native-pager-view": "^6.6.1",
66
67
  "react-native-permissions": "^5.2.1",
67
- "react-native-reanimated": "^3.16.6",
68
- "react-native-reanimated-carousel": "^3.5.1",
69
68
  "react-native-safe-area-context": "^5.0.0",
70
69
  "react-native-screens": "^4.4.0",
71
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,7 +4,6 @@
4
4
  *
5
5
  * @format
6
6
  */
7
-
8
7
  import React from 'react';
9
8
  import {LogBox, SafeAreaView, StatusBar} from 'react-native';
10
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"
@@ -1,5 +1,6 @@
1
1
  package com.reactnativemagic
2
2
 
3
+ import android.os.Bundle
3
4
  import com.facebook.react.ReactActivity
4
5
  import com.facebook.react.ReactActivityDelegate
5
6
  import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
@@ -7,6 +8,10 @@ import com.facebook.react.defaults.DefaultReactActivityDelegate
7
8
 
8
9
  class MainActivity : ReactActivity() {
9
10
 
11
+ override fun onCreate(savedInstanceState: Bundle?) {
12
+ super.onCreate(null)
13
+ }
14
+
10
15
  /**
11
16
  * Returns the name of the main component registered from JavaScript. This is used to schedule
12
17
  * rendering of the component.
@@ -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>