@fadyshawky/react-native-magic 1.0.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.
- package/.vscode/settings.json +7 -0
- package/README.md +269 -0
- package/package.json +36 -0
- package/template/.bundle/config +2 -0
- package/template/.env.development +5 -0
- package/template/.env.production +5 -0
- package/template/.env.staging +5 -0
- package/template/.eslintrc.js +4 -0
- package/template/.prettierrc.js +7 -0
- package/template/.watchmanconfig +1 -0
- package/template/App.tsx +34 -0
- package/template/Gemfile +9 -0
- package/template/Gemfile.lock +117 -0
- package/template/README.md +79 -0
- package/template/__tests__/App.test.tsx +17 -0
- package/template/android/app/build.gradle +128 -0
- package/template/android/app/debug.keystore +0 -0
- package/template/android/app/proguard-rules.pro +10 -0
- package/template/android/app/src/debug/AndroidManifest.xml +9 -0
- package/template/android/app/src/main/AndroidManifest.xml +26 -0
- package/template/android/app/src/main/java/com/reactnativemagic/MainActivity.kt +22 -0
- package/template/android/app/src/main/java/com/reactnativemagic/MainApplication.kt +44 -0
- package/template/android/app/src/main/res/drawable/rn_edit_text_material.xml +37 -0
- package/template/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/template/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/template/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/template/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/template/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/template/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/template/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/template/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/template/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/template/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/template/android/app/src/main/res/values/strings.xml +3 -0
- package/template/android/app/src/main/res/values/styles.xml +9 -0
- package/template/android/build.gradle +21 -0
- package/template/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/template/android/gradle/wrapper/gradle-wrapper.properties +7 -0
- package/template/android/gradle.properties +39 -0
- package/template/android/gradlew +252 -0
- package/template/android/gradlew.bat +94 -0
- package/template/android/settings.gradle +6 -0
- package/template/app.json +4 -0
- package/template/babel.config.js +3 -0
- package/template/index.js +9 -0
- package/template/install-dev.sh +1 -0
- package/template/install.sh +1 -0
- package/template/ios/.xcode.env +11 -0
- package/template/ios/Podfile +42 -0
- package/template/ios/Podfile.lock +2461 -0
- package/template/ios/reactnativemagic/AppDelegate.h +6 -0
- package/template/ios/reactnativemagic/AppDelegate.mm +31 -0
- package/template/ios/reactnativemagic/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
- package/template/ios/reactnativemagic/Images.xcassets/Contents.json +6 -0
- package/template/ios/reactnativemagic/Info.plist +52 -0
- package/template/ios/reactnativemagic/LaunchScreen.storyboard +47 -0
- package/template/ios/reactnativemagic/PrivacyInfo.xcprivacy +46 -0
- package/template/ios/reactnativemagic/main.m +10 -0
- package/template/ios/reactnativemagic copy-Info.plist +52 -0
- package/template/ios/reactnativemagic.xcodeproj/project.pbxproj +836 -0
- package/template/ios/reactnativemagic.xcodeproj/xcshareddata/xcschemes/reactnativemagic.xcscheme +88 -0
- package/template/ios/reactnativemagic.xcworkspace/contents.xcworkspacedata +10 -0
- package/template/ios/reactnativemagic.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +8 -0
- package/template/ios/reactnativemagicTests/Info.plist +24 -0
- package/template/ios/reactnativemagicTests/reactnativemagicTests.m +66 -0
- package/template/ios/tmp.xcconfig +2 -0
- package/template/jest.config.js +3 -0
- package/template/metro.config.js +11 -0
- package/template/package-lock.json +18315 -0
- package/template/package.json +125 -0
- package/template/resources/symbols/SFSymbols.ts +2614 -0
- package/template/src/common/ImageResources.g.ts +14 -0
- package/template/src/common/components/Background.tsx +34 -0
- package/template/src/common/components/EmptyView.tsx +31 -0
- package/template/src/common/components/FlatListWrapper.tsx +66 -0
- package/template/src/common/components/IconPlatform.tsx +17 -0
- package/template/src/common/components/ImageCropPickerButton.tsx +108 -0
- package/template/src/common/components/LoadingComponent.tsx +16 -0
- package/template/src/common/components/PhotoTakingButton.tsx +99 -0
- package/template/src/common/components/PrimaryButton.tsx +305 -0
- package/template/src/common/components/PrimaryTextInput.tsx +287 -0
- package/template/src/common/components/RadioButton.tsx +73 -0
- package/template/src/common/components/RadioIcon.tsx +63 -0
- package/template/src/common/components/Separator.tsx +39 -0
- package/template/src/common/components/Svg.tsx +25 -0
- package/template/src/common/components/TouchablePlatform.tsx +70 -0
- package/template/src/common/components/TryAgain.tsx +56 -0
- package/template/src/common/helpers/arrayHelpers.ts +29 -0
- package/template/src/common/helpers/calculatePage.ts +16 -0
- package/template/src/common/helpers/colorHelpers.ts +34 -0
- package/template/src/common/helpers/defaultKeyIdExtractor.ts +5 -0
- package/template/src/common/helpers/dialogsHelpers.ts +66 -0
- package/template/src/common/helpers/imageHelpers.ts +5 -0
- package/template/src/common/helpers/inAppReviewHelper.ts +31 -0
- package/template/src/common/helpers/netInfoHelpers.ts +42 -0
- package/template/src/common/helpers/orientationHelpers.ts +25 -0
- package/template/src/common/helpers/regexHelpers.ts +7 -0
- package/template/src/common/helpers/shareHelpers.ts +47 -0
- package/template/src/common/helpers/stringsHelpers.ts +15 -0
- package/template/src/common/hooks/useBackHandler.ts +10 -0
- package/template/src/common/hooks/useDebounce.ts +17 -0
- package/template/src/common/hooks/useEventRegister.ts +50 -0
- package/template/src/common/hooks/useFlatListActions.ts +31 -0
- package/template/src/common/hooks/usePrevious.ts +11 -0
- package/template/src/common/hooks/useWhyDidYouUpdate.ts +27 -0
- package/template/src/common/localization/dateFormatter.ts +108 -0
- package/template/src/common/localization/intlFormatter.ts +37 -0
- package/template/src/common/localization/localization.ts +51 -0
- package/template/src/common/localization/translations/commonLocalization.ts +29 -0
- package/template/src/common/localization/translations/emptyLocalization.ts +6 -0
- package/template/src/common/localization/translations/errorsLocalization.ts +22 -0
- package/template/src/common/localization/translations/homeLocalization.ts +5 -0
- package/template/src/common/localization/translations/loginLocalization.ts +14 -0
- package/template/src/common/localization/translations/onboardingLocalization.ts +13 -0
- package/template/src/common/localization/translations/pagesLocalization.ts +14 -0
- package/template/src/common/localization/translations/profileLocalization.ts +6 -0
- package/template/src/common/urls/baseUrlOpener.ts +31 -0
- package/template/src/common/urls/emailUrl.ts +20 -0
- package/template/src/common/urls/httpUrl.ts +19 -0
- package/template/src/common/urls/mapUrl.ts +22 -0
- package/template/src/common/urls/phoneUrl.ts +16 -0
- package/template/src/common/utils/createPerfectSize.ts +15 -0
- package/template/src/common/utils/listHandlers.ts +30 -0
- package/template/src/common/utils/newState.ts +5 -0
- package/template/src/common/utils/serializeQueryParams.ts +10 -0
- package/template/src/common/validations/authValidations.ts +15 -0
- package/template/src/common/validations/commonValidations.ts +39 -0
- package/template/src/common/validations/errorValidations.ts +72 -0
- package/template/src/common/validations/hooks/useDatesError.ts +40 -0
- package/template/src/common/validations/hooks/useInputError.ts +30 -0
- package/template/src/common/validations/profileValidations.ts +30 -0
- package/template/src/common/validations/validationConstants.ts +20 -0
- package/template/src/core/api/responseHandlers.ts +43 -0
- package/template/src/core/api/serverHeaders.ts +39 -0
- package/template/src/core/store/app/appSlice.ts +12 -0
- package/template/src/core/store/app/appState.ts +3 -0
- package/template/src/core/store/reduxHelpers.ts +11 -0
- package/template/src/core/store/rootReducer.ts +10 -0
- package/template/src/core/store/store.tsx +41 -0
- package/template/src/core/store/user/userActions.ts +31 -0
- package/template/src/core/store/user/userSlice.ts +62 -0
- package/template/src/core/store/user/userState.ts +44 -0
- package/template/src/core/theme/colors.ts +117 -0
- package/template/src/core/theme/commonConsts.ts +45 -0
- package/template/src/core/theme/commonSizes.ts +70 -0
- package/template/src/core/theme/commonStyles.ts +228 -0
- package/template/src/core/theme/fonts.ts +12 -0
- package/template/src/navigation/AuthStack.tsx +39 -0
- package/template/src/navigation/HeaderComponents.tsx +104 -0
- package/template/src/navigation/MainNavigation.tsx +55 -0
- package/template/src/navigation/MainStack.tsx +99 -0
- package/template/src/navigation/RootNavigation.tsx +33 -0
- package/template/src/navigation/TabBar.tsx +94 -0
- package/template/src/navigation/TopTabBar.tsx +75 -0
- package/template/src/navigation/types.ts +5 -0
- package/template/src/screens/Login/Login.tsx +114 -0
- package/template/src/screens/Settings/Settings.tsx +5 -0
- package/template/src/screens/main/Main.tsx +5 -0
- package/template/src/screens/profile/Profile.tsx +5 -0
- package/template/src/screens/splash/Splash.tsx +19 -0
- package/template/src/sheetManager/sheets.tsx +14 -0
- package/template/tsconfig.json +3 -0
- package/template/types/index.ts +108 -0
- package/template/types/react-native-config.d.ts +19 -0
- package/template.config.js +4 -0
package/README.md
ADDED
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
# ReactNativeMagic
|
|
2
|
+
|
|
3
|
+
A modern, production-ready React Native template with best practices, common dependencies, and a scalable architecture.
|
|
4
|
+
|
|
5
|
+
## Requirements
|
|
6
|
+
|
|
7
|
+
- Node.js >= 14 ([Download](https://nodejs.org/en/download/))
|
|
8
|
+
- JDK >= 11 ([Download](https://www.oracle.com/java/technologies/downloads/))
|
|
9
|
+
- Ruby >= 2.7.5 (for iOS) ([Download](https://www.ruby-lang.org/en/downloads/))
|
|
10
|
+
- Xcode (for iOS) ([Mac App Store](https://apps.apple.com/us/app/xcode/id497799835))
|
|
11
|
+
- Android Studio (for Android) ([Download](https://developer.android.com/studio))
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx react-native init YourAppName --template reactnativemagic
|
|
17
|
+
cd YourAppName
|
|
18
|
+
npm install --legacy-peer-deps
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
For iOS, install pods:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
cd ios && pod install && cd ..
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Project Structure
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
YourAppName/
|
|
31
|
+
├── src/
|
|
32
|
+
│ ├── components/ # Reusable UI components
|
|
33
|
+
│ ├── screens/ # Screen components
|
|
34
|
+
│ ├── navigation/ # Navigation configurations
|
|
35
|
+
│ ├── services/ # API services and other external services
|
|
36
|
+
│ ├── store/ # State management
|
|
37
|
+
│ │ ├── slices/ # Redux slices
|
|
38
|
+
│ │ └── index.ts # Store configuration
|
|
39
|
+
│ ├── theme/ # Theme configurations
|
|
40
|
+
│ ├── utils/ # Utility functions
|
|
41
|
+
│ └── types/ # TypeScript type definitions
|
|
42
|
+
├── android/
|
|
43
|
+
├── ios/
|
|
44
|
+
└── ...
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Features
|
|
48
|
+
|
|
49
|
+
### 1. Type Safety
|
|
50
|
+
|
|
51
|
+
- Full TypeScript support
|
|
52
|
+
- Pre-configured tsconfig.json
|
|
53
|
+
- Type definitions for all components
|
|
54
|
+
|
|
55
|
+
### 2. Navigation
|
|
56
|
+
|
|
57
|
+
- React Navigation v6
|
|
58
|
+
- Type-safe navigation
|
|
59
|
+
- Bottom tabs setup
|
|
60
|
+
- Stack navigation setup
|
|
61
|
+
|
|
62
|
+
Documentation: [React Navigation](https://reactnavigation.org/docs/getting-started)
|
|
63
|
+
|
|
64
|
+
### 3. State Management
|
|
65
|
+
|
|
66
|
+
- Redux Toolkit
|
|
67
|
+
- Async storage integration
|
|
68
|
+
- Predefined store setup
|
|
69
|
+
|
|
70
|
+
Documentation: [Redux Toolkit](https://redux-toolkit.js.org/introduction/getting-started)
|
|
71
|
+
|
|
72
|
+
### 4. Environment Variables
|
|
73
|
+
|
|
74
|
+
- React Native Config integration
|
|
75
|
+
- Secure environment configuration
|
|
76
|
+
- Type-safe environment variables
|
|
77
|
+
|
|
78
|
+
Documentation: [React Native Config](https://github.com/luggit/react-native-config)
|
|
79
|
+
|
|
80
|
+
### 5. Styling
|
|
81
|
+
|
|
82
|
+
- React Native Paper
|
|
83
|
+
- Custom theming system
|
|
84
|
+
- Dark mode support
|
|
85
|
+
|
|
86
|
+
Documentation: [React Native Paper](https://callstack.github.io/react-native-paper/)
|
|
87
|
+
|
|
88
|
+
### 6. Testing
|
|
89
|
+
|
|
90
|
+
- Jest configuration
|
|
91
|
+
- React Native Testing Library
|
|
92
|
+
- Example tests included
|
|
93
|
+
|
|
94
|
+
Documentation:
|
|
95
|
+
|
|
96
|
+
- [Jest](https://jestjs.io/docs/getting-started)
|
|
97
|
+
- [React Native Testing Library](https://callstack.github.io/react-native-testing-library/)
|
|
98
|
+
|
|
99
|
+
## Available Scripts
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
# Start the Metro bundler
|
|
103
|
+
npm start
|
|
104
|
+
|
|
105
|
+
# Run on iOS
|
|
106
|
+
npm run ios
|
|
107
|
+
|
|
108
|
+
# Run on Android
|
|
109
|
+
npm run android
|
|
110
|
+
|
|
111
|
+
# Run tests
|
|
112
|
+
npm test
|
|
113
|
+
|
|
114
|
+
# Lint code
|
|
115
|
+
npm run lint
|
|
116
|
+
|
|
117
|
+
# Type checking
|
|
118
|
+
npm run typescript
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Dependencies
|
|
122
|
+
|
|
123
|
+
### Production Dependencies
|
|
124
|
+
|
|
125
|
+
```json
|
|
126
|
+
{
|
|
127
|
+
"@react-navigation/bottom-tabs": "^6.x",
|
|
128
|
+
"@react-navigation/native": "^6.x",
|
|
129
|
+
"@react-navigation/native-stack": "^6.x",
|
|
130
|
+
"@reduxjs/toolkit": "^1.x",
|
|
131
|
+
"react-native-paper": "^5.x",
|
|
132
|
+
"react-native-safe-area-context": "^4.x",
|
|
133
|
+
"react-native-screens": "^3.x",
|
|
134
|
+
"@react-native-async-storage/async-storage": "^1.x",
|
|
135
|
+
"react-native-config": "^1.x"
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Development Dependencies
|
|
140
|
+
|
|
141
|
+
```json
|
|
142
|
+
{
|
|
143
|
+
"@testing-library/react-native": "^11.x",
|
|
144
|
+
"@types/jest": "^29.x",
|
|
145
|
+
"@types/react": "^18.x",
|
|
146
|
+
"typescript": "^4.x",
|
|
147
|
+
"jest": "^29.x"
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## Common Issues & Solutions
|
|
152
|
+
|
|
153
|
+
### iOS Build Issues
|
|
154
|
+
|
|
155
|
+
1. Pod installation fails:
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
cd ios
|
|
159
|
+
pod deintegrate
|
|
160
|
+
pod install
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
2. Clean build:
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
cd ios
|
|
167
|
+
xcodebuild clean
|
|
168
|
+
cd ..
|
|
169
|
+
npm run ios
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Android Build Issues
|
|
173
|
+
|
|
174
|
+
1. Gradle issues:
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
cd android
|
|
178
|
+
./gradlew clean
|
|
179
|
+
cd ..
|
|
180
|
+
npm run android
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
2. SDK location issues:
|
|
184
|
+
Create a `local.properties` file in the android folder with your SDK path:
|
|
185
|
+
|
|
186
|
+
```properties
|
|
187
|
+
sdk.dir=/Users/USERNAME/Library/Android/sdk
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
## Customization
|
|
191
|
+
|
|
192
|
+
### 1. Changing Theme
|
|
193
|
+
|
|
194
|
+
Edit `src/theme/index.ts`:
|
|
195
|
+
|
|
196
|
+
```typescript
|
|
197
|
+
export const theme = {
|
|
198
|
+
colors: {
|
|
199
|
+
primary: "#YOUR_COLOR",
|
|
200
|
+
// ...
|
|
201
|
+
},
|
|
202
|
+
// ...
|
|
203
|
+
};
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### 2. Adding New Navigation Screens
|
|
207
|
+
|
|
208
|
+
1. Create screen in `src/screens`
|
|
209
|
+
2. Add to navigation stack in `src/navigation`
|
|
210
|
+
3. Update types in `src/types/navigation.ts`
|
|
211
|
+
|
|
212
|
+
### 3. Environment Variables
|
|
213
|
+
|
|
214
|
+
1. Create `.env` file in root directory:
|
|
215
|
+
|
|
216
|
+
```env
|
|
217
|
+
API_URL=https://api.example.com
|
|
218
|
+
ENV=development
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
2. Access variables in your code:
|
|
222
|
+
|
|
223
|
+
```typescript
|
|
224
|
+
import Config from "react-native-config";
|
|
225
|
+
|
|
226
|
+
console.log(Config.API_URL);
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
Note: Remember to add `.env` to your `.gitignore` file and provide a `.env.example` template.
|
|
230
|
+
|
|
231
|
+
## Contributing
|
|
232
|
+
|
|
233
|
+
1. Fork the repository
|
|
234
|
+
2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
|
|
235
|
+
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
|
|
236
|
+
4. Push to the branch (`git push origin feature/AmazingFeature`)
|
|
237
|
+
5. Open a Pull Request
|
|
238
|
+
|
|
239
|
+
## Useful Links
|
|
240
|
+
|
|
241
|
+
- [React Native Documentation](https://reactnative.dev/docs/getting-started)
|
|
242
|
+
- [TypeScript Documentation](https://www.typescriptlang.org/docs/)
|
|
243
|
+
- [React Navigation Documentation](https://reactnavigation.org/docs/getting-started)
|
|
244
|
+
- [Redux Toolkit Documentation](https://redux-toolkit.js.org/introduction/getting-started)
|
|
245
|
+
- [React Native Paper Documentation](https://callstack.github.io/react-native-paper/)
|
|
246
|
+
|
|
247
|
+
## License
|
|
248
|
+
|
|
249
|
+
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details
|
|
250
|
+
|
|
251
|
+
## Support
|
|
252
|
+
|
|
253
|
+
If you find this template helpful, consider buying me a coffee! ☕️
|
|
254
|
+
|
|
255
|
+
<a href="https://www.buymeacoffee.com/fadytshawke" target="_blank">
|
|
256
|
+
<img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" height="60px" width="217px">
|
|
257
|
+
</a>
|
|
258
|
+
|
|
259
|
+
## Author
|
|
260
|
+
|
|
261
|
+
Fady Shawky
|
|
262
|
+
|
|
263
|
+
- GitHub: [@fadyshawky](https://github.com/fadyshawky)
|
|
264
|
+
|
|
265
|
+
## Acknowledgments
|
|
266
|
+
|
|
267
|
+
- React Native Team
|
|
268
|
+
- React Navigation Team
|
|
269
|
+
- All contributors who help maintain this template
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@fadyshawky/react-native-magic",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "react native template with ready components, hooks, react navigation, redux, typescript, etc.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"react-native",
|
|
7
|
+
"typescript",
|
|
8
|
+
"jest",
|
|
9
|
+
"template",
|
|
10
|
+
"boilerplate",
|
|
11
|
+
"react-native-template",
|
|
12
|
+
"redux",
|
|
13
|
+
"react-navigation",
|
|
14
|
+
"state-management",
|
|
15
|
+
"bottom-sheet"
|
|
16
|
+
],
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"author": "Fady Shawky",
|
|
19
|
+
"type": "commonjs",
|
|
20
|
+
"main": "index.js",
|
|
21
|
+
"scripts": {
|
|
22
|
+
"test": "exit 0"
|
|
23
|
+
},
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "https://github.com/fadyshawky/ReactNativeMagic.git"
|
|
27
|
+
},
|
|
28
|
+
"bugs": {
|
|
29
|
+
"url": "https://github.com/fadyshawky/ReactNativeMagic/issues"
|
|
30
|
+
},
|
|
31
|
+
"homepage": "https://github.com/fadyshawky/ReactNativeMagic#readme",
|
|
32
|
+
"funding": {
|
|
33
|
+
"type": "buymeacoffee",
|
|
34
|
+
"url": "https://buymeacoffee.com/fadytshawke"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
package/template/App.tsx
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sample React Native App
|
|
3
|
+
* https://github.com/facebook/react-native
|
|
4
|
+
*
|
|
5
|
+
* @format
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import {LogBox, SafeAreaView, StatusBar} from 'react-native';
|
|
10
|
+
import {SheetProvider} from 'react-native-actions-sheet';
|
|
11
|
+
import {SafeAreaProvider} from 'react-native-safe-area-context';
|
|
12
|
+
import {Provider} from 'react-redux';
|
|
13
|
+
import {PersistGate} from 'redux-persist/integration/react';
|
|
14
|
+
import {persistor, store} from './src/core/store/store';
|
|
15
|
+
import AppNavigator from './src/navigation/MainNavigation';
|
|
16
|
+
|
|
17
|
+
LogBox.ignoreAllLogs();
|
|
18
|
+
function App(): React.JSX.Element {
|
|
19
|
+
return (
|
|
20
|
+
<Provider store={store}>
|
|
21
|
+
<PersistGate loading={null} persistor={persistor}>
|
|
22
|
+
<SafeAreaProvider>
|
|
23
|
+
<SafeAreaView style={{position: 'absolute'}} />
|
|
24
|
+
<StatusBar barStyle={'dark-content'} backgroundColor={'white'} />
|
|
25
|
+
<SheetProvider>
|
|
26
|
+
<AppNavigator />
|
|
27
|
+
</SheetProvider>
|
|
28
|
+
</SafeAreaProvider>
|
|
29
|
+
</PersistGate>
|
|
30
|
+
</Provider>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export default App;
|
package/template/Gemfile
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
source 'https://rubygems.org'
|
|
2
|
+
|
|
3
|
+
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
|
|
4
|
+
ruby ">= 2.6.10"
|
|
5
|
+
|
|
6
|
+
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
|
|
7
|
+
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
|
|
8
|
+
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
|
|
9
|
+
gem 'xcodeproj', '< 1.26.0'
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
GEM
|
|
2
|
+
remote: https://rubygems.org/
|
|
3
|
+
specs:
|
|
4
|
+
CFPropertyList (3.0.7)
|
|
5
|
+
base64
|
|
6
|
+
nkf
|
|
7
|
+
rexml
|
|
8
|
+
activesupport (7.2.2.1)
|
|
9
|
+
base64
|
|
10
|
+
benchmark (>= 0.3)
|
|
11
|
+
bigdecimal
|
|
12
|
+
concurrent-ruby (~> 1.0, >= 1.3.1)
|
|
13
|
+
connection_pool (>= 2.2.5)
|
|
14
|
+
drb
|
|
15
|
+
i18n (>= 1.6, < 2)
|
|
16
|
+
logger (>= 1.4.2)
|
|
17
|
+
minitest (>= 5.1)
|
|
18
|
+
securerandom (>= 0.3)
|
|
19
|
+
tzinfo (~> 2.0, >= 2.0.5)
|
|
20
|
+
addressable (2.8.7)
|
|
21
|
+
public_suffix (>= 2.0.2, < 7.0)
|
|
22
|
+
algoliasearch (1.27.5)
|
|
23
|
+
httpclient (~> 2.8, >= 2.8.3)
|
|
24
|
+
json (>= 1.5.1)
|
|
25
|
+
atomos (0.1.3)
|
|
26
|
+
base64 (0.2.0)
|
|
27
|
+
benchmark (0.4.0)
|
|
28
|
+
bigdecimal (3.1.8)
|
|
29
|
+
claide (1.1.0)
|
|
30
|
+
cocoapods (1.15.2)
|
|
31
|
+
addressable (~> 2.8)
|
|
32
|
+
claide (>= 1.0.2, < 2.0)
|
|
33
|
+
cocoapods-core (= 1.15.2)
|
|
34
|
+
cocoapods-deintegrate (>= 1.0.3, < 2.0)
|
|
35
|
+
cocoapods-downloader (>= 2.1, < 3.0)
|
|
36
|
+
cocoapods-plugins (>= 1.0.0, < 2.0)
|
|
37
|
+
cocoapods-search (>= 1.0.0, < 2.0)
|
|
38
|
+
cocoapods-trunk (>= 1.6.0, < 2.0)
|
|
39
|
+
cocoapods-try (>= 1.1.0, < 2.0)
|
|
40
|
+
colored2 (~> 3.1)
|
|
41
|
+
escape (~> 0.0.4)
|
|
42
|
+
fourflusher (>= 2.3.0, < 3.0)
|
|
43
|
+
gh_inspector (~> 1.0)
|
|
44
|
+
molinillo (~> 0.8.0)
|
|
45
|
+
nap (~> 1.0)
|
|
46
|
+
ruby-macho (>= 2.3.0, < 3.0)
|
|
47
|
+
xcodeproj (>= 1.23.0, < 2.0)
|
|
48
|
+
cocoapods-core (1.15.2)
|
|
49
|
+
activesupport (>= 5.0, < 8)
|
|
50
|
+
addressable (~> 2.8)
|
|
51
|
+
algoliasearch (~> 1.0)
|
|
52
|
+
concurrent-ruby (~> 1.1)
|
|
53
|
+
fuzzy_match (~> 2.0.4)
|
|
54
|
+
nap (~> 1.0)
|
|
55
|
+
netrc (~> 0.11)
|
|
56
|
+
public_suffix (~> 4.0)
|
|
57
|
+
typhoeus (~> 1.0)
|
|
58
|
+
cocoapods-deintegrate (1.0.5)
|
|
59
|
+
cocoapods-downloader (2.1)
|
|
60
|
+
cocoapods-plugins (1.0.0)
|
|
61
|
+
nap
|
|
62
|
+
cocoapods-search (1.0.1)
|
|
63
|
+
cocoapods-trunk (1.6.0)
|
|
64
|
+
nap (>= 0.8, < 2.0)
|
|
65
|
+
netrc (~> 0.11)
|
|
66
|
+
cocoapods-try (1.2.0)
|
|
67
|
+
colored2 (3.1.2)
|
|
68
|
+
concurrent-ruby (1.3.4)
|
|
69
|
+
connection_pool (2.4.1)
|
|
70
|
+
drb (2.2.1)
|
|
71
|
+
escape (0.0.4)
|
|
72
|
+
ethon (0.16.0)
|
|
73
|
+
ffi (>= 1.15.0)
|
|
74
|
+
ffi (1.17.0)
|
|
75
|
+
fourflusher (2.3.1)
|
|
76
|
+
fuzzy_match (2.0.4)
|
|
77
|
+
gh_inspector (1.1.3)
|
|
78
|
+
httpclient (2.8.3)
|
|
79
|
+
i18n (1.14.6)
|
|
80
|
+
concurrent-ruby (~> 1.0)
|
|
81
|
+
json (2.9.1)
|
|
82
|
+
logger (1.6.4)
|
|
83
|
+
minitest (5.25.4)
|
|
84
|
+
molinillo (0.8.0)
|
|
85
|
+
nanaimo (0.3.0)
|
|
86
|
+
nap (1.1.0)
|
|
87
|
+
netrc (0.11.0)
|
|
88
|
+
nkf (0.2.0)
|
|
89
|
+
public_suffix (4.0.7)
|
|
90
|
+
rexml (3.4.0)
|
|
91
|
+
ruby-macho (2.5.1)
|
|
92
|
+
securerandom (0.4.1)
|
|
93
|
+
typhoeus (1.4.1)
|
|
94
|
+
ethon (>= 0.9.0)
|
|
95
|
+
tzinfo (2.0.6)
|
|
96
|
+
concurrent-ruby (~> 1.0)
|
|
97
|
+
xcodeproj (1.25.1)
|
|
98
|
+
CFPropertyList (>= 2.3.3, < 4.0)
|
|
99
|
+
atomos (~> 0.1.3)
|
|
100
|
+
claide (>= 1.0.2, < 2.0)
|
|
101
|
+
colored2 (~> 3.1)
|
|
102
|
+
nanaimo (~> 0.3.0)
|
|
103
|
+
rexml (>= 3.3.6, < 4.0)
|
|
104
|
+
|
|
105
|
+
PLATFORMS
|
|
106
|
+
ruby
|
|
107
|
+
|
|
108
|
+
DEPENDENCIES
|
|
109
|
+
activesupport (>= 6.1.7.5, != 7.1.0)
|
|
110
|
+
cocoapods (>= 1.13, != 1.15.1, != 1.15.0)
|
|
111
|
+
xcodeproj (< 1.26.0)
|
|
112
|
+
|
|
113
|
+
RUBY VERSION
|
|
114
|
+
ruby 3.3.3p89
|
|
115
|
+
|
|
116
|
+
BUNDLED WITH
|
|
117
|
+
2.5.11
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
This is a new [**React Native**](https://reactnative.dev) project, bootstrapped using [`@react-native-community/cli`](https://github.com/react-native-community/cli).
|
|
2
|
+
|
|
3
|
+
# Getting Started
|
|
4
|
+
|
|
5
|
+
>**Note**: Make sure you have completed the [React Native - Environment Setup](https://reactnative.dev/docs/environment-setup) instructions till "Creating a new application" step, before proceeding.
|
|
6
|
+
|
|
7
|
+
## Step 1: Start the Metro Server
|
|
8
|
+
|
|
9
|
+
First, you will need to start **Metro**, the JavaScript _bundler_ that ships _with_ React Native.
|
|
10
|
+
|
|
11
|
+
To start Metro, run the following command from the _root_ of your React Native project:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# using npm
|
|
15
|
+
npm start
|
|
16
|
+
|
|
17
|
+
# OR using Yarn
|
|
18
|
+
yarn start
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Step 2: Start your Application
|
|
22
|
+
|
|
23
|
+
Let Metro Bundler run in its _own_ terminal. Open a _new_ terminal from the _root_ of your React Native project. Run the following command to start your _Android_ or _iOS_ app:
|
|
24
|
+
|
|
25
|
+
### For Android
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
# using npm
|
|
29
|
+
npm run android
|
|
30
|
+
|
|
31
|
+
# OR using Yarn
|
|
32
|
+
yarn android
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### For iOS
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
# using npm
|
|
39
|
+
npm run ios
|
|
40
|
+
|
|
41
|
+
# OR using Yarn
|
|
42
|
+
yarn ios
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
If everything is set up _correctly_, you should see your new app running in your _Android Emulator_ or _iOS Simulator_ shortly provided you have set up your emulator/simulator correctly.
|
|
46
|
+
|
|
47
|
+
This is one way to run your app — you can also run it directly from within Android Studio and Xcode respectively.
|
|
48
|
+
|
|
49
|
+
## Step 3: Modifying your App
|
|
50
|
+
|
|
51
|
+
Now that you have successfully run the app, let's modify it.
|
|
52
|
+
|
|
53
|
+
1. Open `App.tsx` in your text editor of choice and edit some lines.
|
|
54
|
+
2. For **Android**: Press the <kbd>R</kbd> key twice or select **"Reload"** from the **Developer Menu** (<kbd>Ctrl</kbd> + <kbd>M</kbd> (on Window and Linux) or <kbd>Cmd ⌘</kbd> + <kbd>M</kbd> (on macOS)) to see your changes!
|
|
55
|
+
|
|
56
|
+
For **iOS**: Hit <kbd>Cmd ⌘</kbd> + <kbd>R</kbd> in your iOS Simulator to reload the app and see your changes!
|
|
57
|
+
|
|
58
|
+
## Congratulations! :tada:
|
|
59
|
+
|
|
60
|
+
You've successfully run and modified your React Native App. :partying_face:
|
|
61
|
+
|
|
62
|
+
### Now what?
|
|
63
|
+
|
|
64
|
+
- If you want to add this new React Native code to an existing application, check out the [Integration guide](https://reactnative.dev/docs/integration-with-existing-apps).
|
|
65
|
+
- If you're curious to learn more about React Native, check out the [Introduction to React Native](https://reactnative.dev/docs/getting-started).
|
|
66
|
+
|
|
67
|
+
# Troubleshooting
|
|
68
|
+
|
|
69
|
+
If you can't get this to work, see the [Troubleshooting](https://reactnative.dev/docs/troubleshooting) page.
|
|
70
|
+
|
|
71
|
+
# Learn More
|
|
72
|
+
|
|
73
|
+
To learn more about React Native, take a look at the following resources:
|
|
74
|
+
|
|
75
|
+
- [React Native Website](https://reactnative.dev) - learn more about React Native.
|
|
76
|
+
- [Getting Started](https://reactnative.dev/docs/environment-setup) - an **overview** of React Native and how setup your environment.
|
|
77
|
+
- [Learn the Basics](https://reactnative.dev/docs/getting-started) - a **guided tour** of the React Native **basics**.
|
|
78
|
+
- [Blog](https://reactnative.dev/blog) - read the latest official React Native **Blog** posts.
|
|
79
|
+
- [`@facebook/react-native`](https://github.com/facebook/react-native) - the Open Source; GitHub **repository** for React Native.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @format
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import 'react-native';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import App from '../App';
|
|
8
|
+
|
|
9
|
+
// Note: import explicitly to use the types shipped with jest.
|
|
10
|
+
import {it} from '@jest/globals';
|
|
11
|
+
|
|
12
|
+
// Note: test renderer must be required after react-native.
|
|
13
|
+
import renderer from 'react-test-renderer';
|
|
14
|
+
|
|
15
|
+
it('renders correctly', () => {
|
|
16
|
+
renderer.create(<App />);
|
|
17
|
+
});
|