├── .all-contributorsrc ├── .buckconfig ├── .bundle └── config ├── .eslintrc.js ├── .flowconfig ├── .github ├── FUNDING.yml └── dependabot.yml ├── .gitignore ├── .husky ├── .gitignore ├── commit-msg └── pre-commit ├── .prettierignore ├── .prettierrc.js ├── .travis.yml ├── .watchmanconfig ├── Gemfile ├── Gemfile.lock ├── LICENSE ├── README.md ├── __tests__ └── App.test.tsx ├── android ├── app │ ├── BUCK │ ├── build.gradle │ ├── build_defs.bzl │ ├── debug.keystore │ ├── proguard-rules.pro │ └── src │ │ ├── debug │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── reactnativestarterapp │ │ │ └── ReactNativeFlipper.java │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── assets │ │ │ └── fonts │ │ │ │ ├── Lato-Black.ttf │ │ │ │ ├── Lato-BlackItalic.ttf │ │ │ │ ├── Lato-Bold.ttf │ │ │ │ ├── Lato-BoldItalic.ttf │ │ │ │ ├── Lato-Italic.ttf │ │ │ │ ├── Lato-Light.ttf │ │ │ │ ├── Lato-LightItalic.ttf │ │ │ │ ├── Lato-Regular.ttf │ │ │ │ ├── Lato-Thin.ttf │ │ │ │ └── Lato-ThinItalic.ttf │ │ ├── java │ │ │ └── com │ │ │ │ └── reactnativestarterapp │ │ │ │ ├── MainActivity.java │ │ │ │ └── MainApplication.java │ │ └── res │ │ │ ├── drawable │ │ │ └── rn_edit_text_material.xml │ │ │ ├── mipmap-hdpi │ │ │ └── bootsplash_logo.png │ │ │ ├── mipmap-mdpi │ │ │ └── bootsplash_logo.png │ │ │ ├── mipmap-xhdpi │ │ │ └── bootsplash_logo.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── bootsplash_logo.png │ │ │ ├── mipmap-xxxhdpi │ │ │ └── bootsplash_logo.png │ │ │ └── values │ │ │ ├── colors.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ └── release │ │ └── java │ │ └── com │ │ └── reactnativestarterapp │ │ └── ReactNativeFlipper.java ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── link-assets-manifest.json └── settings.gradle ├── app.json ├── assets ├── android_splashscreen.png ├── bootsplash_logo.png ├── bootsplash_logo@1,5x.png ├── bootsplash_logo@2x.png ├── bootsplash_logo@3x.png ├── bootsplash_logo@4x.png ├── icon.png └── ios_splashscreen.png ├── babel.config.js ├── commitlint.config.js ├── docs ├── error.png └── ios_locations.png ├── index.js ├── ios ├── .xcode.env ├── Podfile ├── Podfile.lock ├── ReactNativeStarterApp.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ └── ReactNativeStarterApp.xcscheme ├── ReactNativeStarterApp.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── ReactNativeStarterApp │ ├── AppDelegate.h │ ├── AppDelegate.mm │ ├── Base.lproj │ │ └── LaunchScreen.xib │ ├── BootSplash.storyboard │ ├── Images.xcassets │ │ └── Contents.json │ ├── Info.plist │ └── main.m ├── ReactNativeStarterAppTests │ ├── Info.plist │ └── ReactNativeStarterAppTests.m └── link-assets-manifest.json ├── jest.config.js ├── metro.config.js ├── navigation.d.ts ├── package.json ├── react-native-starter-kit.png ├── react-native.config.js ├── screenshots ├── screenshot1.png ├── screenshot2.png └── screenshot3.png ├── scripts └── set-environment.js ├── src ├── App.tsx ├── ContainerApp.tsx ├── api │ └── index.ts ├── assets │ ├── fonts │ │ ├── Lato-Black.ttf │ │ ├── Lato-BlackItalic.ttf │ │ ├── Lato-Bold.ttf │ │ ├── Lato-BoldItalic.ttf │ │ ├── Lato-Italic.ttf │ │ ├── Lato-Light.ttf │ │ ├── Lato-LightItalic.ttf │ │ ├── Lato-Regular.ttf │ │ ├── Lato-Thin.ttf │ │ └── Lato-ThinItalic.ttf │ └── images │ │ └── reactnative.png ├── components │ ├── AppVersion │ │ └── index.tsx │ ├── CLoader │ │ ├── index.tsx │ │ └── styles.ts │ ├── CSafeAreaView │ │ └── index.tsx │ ├── GenericHeader │ │ ├── index.tsx │ │ └── styles.ts │ └── GenericModal │ │ └── index.tsx ├── constants │ ├── theme.ts │ └── toast.tsx ├── hooks │ └── useNavigationBack.ts ├── i18n │ ├── index.ts │ ├── languageConfig.ts │ ├── languageDetector.ts │ └── locales │ │ ├── en.json │ │ └── it.json ├── mmkv │ └── index.ts ├── redux │ ├── actions.ts │ ├── messageHandler │ │ ├── actions.ts │ │ ├── reducers.ts │ │ ├── selectors.ts │ │ └── types.ts │ ├── reducers.ts │ ├── reqres │ │ ├── actions.ts │ │ ├── apiCall.ts │ │ ├── indexSaga.ts │ │ ├── reducers.ts │ │ ├── sagas.ts │ │ ├── selectors.ts │ │ └── types.ts │ ├── rootSaga.ts │ ├── storage │ │ └── index.ts │ └── store.ts ├── routes │ ├── index.tsx │ ├── stacks │ │ └── MainStack.tsx │ └── utils │ │ └── index.ts ├── scenes │ ├── Homepage │ │ ├── index.tsx │ │ └── styles.ts │ ├── ModalPage │ │ └── index.tsx │ ├── UserDetails │ │ └── index.tsx │ └── UsersList │ │ └── index.tsx └── theme │ ├── animations.ts │ ├── colors.ts │ ├── fonts.ts │ ├── global.ts │ ├── index.ts │ ├── margin.ts │ ├── padding.ts │ └── tamagui.config.ts ├── tsconfig.json └── yarn.lock /.all-contributorsrc: -------------------------------------------------------------------------------- 1 | { 2 | "projectName": "react-native-starter-app", 3 | "projectOwner": "IronTony", 4 | "repoType": "github", 5 | "repoHost": "https://github.com", 6 | "files": [ 7 | "README.md" 8 | ], 9 | "imageSize": 100, 10 | "commit": true, 11 | "commitConvention": "none", 12 | "badgeTemplate": "[![All Contributors](https://img.shields.io/badge/all_contributors-<%= contributors.length %>-screen.svg?style=flat)](#contributors-:sparkles:)", 13 | "contributors": [ 14 | { 15 | "login": "IronTony", 16 | "name": "IronTony", 17 | "avatar_url": "https://avatars3.githubusercontent.com/u/3645225?v=4", 18 | "profile": "https://github.com/IronTony", 19 | "contributions": [ 20 | "ideas", 21 | "code", 22 | "doc", 23 | "bug", 24 | "maintenance", 25 | "platform", 26 | "question", 27 | "review", 28 | "test", 29 | "example" 30 | ] 31 | }, 32 | ], 33 | "contributorsPerLine": 7 34 | } 35 | -------------------------------------------------------------------------------- /.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /.bundle/config: -------------------------------------------------------------------------------- 1 | BUNDLE_PATH: "vendor/bundle" 2 | BUNDLE_FORCE_RUBY_PLATFORM: 1 -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | parser: '@typescript-eslint/parser', 4 | plugins: ['@typescript-eslint', 'react-hooks'], 5 | extends: [ 6 | '@react-native', 7 | 'plugin:prettier/recommended', 8 | 'eslint:recommended', 9 | 'plugin:@typescript-eslint/eslint-recommended', 10 | 'plugin:@typescript-eslint/recommended', 11 | ], 12 | rules: { 13 | 'ordered-imports': 0, 14 | }, 15 | overrides: [ 16 | { 17 | files: ['src/**/*.{ts,tsx}'], 18 | extends: [ 19 | 'plugin:@typescript-eslint/recommended', 20 | // 'plugin:@typescript-eslint/recommended-requiring-type-checking', // @TODO: Commented due the chaining-optional-operator bug: https://github.com/typescript-eslint/typescript-eslint/issues/2728 21 | ], 22 | rules: { 23 | '@typescript-eslint/ban-ts-comment': 'off', 24 | '@typescript-eslint/explicit-function-return-type': 'off', 25 | '@typescript-eslint/no-unused-vars': 'off', 26 | // All the @typescript-eslint/* rules here... 27 | '@typescript-eslint/no-unnecessary-type-arguments': 'error', 28 | '@typescript-eslint/prefer-nullish-coalescing': 'error', 29 | '@typescript-eslint/prefer-optional-chain': 'error', 30 | '@typescript-eslint/explicit-module-boundary-types': 'off', 31 | 'react-native/no-inline-styles': 'off', 32 | 'react-hooks/rules-of-hooks': 'error', 33 | 'react-hooks/exhaustive-deps': 'warn', 34 | }, 35 | parser: '@typescript-eslint/parser', 36 | parserOptions: { 37 | tsconfigRootDir: './', 38 | project: './tsconfig.json', 39 | }, 40 | }, 41 | ], 42 | }; 43 | -------------------------------------------------------------------------------- /.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | ; We fork some components by platform 3 | .*/*[.]android.js 4 | 5 | ; Ignore "BUCK" generated dirs 6 | /\.buckd/ 7 | 8 | ; Ignore polyfills 9 | node_modules/react-native/Libraries/polyfills/.* 10 | 11 | ; Flow doesn't support platforms 12 | .*/Libraries/Utilities/LoadingView.js 13 | 14 | .*/node_modules/resolve/test/resolver/malformed_package_json/package\.json$ 15 | 16 | [untyped] 17 | .*/node_modules/@react-native-community/cli/.*/.* 18 | 19 | [include] 20 | 21 | [libs] 22 | node_modules/react-native/interface.js 23 | node_modules/react-native/flow/ 24 | 25 | [options] 26 | emoji=true 27 | 28 | exact_by_default=true 29 | 30 | format.bracket_spacing=false 31 | 32 | module.file_ext=.js 33 | module.file_ext=.json 34 | module.file_ext=.ios.js 35 | 36 | munge_underscores=true 37 | 38 | module.name_mapper='^react-native/\(.*\)$' -> '/node_modules/react-native/\1' 39 | module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '/node_modules/react-native/Libraries/Image/RelativeImageStub' 40 | 41 | suppress_type=$FlowIssue 42 | suppress_type=$FlowFixMe 43 | suppress_type=$FlowFixMeProps 44 | suppress_type=$FlowFixMeState 45 | 46 | [lints] 47 | sketchy-null-number=warn 48 | sketchy-null-mixed=warn 49 | sketchy-number=warn 50 | untyped-type-import=warn 51 | nonstrict-import=warn 52 | deprecated-type=warn 53 | unsafe-getters-setters=warn 54 | unnecessary-invariant=warn 55 | signature-verification-failure=warn 56 | 57 | [strict] 58 | deprecated-type 59 | nonstrict-import 60 | sketchy-null 61 | unclear-type 62 | unsafe-getters-setters 63 | untyped-import 64 | untyped-type-import 65 | 66 | [version] 67 | ^0.176.3 68 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | custom: ['https://www.buymeacoffee.com/IronTony'] 4 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: npm 4 | directory: "/" 5 | schedule: 6 | interval: weekly 7 | timezone: Europe/Rome 8 | open-pull-requests-limit: 10 9 | reviewers: 10 | - IronTony 11 | labels: 12 | - dependencies 13 | ignore: 14 | - dependency-name: typescript 15 | versions: 16 | - 4.2.4 17 | - dependency-name: "@typescript-eslint/eslint-plugin" 18 | versions: 19 | - 4.14.0 20 | - 4.15.2 21 | - 4.19.0 22 | - dependency-name: "@types/react-native" 23 | versions: 24 | - 0.63.50 25 | - 0.64.2 26 | - dependency-name: "@typescript-eslint/parser" 27 | versions: 28 | - 4.14.0 29 | - 4.17.0 30 | - dependency-name: "@react-navigation/stack" 31 | versions: 32 | - 5.14.1 33 | - dependency-name: eslint 34 | versions: 35 | - 7.18.0 36 | - dependency-name: "@babel/runtime" 37 | versions: 38 | - 7.13.8 39 | - dependency-name: react-native-screens 40 | versions: 41 | - 2.18.0 42 | - dependency-name: "@types/node" 43 | versions: 44 | - 14.14.28 45 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # expo 6 | .expo/ 7 | 8 | # Xcode 9 | # 10 | build/ 11 | *.pbxuser 12 | !default.pbxuser 13 | *.mode1v3 14 | !default.mode1v3 15 | *.mode2v3 16 | !default.mode2v3 17 | *.perspectivev3 18 | !default.perspectivev3 19 | xcuserdata 20 | *.xccheckout 21 | *.moved-aside 22 | DerivedData 23 | *.hmap 24 | *.ipa 25 | *.xcuserstate 26 | ios/.xcode.env.local 27 | 28 | # Android/IntelliJ 29 | # 30 | build/ 31 | .idea 32 | .gradle 33 | local.properties 34 | *.iml 35 | android/app/release 36 | 37 | # Android 38 | *.hprof 39 | *.old 40 | 41 | # node.js 42 | # 43 | node_modules/ 44 | npm-debug.log 45 | yarn-error.log 46 | 47 | # BUCK 48 | buck-out/ 49 | \.buckd/ 50 | *.keystore 51 | !debug.keystore 52 | 53 | # fastlane 54 | # 55 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 56 | # screenshots whenever they are needed. 57 | # For more information about the recommended setup visit: 58 | # https://docs.fastlane.tools/best-practices/source-control/ 59 | 60 | **/fastlane/report.xml 61 | **/fastlane/Preview.html 62 | **/fastlane/screenshots 63 | **/fastlane/test_output 64 | 65 | # Bundle artifact 66 | *.jsbundle 67 | android/app/src/main/assets/index.android.bundle 68 | ios/assets/src 69 | ios/assets/app.json 70 | 71 | # Ruby / CocoaPods 72 | /ios/Pods/ 73 | /vendor/bundle/ 74 | 75 | # project 76 | .vscode/ 77 | android/.settings 78 | android/.project 79 | 80 | # Icons 81 | # These files are excluded since are generated by 'assets:icons' script 82 | #android/app/src/*/web_hi_res_512.png 83 | #android/app/src/*/res/mipmap-*/ic_launcher*.png 84 | ios/*/Images.xcassets/AppIcon.appiconset/* 85 | 86 | # Splashscreen 87 | # These files are excluded since are generated by 'assets:splashscreen' script 88 | android/app/src/*/res/drawable-*/splashscreen.png 89 | android/app/src/*/res/mipmap-*/ic_launcher_round.png 90 | android/app/src/*/res/mipmap-*/ic_launcher.png 91 | android/app/src/*/web_hi_res_512.png 92 | android/app/src/*/res/raw/ 93 | ios/*/Images.xcassets/Splashscreen.imageset/* 94 | 95 | # Environments 96 | # These files are excluded since are generated by 'set-*' scripts 97 | src/env.js 98 | 99 | deps-graph.svg 100 | .eslintcache 101 | 102 | # Temporary files created by Metro to check the health of the file watcher 103 | .metro-health-check* 104 | # testing 105 | /coverage -------------------------------------------------------------------------------- /.husky/.gitignore: -------------------------------------------------------------------------------- 1 | _ 2 | -------------------------------------------------------------------------------- /.husky/commit-msg: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | . "$(dirname -- "$0")/_/husky.sh" 3 | 4 | npx --no -- commitlint --edit ${1} 5 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | yarn run pre-commit -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | tsconfig.json -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | arrowParens: 'avoid', 3 | bracketSameLine: true, 4 | semi: true, 5 | trailingComma: 'all', 6 | singleQuote: true, 7 | printWidth: 120, 8 | bracketSpacing: true, 9 | importOrder: ['', '^[./]'], 10 | importOrderSeparation: false, 11 | }; 12 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | branches: 2 | only: 3 | - master 4 | cache: false 5 | 6 | jobs: 7 | include: 8 | - stage: Dev Build Android 🤖 9 | env: 10 | global: 11 | - ANDROID_API_LEVEL=28 12 | - ANDROID_BUILD_TOOLS_VERSION=28.0.3 13 | - ADB_INSTALL_TIMEOUT=20 # minutes (2 minutes by default) 14 | language: android 15 | jdk: oraclejdk8 16 | android: 17 | components: 18 | - tools 19 | - platform-tools 20 | - build-tools-$ANDROID_BUILD_TOOLS_VERSION 21 | - android-$ANDROID_API_LEVEL 22 | - extra 23 | - add-on 24 | - extra-google-m2repository 25 | - extra-android-m2repository 26 | before_install: 27 | - yes | sdkmanager "platforms;android-28" 28 | - nvm install 13.7.0 29 | - nvm alias default v13.7.0 30 | - gem install bundler 31 | - bundle install 32 | install: yarn 33 | script: yarn build:dev:android 34 | -------------------------------------------------------------------------------- /.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 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 | gem 'cocoapods', '~> 1.13' 7 | gem 'activesupport', '>= 6.1.7.3', '< 7.1.0' 8 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | CFPropertyList (3.0.6) 5 | rexml 6 | activesupport (7.0.8) 7 | concurrent-ruby (~> 1.0, >= 1.0.2) 8 | i18n (>= 1.6, < 2) 9 | minitest (>= 5.1) 10 | tzinfo (~> 2.0) 11 | addressable (2.8.5) 12 | public_suffix (>= 2.0.2, < 6.0) 13 | algoliasearch (1.27.5) 14 | httpclient (~> 2.8, >= 2.8.3) 15 | json (>= 1.5.1) 16 | atomos (0.1.3) 17 | claide (1.1.0) 18 | cocoapods (1.13.0) 19 | addressable (~> 2.8) 20 | claide (>= 1.0.2, < 2.0) 21 | cocoapods-core (= 1.13.0) 22 | cocoapods-deintegrate (>= 1.0.3, < 2.0) 23 | cocoapods-downloader (>= 1.6.0, < 2.0) 24 | cocoapods-plugins (>= 1.0.0, < 2.0) 25 | cocoapods-search (>= 1.0.0, < 2.0) 26 | cocoapods-trunk (>= 1.6.0, < 2.0) 27 | cocoapods-try (>= 1.1.0, < 2.0) 28 | colored2 (~> 3.1) 29 | escape (~> 0.0.4) 30 | fourflusher (>= 2.3.0, < 3.0) 31 | gh_inspector (~> 1.0) 32 | molinillo (~> 0.8.0) 33 | nap (~> 1.0) 34 | ruby-macho (>= 2.3.0, < 3.0) 35 | xcodeproj (>= 1.23.0, < 2.0) 36 | cocoapods-core (1.13.0) 37 | activesupport (>= 5.0, < 8) 38 | addressable (~> 2.8) 39 | algoliasearch (~> 1.0) 40 | concurrent-ruby (~> 1.1) 41 | fuzzy_match (~> 2.0.4) 42 | nap (~> 1.0) 43 | netrc (~> 0.11) 44 | public_suffix (~> 4.0) 45 | typhoeus (~> 1.0) 46 | cocoapods-deintegrate (1.0.5) 47 | cocoapods-downloader (1.6.3) 48 | cocoapods-plugins (1.0.0) 49 | nap 50 | cocoapods-search (1.0.1) 51 | cocoapods-trunk (1.6.0) 52 | nap (>= 0.8, < 2.0) 53 | netrc (~> 0.11) 54 | cocoapods-try (1.2.0) 55 | colored2 (3.1.2) 56 | concurrent-ruby (1.2.2) 57 | escape (0.0.4) 58 | ethon (0.16.0) 59 | ffi (>= 1.15.0) 60 | ffi (1.16.3) 61 | fourflusher (2.3.1) 62 | fuzzy_match (2.0.4) 63 | gh_inspector (1.1.3) 64 | httpclient (2.8.3) 65 | i18n (1.14.1) 66 | concurrent-ruby (~> 1.0) 67 | json (2.6.3) 68 | minitest (5.20.0) 69 | molinillo (0.8.0) 70 | nanaimo (0.3.0) 71 | nap (1.1.0) 72 | netrc (0.11.0) 73 | public_suffix (4.0.7) 74 | rexml (3.2.6) 75 | ruby-macho (2.5.1) 76 | typhoeus (1.4.0) 77 | ethon (>= 0.9.0) 78 | tzinfo (2.0.6) 79 | concurrent-ruby (~> 1.0) 80 | xcodeproj (1.23.0) 81 | CFPropertyList (>= 2.3.3, < 4.0) 82 | atomos (~> 0.1.3) 83 | claide (>= 1.0.2, < 2.0) 84 | colored2 (~> 3.1) 85 | nanaimo (~> 0.3.0) 86 | rexml (~> 3.2.4) 87 | 88 | PLATFORMS 89 | ruby 90 | 91 | DEPENDENCIES 92 | activesupport (>= 6.1.7.3, < 7.1.0) 93 | cocoapods (~> 1.13) 94 | 95 | RUBY VERSION 96 | ruby 3.0.0p0 97 | 98 | BUNDLED WITH 99 | 2.2.3 100 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Mozilla Public License Version 2.0 2 | ================================== 3 | 4 | 1. Definitions 5 | -------------- 6 | 7 | 1.1. "Contributor" 8 | means each individual or legal entity that creates, contributes to 9 | the creation of, or owns Covered Software. 10 | 11 | 1.2. "Contributor Version" 12 | means the combination of the Contributions of others (if any) used 13 | by a Contributor and that particular Contributor's Contribution. 14 | 15 | 1.3. "Contribution" 16 | means Covered Software of a particular Contributor. 17 | 18 | 1.4. "Covered Software" 19 | means Source Code Form to which the initial Contributor has attached 20 | the notice in Exhibit A, the Executable Form of such Source Code 21 | Form, and Modifications of such Source Code Form, in each case 22 | including portions thereof. 23 | 24 | 1.5. "Incompatible With Secondary Licenses" 25 | means 26 | 27 | (a) that the initial Contributor has attached the notice described 28 | in Exhibit B to the Covered Software; or 29 | 30 | (b) that the Covered Software was made available under the terms of 31 | version 1.1 or earlier of the License, but not also under the 32 | terms of a Secondary License. 33 | 34 | 1.6. "Executable Form" 35 | means any form of the work other than Source Code Form. 36 | 37 | 1.7. "Larger Work" 38 | means a work that combines Covered Software with other material, in 39 | a separate file or files, that is not Covered Software. 40 | 41 | 1.8. "License" 42 | means this document. 43 | 44 | 1.9. "Licensable" 45 | means having the right to grant, to the maximum extent possible, 46 | whether at the time of the initial grant or subsequently, any and 47 | all of the rights conveyed by this License. 48 | 49 | 1.10. "Modifications" 50 | means any of the following: 51 | 52 | (a) any file in Source Code Form that results from an addition to, 53 | deletion from, or modification of the contents of Covered 54 | Software; or 55 | 56 | (b) any new file in Source Code Form that contains any Covered 57 | Software. 58 | 59 | 1.11. "Patent Claims" of a Contributor 60 | means any patent claim(s), including without limitation, method, 61 | process, and apparatus claims, in any patent Licensable by such 62 | Contributor that would be infringed, but for the grant of the 63 | License, by the making, using, selling, offering for sale, having 64 | made, import, or transfer of either its Contributions or its 65 | Contributor Version. 66 | 67 | 1.12. "Secondary License" 68 | means either the GNU General Public License, Version 2.0, the GNU 69 | Lesser General Public License, Version 2.1, the GNU Affero General 70 | Public License, Version 3.0, or any later versions of those 71 | licenses. 72 | 73 | 1.13. "Source Code Form" 74 | means the form of the work preferred for making modifications. 75 | 76 | 1.14. "You" (or "Your") 77 | means an individual or a legal entity exercising rights under this 78 | License. For legal entities, "You" includes any entity that 79 | controls, is controlled by, or is under common control with You. For 80 | purposes of this definition, "control" means (a) the power, direct 81 | or indirect, to cause the direction or management of such entity, 82 | whether by contract or otherwise, or (b) ownership of more than 83 | fifty percent (50%) of the outstanding shares or beneficial 84 | ownership of such entity. 85 | 86 | 2. License Grants and Conditions 87 | -------------------------------- 88 | 89 | 2.1. Grants 90 | 91 | Each Contributor hereby grants You a world-wide, royalty-free, 92 | non-exclusive license: 93 | 94 | (a) under intellectual property rights (other than patent or trademark) 95 | Licensable by such Contributor to use, reproduce, make available, 96 | modify, display, perform, distribute, and otherwise exploit its 97 | Contributions, either on an unmodified basis, with Modifications, or 98 | as part of a Larger Work; and 99 | 100 | (b) under Patent Claims of such Contributor to make, use, sell, offer 101 | for sale, have made, import, and otherwise transfer either its 102 | Contributions or its Contributor Version. 103 | 104 | 2.2. Effective Date 105 | 106 | The licenses granted in Section 2.1 with respect to any Contribution 107 | become effective for each Contribution on the date the Contributor first 108 | distributes such Contribution. 109 | 110 | 2.3. Limitations on Grant Scope 111 | 112 | The licenses granted in this Section 2 are the only rights granted under 113 | this License. No additional rights or licenses will be implied from the 114 | distribution or licensing of Covered Software under this License. 115 | Notwithstanding Section 2.1(b) above, no patent license is granted by a 116 | Contributor: 117 | 118 | (a) for any code that a Contributor has removed from Covered Software; 119 | or 120 | 121 | (b) for infringements caused by: (i) Your and any other third party's 122 | modifications of Covered Software, or (ii) the combination of its 123 | Contributions with other software (except as part of its Contributor 124 | Version); or 125 | 126 | (c) under Patent Claims infringed by Covered Software in the absence of 127 | its Contributions. 128 | 129 | This License does not grant any rights in the trademarks, service marks, 130 | or logos of any Contributor (except as may be necessary to comply with 131 | the notice requirements in Section 3.4). 132 | 133 | 2.4. Subsequent Licenses 134 | 135 | No Contributor makes additional grants as a result of Your choice to 136 | distribute the Covered Software under a subsequent version of this 137 | License (see Section 10.2) or under the terms of a Secondary License (if 138 | permitted under the terms of Section 3.3). 139 | 140 | 2.5. Representation 141 | 142 | Each Contributor represents that the Contributor believes its 143 | Contributions are its original creation(s) or it has sufficient rights 144 | to grant the rights to its Contributions conveyed by this License. 145 | 146 | 2.6. Fair Use 147 | 148 | This License is not intended to limit any rights You have under 149 | applicable copyright doctrines of fair use, fair dealing, or other 150 | equivalents. 151 | 152 | 2.7. Conditions 153 | 154 | Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted 155 | in Section 2.1. 156 | 157 | 3. Responsibilities 158 | ------------------- 159 | 160 | 3.1. Distribution of Source Form 161 | 162 | All distribution of Covered Software in Source Code Form, including any 163 | Modifications that You create or to which You contribute, must be under 164 | the terms of this License. You must inform recipients that the Source 165 | Code Form of the Covered Software is governed by the terms of this 166 | License, and how they can obtain a copy of this License. You may not 167 | attempt to alter or restrict the recipients' rights in the Source Code 168 | Form. 169 | 170 | 3.2. Distribution of Executable Form 171 | 172 | If You distribute Covered Software in Executable Form then: 173 | 174 | (a) such Covered Software must also be made available in Source Code 175 | Form, as described in Section 3.1, and You must inform recipients of 176 | the Executable Form how they can obtain a copy of such Source Code 177 | Form by reasonable means in a timely manner, at a charge no more 178 | than the cost of distribution to the recipient; and 179 | 180 | (b) You may distribute such Executable Form under the terms of this 181 | License, or sublicense it under different terms, provided that the 182 | license for the Executable Form does not attempt to limit or alter 183 | the recipients' rights in the Source Code Form under this License. 184 | 185 | 3.3. Distribution of a Larger Work 186 | 187 | You may create and distribute a Larger Work under terms of Your choice, 188 | provided that You also comply with the requirements of this License for 189 | the Covered Software. If the Larger Work is a combination of Covered 190 | Software with a work governed by one or more Secondary Licenses, and the 191 | Covered Software is not Incompatible With Secondary Licenses, this 192 | License permits You to additionally distribute such Covered Software 193 | under the terms of such Secondary License(s), so that the recipient of 194 | the Larger Work may, at their option, further distribute the Covered 195 | Software under the terms of either this License or such Secondary 196 | License(s). 197 | 198 | 3.4. Notices 199 | 200 | You may not remove or alter the substance of any license notices 201 | (including copyright notices, patent notices, disclaimers of warranty, 202 | or limitations of liability) contained within the Source Code Form of 203 | the Covered Software, except that You may alter any license notices to 204 | the extent required to remedy known factual inaccuracies. 205 | 206 | 3.5. Application of Additional Terms 207 | 208 | You may choose to offer, and to charge a fee for, warranty, support, 209 | indemnity or liability obligations to one or more recipients of Covered 210 | Software. However, You may do so only on Your own behalf, and not on 211 | behalf of any Contributor. You must make it absolutely clear that any 212 | such warranty, support, indemnity, or liability obligation is offered by 213 | You alone, and You hereby agree to indemnify every Contributor for any 214 | liability incurred by such Contributor as a result of warranty, support, 215 | indemnity or liability terms You offer. You may include additional 216 | disclaimers of warranty and limitations of liability specific to any 217 | jurisdiction. 218 | 219 | 4. Inability to Comply Due to Statute or Regulation 220 | --------------------------------------------------- 221 | 222 | If it is impossible for You to comply with any of the terms of this 223 | License with respect to some or all of the Covered Software due to 224 | statute, judicial order, or regulation then You must: (a) comply with 225 | the terms of this License to the maximum extent possible; and (b) 226 | describe the limitations and the code they affect. Such description must 227 | be placed in a text file included with all distributions of the Covered 228 | Software under this License. Except to the extent prohibited by statute 229 | or regulation, such description must be sufficiently detailed for a 230 | recipient of ordinary skill to be able to understand it. 231 | 232 | 5. Termination 233 | -------------- 234 | 235 | 5.1. The rights granted under this License will terminate automatically 236 | if You fail to comply with any of its terms. However, if You become 237 | compliant, then the rights granted under this License from a particular 238 | Contributor are reinstated (a) provisionally, unless and until such 239 | Contributor explicitly and finally terminates Your grants, and (b) on an 240 | ongoing basis, if such Contributor fails to notify You of the 241 | non-compliance by some reasonable means prior to 60 days after You have 242 | come back into compliance. Moreover, Your grants from a particular 243 | Contributor are reinstated on an ongoing basis if such Contributor 244 | notifies You of the non-compliance by some reasonable means, this is the 245 | first time You have received notice of non-compliance with this License 246 | from such Contributor, and You become compliant prior to 30 days after 247 | Your receipt of the notice. 248 | 249 | 5.2. If You initiate litigation against any entity by asserting a patent 250 | infringement claim (excluding declaratory judgment actions, 251 | counter-claims, and cross-claims) alleging that a Contributor Version 252 | directly or indirectly infringes any patent, then the rights granted to 253 | You by any and all Contributors for the Covered Software under Section 254 | 2.1 of this License shall terminate. 255 | 256 | 5.3. In the event of termination under Sections 5.1 or 5.2 above, all 257 | end user license agreements (excluding distributors and resellers) which 258 | have been validly granted by You or Your distributors under this License 259 | prior to termination shall survive termination. 260 | 261 | ************************************************************************ 262 | * * 263 | * 6. Disclaimer of Warranty * 264 | * ------------------------- * 265 | * * 266 | * Covered Software is provided under this License on an "as is" * 267 | * basis, without warranty of any kind, either expressed, implied, or * 268 | * statutory, including, without limitation, warranties that the * 269 | * Covered Software is free of defects, merchantable, fit for a * 270 | * particular purpose or non-infringing. The entire risk as to the * 271 | * quality and performance of the Covered Software is with You. * 272 | * Should any Covered Software prove defective in any respect, You * 273 | * (not any Contributor) assume the cost of any necessary servicing, * 274 | * repair, or correction. This disclaimer of warranty constitutes an * 275 | * essential part of this License. No use of any Covered Software is * 276 | * authorized under this License except under this disclaimer. * 277 | * * 278 | ************************************************************************ 279 | 280 | ************************************************************************ 281 | * * 282 | * 7. Limitation of Liability * 283 | * -------------------------- * 284 | * * 285 | * Under no circumstances and under no legal theory, whether tort * 286 | * (including negligence), contract, or otherwise, shall any * 287 | * Contributor, or anyone who distributes Covered Software as * 288 | * permitted above, be liable to You for any direct, indirect, * 289 | * special, incidental, or consequential damages of any character * 290 | * including, without limitation, damages for lost profits, loss of * 291 | * goodwill, work stoppage, computer failure or malfunction, or any * 292 | * and all other commercial damages or losses, even if such party * 293 | * shall have been informed of the possibility of such damages. This * 294 | * limitation of liability shall not apply to liability for death or * 295 | * personal injury resulting from such party's negligence to the * 296 | * extent applicable law prohibits such limitation. Some * 297 | * jurisdictions do not allow the exclusion or limitation of * 298 | * incidental or consequential damages, so this exclusion and * 299 | * limitation may not apply to You. * 300 | * * 301 | ************************************************************************ 302 | 303 | 8. Litigation 304 | ------------- 305 | 306 | Any litigation relating to this License may be brought only in the 307 | courts of a jurisdiction where the defendant maintains its principal 308 | place of business and such litigation shall be governed by laws of that 309 | jurisdiction, without reference to its conflict-of-law provisions. 310 | Nothing in this Section shall prevent a party's ability to bring 311 | cross-claims or counter-claims. 312 | 313 | 9. Miscellaneous 314 | ---------------- 315 | 316 | This License represents the complete agreement concerning the subject 317 | matter hereof. If any provision of this License is held to be 318 | unenforceable, such provision shall be reformed only to the extent 319 | necessary to make it enforceable. Any law or regulation which provides 320 | that the language of a contract shall be construed against the drafter 321 | shall not be used to construe this License against a Contributor. 322 | 323 | 10. Versions of the License 324 | --------------------------- 325 | 326 | 10.1. New Versions 327 | 328 | Mozilla Foundation is the license steward. Except as provided in Section 329 | 10.3, no one other than the license steward has the right to modify or 330 | publish new versions of this License. Each version will be given a 331 | distinguishing version number. 332 | 333 | 10.2. Effect of New Versions 334 | 335 | You may distribute the Covered Software under the terms of the version 336 | of the License under which You originally received the Covered Software, 337 | or under the terms of any subsequent version published by the license 338 | steward. 339 | 340 | 10.3. Modified Versions 341 | 342 | If you create software not governed by this License, and you want to 343 | create a new license for such software, you may create and use a 344 | modified version of this License if you rename the license and remove 345 | any references to the name of the license steward (except to note that 346 | such modified license differs from this License). 347 | 348 | 10.4. Distributing Source Code Form that is Incompatible With Secondary 349 | Licenses 350 | 351 | If You choose to distribute Source Code Form that is Incompatible With 352 | Secondary Licenses under the terms of this version of the License, the 353 | notice described in Exhibit B of this License must be attached. 354 | 355 | Exhibit A - Source Code Form License Notice 356 | ------------------------------------------- 357 | 358 | This Source Code Form is subject to the terms of the Mozilla Public 359 | License, v. 2.0. If a copy of the MPL was not distributed with this 360 | file, You can obtain one at http://mozilla.org/MPL/2.0/. 361 | 362 | If it is not possible or desirable to put the notice in a particular 363 | file, then You may include the notice in a location (such as a LICENSE 364 | file in a relevant directory) where a recipient would be likely to look 365 | for such a notice. 366 | 367 | You may add additional accurate notices of copyright ownership. 368 | 369 | Exhibit B - "Incompatible With Secondary Licenses" Notice 370 | --------------------------------------------------------- 371 | 372 | This Source Code Form is "Incompatible With Secondary Licenses", as 373 | defined by the Mozilla Public License, v. 2.0. 374 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # React Native Redux Toolkit Start App 2 | 3 | > A React Native boilerplate app to bootstrap your next app with Redux Toolkit and Saga! 4 | 5 | ## 🔥🔥🔥 Upgraded to the latest React-Native (> 0.72.x) with brand New Architecture (Fabric) 🔥🔥🔥 6 | 7 |
8 |
9 | 10 |
11 | 12 | ## 🔥🔥 Checkout also my brand new React Native React-Query (no redux toolkit) [here](https://github.com/IronTony/react-native-react-query-starter-app) 🔥🔥 13 | 14 | [![License](https://img.shields.io/github/license/IronTony/react-native-redux-toolkit-starter-app)](LICENSE) 15 | [![All Contributors](https://img.shields.io/badge/all_contributors-2-screen.svg?style=flat)](#contributors-:sparkles:) 16 | 17 | 18 | 19 | [![Issues](https://img.shields.io/github/issues/IronTony/react-native-redux-toolkit-starter-app.svg)](https://github.com/IronTony/react-native-redux-toolkit-starter-app/issues) 20 | 21 | [![Build](https://travis-ci.com/IronTony/react-native-redux-toolkit-starter-app.svg?branch=master)](https://travis-ci.com/IronTony/react-native-redux-toolkit-starter-app) 22 | 23 | [![Build](https://img.shields.io/badge/iOS%20Tested-success-brightgreen.svg)](https://github.com/IronTony/react-native-redux-toolkit-starter-app) 24 | [![Build](https://img.shields.io/badge/Android%20Tested-success-brightgreen.svg)](https://github.com/IronTony/react-native-redux-toolkit-starter-app) 25 | 26 | Buy Me A Coffee 27 | 28 | # Table of Contents 29 | 30 | - [🔥🔥🔥 Upgraded to the latest React-Native (\> 0.72.x) with brand New Architecture (Fabric) 🔥🔥🔥](#-upgraded-to-the-latest-react-native--072x-with-brand-new-architecture-fabric-) 31 | - [🔥🔥 Checkout also my brand new React Native React-Query (no redux toolkit) here 🔥🔥](#-checkout-also-my-brand-new-react-native-react-query-no-redux-toolkit-here-) 32 | - [Installation :inbox\_tray:](#installation-inbox_tray) 33 | - [Rename project and bundles :memo: :package:](#rename-project-and-bundles-memo-package) 34 | - [iOS \& Android](#ios--android) 35 | - [Environment Setup :globe\_with\_meridians:](#environment-setup-globe_with_meridians) 36 | - [Scripts :wrench:](#scripts-wrench) 37 | - [Run the app](#run-the-app) 38 | - [Generate app icons](#generate-app-icons) 39 | - [Generate Splashscreen](#generate-splashscreen) 40 | - [To enabled React-Native (Fabric) new architecture](#to-enabled-react-native-fabric-new-architecture) 41 | - [Setup iOS](#setup-ios) 42 | - [Typescript (optional)](#typescript-optional) 43 | - [ATTENTION Circular dependencies script checker](#attention-circular-dependencies-script-checker) 44 | - [Roadmap :running:](#roadmap-running) 45 | - [Screenshots](#screenshots) 46 | - [Contributors :sparkles:](#contributors-sparkles) 47 | - [License :scroll:](#license-scroll) 48 | 49 | --- 50 | 51 | ## Installation :inbox_tray: 52 | 53 | ```bash 54 | # Setup your project 55 | > npx degit IronTony/react-native-redux-toolkit-starter-app your-new-app 56 | 57 | > cd your-new-app 58 | 59 | # Install dependencies 60 | > yarn 61 | 62 | # if needed, setup iOS development environment 63 | yarn setup:ios 64 | ``` 65 | 66 | See [`environment`](#environment-setup-:globe_with_meridians:) section for how to configure env variables. 67 | 68 | See [`scripts`](#scripts-:wrench:) section for how to run the app. 69 | 70 | --- 71 | 72 | ## Rename project and bundles :memo: :package: 73 | 74 | To rename the project and bundles, just follow these steps: 75 | 76 | ### iOS & Android 77 | 78 | Run `npx react-native-rename [name] -b [bundle-identifier]` from the project root 79 | 80 | Example: 81 | `npx react-native-rename "Test New App" -b com.testnewapp` 82 | 83 | --- 84 | 85 | ## Environment Setup :globe_with_meridians: 86 | 87 | `React Native Starter App` environments variables management is based on a custom script and the `app.json` config file. 88 | 89 | Define your environment variables inside `app.json` inside the `environments` object under the desired 90 | environment key (such as `development`, `staging` or `production`) and then run the app for the required env 91 | using one of the available run scripts (e.g. `ios:dev`). 92 | 93 | If you want to use IDEs such Xcode or Android Studio, you have to set up the ENV variables with these commands: 94 | 95 | - `yarn env:dev`, to set the development ENV variables 96 | - `yarn env:stage`, to set the staging ENV variables 97 | - `yarn env:prod`, to set the production ENV variables 98 | 99 | If you want to use this in any file, just: 100 | 101 | `import env from '@env';` 102 | 103 | and use like this: 104 | 105 | `env.API_URL` 106 | 107 | --- 108 | 109 | ## Scripts :wrench: 110 | 111 | ### Run the app 112 | 113 | To run the app use one of the following scripts: 114 | 115 | - `yarn android:dev`, to start the app on Android with the `development` environment variables. 116 | - `yarn android:stage`, to start the app on Android with the `staging` environment variables. 117 | - `yarn android:prod`, to start the app on Android with the `production` environment variables. 118 | 119 | - `yarn ios:dev`, to start the app on iOS with the `development` environment variables. 120 | - `yarn ios:stage`, to start the app on iOS with the `staging` environment variables. 121 | - `yarn ios:prod`, to start the app on iOS with the `production` environment variables. 122 | 123 | If using the `ios` commands you will receive an error like this: 124 | 125 | 126 | 127 | Just do the following steps: 128 | 129 | - Launch Xcode 130 | - Settings 131 | - Locations 132 | 133 | Make sure there's a dropdown option selected for the command line tools 134 | NOTE: Even if you're seeing Command Line Tools dropdown being selected with proper version, you might want to re-select it again. It will ask for login password. 135 | 136 | 137 | 138 | _REMEMBER: The Command Line Tools should be the latest one or the one matching your Xcode version_ 139 | 140 | 141 | ### Generate app icons 142 | 143 | To setup the app icons: 144 | 145 | - create an image at least `1024x1024px` 146 | - place it under `/assets` folder as `icon.png` 147 | - run 148 | 149 | ```sh 150 | yarn assets:icons 151 | ``` 152 | 153 | ### Generate Splashscreen 154 | 155 | To setup the iOS app splashscreen: 156 | 157 | - create an image at least `1242x2208px` 158 | - place it under `/assets` folder as `ios_splashscreen.png` 159 | - run 160 | 161 | ```sh 162 | yarn assets:splashscreen:ios 163 | ``` 164 | 165 | To setup the Android app splashscreen: 166 | 167 | - create an image at least `150x134px` 168 | - place it under `/assets` folder as `android_splashscreen.png` 169 | - run 170 | 171 | ```sh 172 | yarn assets:splashscreen:android 173 | ``` 174 | 175 | If you want to customize the output icon, open the `package.json` file and customized the backgtound color, size, ..... in the following command `assets:splashscreen:android` 176 | 177 | 178 | ### To enabled React-Native (Fabric) new architecture 179 | 180 | Check the official documentation [here](https://reactnative.dev/docs/new-architecture-intro) 181 | 182 | ### Setup iOS 183 | 184 | To setup the environment to run on iOS, run 185 | 186 | ```sh 187 | yarn setup:ios 188 | ``` 189 | 190 | this will run `cocoapods` to install all the required dependencies. 191 | 192 | ### Typescript (optional) 193 | 194 | The use of Typescript in the project is not mandatory. 195 | You can just write all your code using plain Javascript. 196 | Our hint is to create all files as below: 197 | 198 | - files with logic and Views with `tsx` extension 199 | - files with Stylesheet and others with `ts` extension 200 | 201 | To enable full Typescript checks, just open the `tsconfig.json` file and chage as below:
202 | 203 | ``` 204 | "noImplicitAny": true, // set to true to be explicit and declare all types now
205 | "strict": true, // enable it to use fully Typescript set of invasive rules
206 | ``` 207 | 208 | _REMEMBER: the entry point file in the root of the project MUST be index.js_ 209 | 210 | --- 211 | 212 | ### ATTENTION Circular dependencies script checker 213 | 214 | If running this script `dependencies:graph`, you get this error: 215 | `Error: Graphviz could not be found. Ensure that "gvpr" is in your $PATH` 216 | 217 | If you are on a Mac: `brew install graphviz` 218 | On Windows, after installation, do this: 219 | 220 | ## Roadmap :running: 221 | 222 | ✅ Initial Setup
223 | ✅ `react-native-bootsplash` (https://github.com/zoontek/react-native-bootsplash)
224 | ✅ `react-native-toolbox` to generate Splashscreen and icons automagically (https://github.com/Forward-Software/react-native-toolbox)
225 | ✅ Standard tree folders structure
226 | ✅ `React-Native 0.72.6`
227 | ✅ `redux-toolkit`
228 | ✅ `redux-persist` (https://github.com/rt2zz/redux-persist)
229 | ✅ `React Native Debugger`
230 | ✅ `redux-saga`
231 | ✅ `i18next`
232 | ✅ `react-navigation v6` ❤️
233 | ✅ `Tamagui` as design system
234 | ✅ `Env` variables selection experimental way ⚗️⚗️⚗️
235 | ✅ Typescript (optional use. Read the DOC above)
236 | 237 | 238 | --- 239 | 240 | ## Screenshots 241 | 242 |
243 | 244 |
245 | 246 |
247 | 248 |
249 | 250 |
251 | 252 |
253 | 254 | --- 255 | 256 | ## Contributors :sparkles: 257 | 258 | Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 |

IronTony

🤔 💻 📖 🐛 🚧 📦 💬 👀 ⚠️ 💡
268 | 269 | 270 | 271 | 272 | 273 | 274 | This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! 275 | 276 | --- 277 | 278 | ## License :scroll: 279 | 280 | Licensed under [Mozilla Public License Version 2.0](LICENSE) 281 | -------------------------------------------------------------------------------- /__tests__/App.test.tsx: -------------------------------------------------------------------------------- 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 shiped 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(); 17 | }); 18 | -------------------------------------------------------------------------------- /android/app/BUCK: -------------------------------------------------------------------------------- 1 | # To learn about Buck see [Docs](https://buckbuild.com/). 2 | # To run your application with Buck: 3 | # - install Buck 4 | # - `npm start` - to start the packager 5 | # - `cd android` 6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 8 | # - `buck install -r android/app` - compile, install and run application 9 | # 10 | 11 | load(":build_defs.bzl", "create_aar_targets", "create_jar_targets") 12 | 13 | lib_deps = [] 14 | 15 | create_aar_targets(glob(["libs/*.aar"])) 16 | 17 | create_jar_targets(glob(["libs/*.jar"])) 18 | 19 | android_library( 20 | name = "all-libs", 21 | exported_deps = lib_deps, 22 | ) 23 | 24 | android_library( 25 | name = "app-code", 26 | srcs = glob([ 27 | "src/main/java/**/*.java", 28 | ]), 29 | deps = [ 30 | ":all-libs", 31 | ":build_config", 32 | ":res", 33 | ], 34 | ) 35 | 36 | android_build_config( 37 | name = "build_config", 38 | package = "com.reactnativestarterapp", 39 | ) 40 | 41 | android_resource( 42 | name = "res", 43 | package = "com.reactnativestarterapp", 44 | res = "src/main/res", 45 | ) 46 | 47 | android_binary( 48 | name = "app", 49 | keystore = "//android/keystores:debug", 50 | manifest = "src/main/AndroidManifest.xml", 51 | package_type = "debug", 52 | deps = [ 53 | ":app-code", 54 | ], 55 | ) 56 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | apply plugin: "com.facebook.react" 3 | 4 | import com.android.build.OutputFile 5 | 6 | /** 7 | * This is the configuration block to customize your React Native Android app. 8 | * By default you don't need to apply any configuration, just uncomment the lines you need. 9 | */ 10 | react { 11 | /* Folders */ 12 | // The root of your project, i.e. where "package.json" lives. Default is '..' 13 | // root = file("../") 14 | // The folder where the react-native NPM package is. Default is ../node_modules/react-native 15 | // reactNativeDir = file("../node_modules/react-native") 16 | // The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen 17 | // codegenDir = file("../node_modules/@react-native/codegen") 18 | // The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js 19 | // cliFile = file("../node_modules/react-native/cli.js") 20 | 21 | /* Variants */ 22 | // The list of variants to that are debuggable. For those we're going to 23 | // skip the bundling of the JS bundle and the assets. By default is just 'debug'. 24 | // If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants. 25 | // debuggableVariants = ["liteDebug", "prodDebug"] 26 | 27 | /* Bundling */ 28 | // A list containing the node command and its flags. Default is just 'node'. 29 | // nodeExecutableAndArgs = ["node"] 30 | // 31 | // The command to run when bundling. By default is 'bundle' 32 | // bundleCommand = "ram-bundle" 33 | // 34 | // The path to the CLI configuration file. Default is empty. 35 | // bundleConfig = file(../rn-cli.config.js) 36 | // 37 | // The name of the generated asset file containing your JS bundle 38 | // bundleAssetName = "MyApplication.android.bundle" 39 | // 40 | // The entry file for bundle generation. Default is 'index.android.js' or 'index.js' 41 | // entryFile = file("../js/MyApplication.android.js") 42 | // 43 | // A list of extra flags to pass to the 'bundle' commands. 44 | // See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle 45 | // extraPackagerArgs = [] 46 | 47 | /* Hermes Commands */ 48 | // The hermes compiler command to run. By default it is 'hermesc' 49 | // hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc" 50 | // 51 | // The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map" 52 | // hermesFlags = ["-O", "-output-source-map"] 53 | } 54 | 55 | /** 56 | * Set this to true to Run Proguard on Release builds to minify the Java bytecode. 57 | */ 58 | def enableProguardInReleaseBuilds = false 59 | 60 | /** 61 | * The preferred build flavor of JavaScriptCore (JSC) 62 | * 63 | * For example, to use the international variant, you can use: 64 | * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` 65 | * 66 | * The international variant includes ICU i18n library and necessary data 67 | * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that 68 | * give correct results when using with locales other than en-US. Note that 69 | * this variant is about 6MiB larger per architecture than default. 70 | */ 71 | def jscFlavor = 'org.webkit:android-jsc:+' 72 | 73 | android { 74 | ndkVersion rootProject.ext.ndkVersion 75 | 76 | compileSdkVersion rootProject.ext.compileSdkVersion 77 | 78 | namespace "com.reactnativestarterapp" 79 | defaultConfig { 80 | applicationId "com.reactnativestarterapp" 81 | minSdkVersion rootProject.ext.minSdkVersion 82 | targetSdkVersion rootProject.ext.targetSdkVersion 83 | versionCode 1 84 | versionName "1.0" 85 | } 86 | signingConfigs { 87 | debug { 88 | storeFile file('debug.keystore') 89 | storePassword 'android' 90 | keyAlias 'androiddebugkey' 91 | keyPassword 'android' 92 | } 93 | } 94 | buildTypes { 95 | debug { 96 | signingConfig signingConfigs.debug 97 | } 98 | release { 99 | // Caution! In production, you need to generate your own keystore file. 100 | // see https://reactnative.dev/docs/signed-apk-android. 101 | signingConfig signingConfigs.debug 102 | minifyEnabled enableProguardInReleaseBuilds 103 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 104 | } 105 | } 106 | } 107 | 108 | dependencies { 109 | // The version of react-native is set by the React Native Gradle Plugin 110 | implementation("com.facebook.react:react-android") 111 | 112 | // Splashscreen 113 | implementation("androidx.core:core-splashscreen:1.0.0") 114 | // / Splashscreen 115 | 116 | implementation project(':react-native-vector-icons') 117 | 118 | debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") 119 | debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") { 120 | exclude group:'com.squareup.okhttp3', module:'okhttp' 121 | } 122 | 123 | debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") 124 | if (hermesEnabled.toBoolean()) { 125 | implementation("com.facebook.react:hermes-android") 126 | } else { 127 | implementation jscFlavor 128 | } 129 | } 130 | 131 | apply from: file("../../node_modules/react-native-vector-icons/fonts.gradle") 132 | apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) 133 | -------------------------------------------------------------------------------- /android/app/build_defs.bzl: -------------------------------------------------------------------------------- 1 | """Helper definitions to glob .aar and .jar targets""" 2 | 3 | def create_aar_targets(aarfiles): 4 | for aarfile in aarfiles: 5 | name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")] 6 | lib_deps.append(":" + name) 7 | android_prebuilt_aar( 8 | name = name, 9 | aar = aarfile, 10 | ) 11 | 12 | def create_jar_targets(jarfiles): 13 | for jarfile in jarfiles: 14 | name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")] 15 | lib_deps.append(":" + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | -------------------------------------------------------------------------------- /android/app/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IronTony/react-native-redux-toolkit-starter-app/4b8d8e87fd76fa1aa2d5f61ba0621513b90336b3/android/app/debug.keystore -------------------------------------------------------------------------------- /android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /android/app/src/debug/java/com/reactnativestarterapp/ReactNativeFlipper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | *

This source code is licensed under the MIT license found in the LICENSE file in the root 5 | * directory of this source tree. 6 | */ 7 | package com.reactnativestarterapp; 8 | 9 | import android.content.Context; 10 | import com.facebook.flipper.android.AndroidFlipperClient; 11 | import com.facebook.flipper.android.utils.FlipperUtils; 12 | import com.facebook.flipper.core.FlipperClient; 13 | import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin; 14 | import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin; 15 | import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin; 16 | import com.facebook.flipper.plugins.inspector.DescriptorMapping; 17 | import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin; 18 | import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor; 19 | import com.facebook.flipper.plugins.network.NetworkFlipperPlugin; 20 | import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin; 21 | import com.facebook.react.ReactInstanceEventListener; 22 | import com.facebook.react.ReactInstanceManager; 23 | import com.facebook.react.bridge.ReactContext; 24 | import com.facebook.react.modules.network.NetworkingModule; 25 | import okhttp3.OkHttpClient; 26 | 27 | /** 28 | * Class responsible of loading Flipper inside your React Native application. This is the debug 29 | * flavor of it. Here you can add your own plugins and customize the Flipper setup. 30 | */ 31 | public class ReactNativeFlipper { 32 | public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) { 33 | if (FlipperUtils.shouldEnableFlipper(context)) { 34 | final FlipperClient client = AndroidFlipperClient.getInstance(context); 35 | 36 | client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults())); 37 | client.addPlugin(new DatabasesFlipperPlugin(context)); 38 | client.addPlugin(new SharedPreferencesFlipperPlugin(context)); 39 | client.addPlugin(CrashReporterPlugin.getInstance()); 40 | 41 | NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin(); 42 | NetworkingModule.setCustomClientBuilder( 43 | new NetworkingModule.CustomClientBuilder() { 44 | @Override 45 | public void apply(OkHttpClient.Builder builder) { 46 | builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin)); 47 | } 48 | }); 49 | client.addPlugin(networkFlipperPlugin); 50 | client.start(); 51 | 52 | // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized 53 | // Hence we run if after all native modules have been initialized 54 | ReactContext reactContext = reactInstanceManager.getCurrentReactContext(); 55 | if (reactContext == null) { 56 | reactInstanceManager.addReactInstanceEventListener( 57 | new ReactInstanceEventListener() { 58 | @Override 59 | public void onReactContextInitialized(ReactContext reactContext) { 60 | reactInstanceManager.removeReactInstanceEventListener(this); 61 | reactContext.runOnNativeModulesQueueThread( 62 | new Runnable() { 63 | @Override 64 | public void run() { 65 | client.addPlugin(new FrescoFlipperPlugin()); 66 | } 67 | }); 68 | } 69 | }); 70 | } else { 71 | client.addPlugin(new FrescoFlipperPlugin()); 72 | } 73 | } 74 | } 75 | } -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 12 | 13 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Lato-Black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IronTony/react-native-redux-toolkit-starter-app/4b8d8e87fd76fa1aa2d5f61ba0621513b90336b3/android/app/src/main/assets/fonts/Lato-Black.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Lato-BlackItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IronTony/react-native-redux-toolkit-starter-app/4b8d8e87fd76fa1aa2d5f61ba0621513b90336b3/android/app/src/main/assets/fonts/Lato-BlackItalic.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Lato-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IronTony/react-native-redux-toolkit-starter-app/4b8d8e87fd76fa1aa2d5f61ba0621513b90336b3/android/app/src/main/assets/fonts/Lato-Bold.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Lato-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IronTony/react-native-redux-toolkit-starter-app/4b8d8e87fd76fa1aa2d5f61ba0621513b90336b3/android/app/src/main/assets/fonts/Lato-BoldItalic.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Lato-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IronTony/react-native-redux-toolkit-starter-app/4b8d8e87fd76fa1aa2d5f61ba0621513b90336b3/android/app/src/main/assets/fonts/Lato-Italic.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Lato-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IronTony/react-native-redux-toolkit-starter-app/4b8d8e87fd76fa1aa2d5f61ba0621513b90336b3/android/app/src/main/assets/fonts/Lato-Light.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Lato-LightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IronTony/react-native-redux-toolkit-starter-app/4b8d8e87fd76fa1aa2d5f61ba0621513b90336b3/android/app/src/main/assets/fonts/Lato-LightItalic.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Lato-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IronTony/react-native-redux-toolkit-starter-app/4b8d8e87fd76fa1aa2d5f61ba0621513b90336b3/android/app/src/main/assets/fonts/Lato-Regular.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Lato-Thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IronTony/react-native-redux-toolkit-starter-app/4b8d8e87fd76fa1aa2d5f61ba0621513b90336b3/android/app/src/main/assets/fonts/Lato-Thin.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Lato-ThinItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IronTony/react-native-redux-toolkit-starter-app/4b8d8e87fd76fa1aa2d5f61ba0621513b90336b3/android/app/src/main/assets/fonts/Lato-ThinItalic.ttf -------------------------------------------------------------------------------- /android/app/src/main/java/com/reactnativestarterapp/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.reactnativestarterapp; 2 | 3 | import com.facebook.react.ReactActivity; 4 | import com.facebook.react.ReactActivityDelegate; 5 | import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint; 6 | import com.facebook.react.defaults.DefaultReactActivityDelegate; 7 | import com.zoontek.rnbootsplash.RNBootSplash; 8 | // React-Navigation v6 code integration 9 | import android.os.Bundle; 10 | // /React-Navigation v6 code integration 11 | 12 | public class MainActivity extends ReactActivity { 13 | 14 | /** 15 | * Returns the name of the main component registered from JavaScript. This is used to schedule 16 | * rendering of the component. 17 | */ 18 | @Override 19 | protected String getMainComponentName() { 20 | return "ReactNativeStarterApp"; 21 | } 22 | 23 | /** 24 | * Returns the instance of the {@link ReactActivityDelegate}. Here we use a util class {@link 25 | * DefaultReactActivityDelegate} which allows you to easily enable Fabric and Concurrent React 26 | * (aka React 18) with two boolean flags. 27 | */ 28 | @Override 29 | protected ReactActivityDelegate createReactActivityDelegate() { 30 | return new DefaultReactActivityDelegate( 31 | this, 32 | getMainComponentName(), 33 | // If you opted-in for the New Architecture, we enable the Fabric Renderer. 34 | DefaultNewArchitectureEntryPoint.getFabricEnabled()); 35 | } 36 | 37 | // React-Navigation v6 code integration 38 | @Override 39 | protected void onCreate(Bundle savedInstanceState) { 40 | RNBootSplash.init(this); 41 | super.onCreate(null); 42 | } 43 | // /React-Navigation v6 code integration 44 | } 45 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/reactnativestarterapp/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.reactnativestarterapp; 2 | 3 | import android.app.Application; 4 | import com.facebook.react.PackageList; 5 | import com.facebook.react.ReactApplication; 6 | import com.facebook.react.ReactNativeHost; 7 | import com.facebook.react.ReactPackage; 8 | import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint; 9 | import com.facebook.react.defaults.DefaultReactNativeHost; 10 | import com.facebook.soloader.SoLoader; 11 | import java.util.List; 12 | 13 | public class MainApplication extends Application implements ReactApplication { 14 | 15 | private final ReactNativeHost mReactNativeHost = 16 | new DefaultReactNativeHost(this) { 17 | @Override 18 | public boolean getUseDeveloperSupport() { 19 | return BuildConfig.DEBUG; 20 | } 21 | 22 | @Override 23 | protected List getPackages() { 24 | @SuppressWarnings("UnnecessaryLocalVariable") 25 | List packages = new PackageList(this).getPackages(); 26 | // Packages that cannot be autolinked yet can be added manually here, for example: 27 | // packages.add(new MyReactNativePackage()); 28 | return packages; 29 | } 30 | 31 | @Override 32 | protected String getJSMainModuleName() { 33 | return "index"; 34 | } 35 | 36 | @Override 37 | protected boolean isNewArchEnabled() { 38 | return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED; 39 | } 40 | 41 | @Override 42 | protected Boolean isHermesEnabled() { 43 | return BuildConfig.IS_HERMES_ENABLED; 44 | } 45 | }; 46 | 47 | @Override 48 | public ReactNativeHost getReactNativeHost() { 49 | return mReactNativeHost; 50 | } 51 | 52 | @Override 53 | public void onCreate() { 54 | super.onCreate(); 55 | SoLoader.init(this, /* native exopackage */ false); 56 | if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { 57 | // If you opted-in for the New Architecture, we load the native entry point for this app. 58 | DefaultNewArchitectureEntryPoint.load(); 59 | } 60 | ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/rn_edit_text_material.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 18 | 19 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/bootsplash_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IronTony/react-native-redux-toolkit-starter-app/4b8d8e87fd76fa1aa2d5f61ba0621513b90336b3/android/app/src/main/res/mipmap-hdpi/bootsplash_logo.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/bootsplash_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IronTony/react-native-redux-toolkit-starter-app/4b8d8e87fd76fa1aa2d5f61ba0621513b90336b3/android/app/src/main/res/mipmap-mdpi/bootsplash_logo.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/bootsplash_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IronTony/react-native-redux-toolkit-starter-app/4b8d8e87fd76fa1aa2d5f61ba0621513b90336b3/android/app/src/main/res/mipmap-xhdpi/bootsplash_logo.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/bootsplash_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IronTony/react-native-redux-toolkit-starter-app/4b8d8e87fd76fa1aa2d5f61ba0621513b90336b3/android/app/src/main/res/mipmap-xxhdpi/bootsplash_logo.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/bootsplash_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IronTony/react-native-redux-toolkit-starter-app/4b8d8e87fd76fa1aa2d5f61ba0621513b90336b3/android/app/src/main/res/mipmap-xxxhdpi/bootsplash_logo.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #000000 4 | #FFFFFF 5 | #FFFFFF 6 | 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | ReactNativeStarterApp 3 | 4 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /android/app/src/release/java/com/reactnativestarterapp/ReactNativeFlipper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | *

This source code is licensed under the MIT license found in the LICENSE file in the root 5 | * directory of this source tree. 6 | */ 7 | package com.reactnativestarterapp; 8 | 9 | import android.content.Context; 10 | import com.facebook.react.ReactInstanceManager; 11 | 12 | /** 13 | * Class responsible of loading Flipper inside your React Native application. This is the release 14 | * flavor of it so it's empty as we don't want to load Flipper. 15 | */ 16 | public class ReactNativeFlipper { 17 | public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) { 18 | // Do nothing as we don't want to initialize Flipper on Release. 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | ext { 5 | buildToolsVersion = "33.0.0" 6 | minSdkVersion = 21 7 | compileSdkVersion = 33 8 | targetSdkVersion = 33 9 | 10 | // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP. 11 | ndkVersion = "23.1.7779620" 12 | } 13 | repositories { 14 | google() 15 | mavenCentral() 16 | } 17 | dependencies { 18 | classpath("com.android.tools.build:gradle") 19 | classpath("com.facebook.react:react-native-gradle-plugin") 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx512m -XX:MaxMetaspaceSize=256m 13 | org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | # AndroidX package structure to make it clearer which packages are bundled with the 21 | # Android operating system, and which are packaged with your app's APK 22 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 23 | android.useAndroidX=true 24 | # Automatically convert third-party libraries to use AndroidX 25 | android.enableJetifier=true 26 | 27 | # Version of flipper SDK to use with React Native 28 | FLIPPER_VERSION=0.182.0 29 | 30 | # Use this property to specify which architecture you want to build. 31 | # You can also override it from the CLI using 32 | # ./gradlew -PreactNativeArchitectures=x86_64 33 | reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64 34 | 35 | # Use this property to enable support to the new architecture. 36 | # This will allow you to use TurboModules and the Fabric render in 37 | # your application. You should enable this flag either if you want 38 | # to write custom TurboModules/Fabric components OR use libraries that 39 | # are providing them. 40 | newArchEnabled=false 41 | 42 | org.gradle.jvmargs=-Xmx4608m 43 | 44 | # Use this property to enable or disable the Hermes JS engine. 45 | # If set to false, you will be using JSC instead. 46 | hermesEnabled=true 47 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IronTony/react-native-redux-toolkit-starter-app/4b8d8e87fd76fa1aa2d5f61ba0621513b90336b3/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-all.zip 4 | networkTimeout=10000 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /android/gradlew: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright © 2015-2021 the original authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | # 21 | # Gradle start up script for POSIX generated by Gradle. 22 | # 23 | # Important for running: 24 | # 25 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 26 | # noncompliant, but you have some other compliant shell such as ksh or 27 | # bash, then to run this script, type that shell name before the whole 28 | # command line, like: 29 | # 30 | # ksh Gradle 31 | # 32 | # Busybox and similar reduced shells will NOT work, because this script 33 | # requires all of these POSIX shell features: 34 | # * functions; 35 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», 36 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; 37 | # * compound commands having a testable exit status, especially «case»; 38 | # * various built-in commands including «command», «set», and «ulimit». 39 | # 40 | # Important for patching: 41 | # 42 | # (2) This script targets any POSIX shell, so it avoids extensions provided 43 | # by Bash, Ksh, etc; in particular arrays are avoided. 44 | # 45 | # The "traditional" practice of packing multiple parameters into a 46 | # space-separated string is a well documented source of bugs and security 47 | # problems, so this is (mostly) avoided, by progressively accumulating 48 | # options in "$@", and eventually passing that to Java. 49 | # 50 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 51 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; 52 | # see the in-line comments for details. 53 | # 54 | # There are tweaks for specific operating systems such as AIX, CygWin, 55 | # Darwin, MinGW, and NonStop. 56 | # 57 | # (3) This script is generated from the Groovy template 58 | # https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 59 | # within the Gradle project. 60 | # 61 | # You can find Gradle at https://github.com/gradle/gradle/. 62 | # 63 | ############################################################################## 64 | 65 | # Attempt to set APP_HOME 66 | 67 | # Resolve links: $0 may be a link 68 | app_path=$0 69 | 70 | # Need this for daisy-chained symlinks. 71 | while 72 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 73 | [ -h "$app_path" ] 74 | do 75 | ls=$( ls -ld "$app_path" ) 76 | link=${ls#*' -> '} 77 | case $link in #( 78 | /*) app_path=$link ;; #( 79 | *) app_path=$APP_HOME$link ;; 80 | esac 81 | done 82 | 83 | # This is normally unused 84 | # shellcheck disable=SC2034 85 | APP_BASE_NAME=${0##*/} 86 | APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit 87 | 88 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 89 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 90 | 91 | # Use the maximum available, or set MAX_FD != -1 to use that value. 92 | MAX_FD=maximum 93 | 94 | warn () { 95 | echo "$*" 96 | } >&2 97 | 98 | die () { 99 | echo 100 | echo "$*" 101 | echo 102 | exit 1 103 | } >&2 104 | 105 | # OS specific support (must be 'true' or 'false'). 106 | cygwin=false 107 | msys=false 108 | darwin=false 109 | nonstop=false 110 | case "$( uname )" in #( 111 | CYGWIN* ) cygwin=true ;; #( 112 | Darwin* ) darwin=true ;; #( 113 | MSYS* | MINGW* ) msys=true ;; #( 114 | NONSTOP* ) nonstop=true ;; 115 | esac 116 | 117 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 118 | 119 | 120 | # Determine the Java command to use to start the JVM. 121 | if [ -n "$JAVA_HOME" ] ; then 122 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 123 | # IBM's JDK on AIX uses strange locations for the executables 124 | JAVACMD=$JAVA_HOME/jre/sh/java 125 | else 126 | JAVACMD=$JAVA_HOME/bin/java 127 | fi 128 | if [ ! -x "$JAVACMD" ] ; then 129 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 130 | 131 | Please set the JAVA_HOME variable in your environment to match the 132 | location of your Java installation." 133 | fi 134 | else 135 | JAVACMD=java 136 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 137 | 138 | Please set the JAVA_HOME variable in your environment to match the 139 | location of your Java installation." 140 | fi 141 | 142 | # Increase the maximum file descriptors if we can. 143 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 144 | case $MAX_FD in #( 145 | max*) 146 | # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. 147 | # shellcheck disable=SC3045 148 | MAX_FD=$( ulimit -H -n ) || 149 | warn "Could not query maximum file descriptor limit" 150 | esac 151 | case $MAX_FD in #( 152 | '' | soft) :;; #( 153 | *) 154 | # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. 155 | # shellcheck disable=SC3045 156 | ulimit -n "$MAX_FD" || 157 | warn "Could not set maximum file descriptor limit to $MAX_FD" 158 | esac 159 | fi 160 | 161 | # Collect all arguments for the java command, stacking in reverse order: 162 | # * args from the command line 163 | # * the main class name 164 | # * -classpath 165 | # * -D...appname settings 166 | # * --module-path (only if needed) 167 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 168 | 169 | # For Cygwin or MSYS, switch paths to Windows format before running java 170 | if "$cygwin" || "$msys" ; then 171 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 172 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 173 | 174 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 175 | 176 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 177 | for arg do 178 | if 179 | case $arg in #( 180 | -*) false ;; # don't mess with options #( 181 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 182 | [ -e "$t" ] ;; #( 183 | *) false ;; 184 | esac 185 | then 186 | arg=$( cygpath --path --ignore --mixed "$arg" ) 187 | fi 188 | # Roll the args list around exactly as many times as the number of 189 | # args, so each arg winds up back in the position where it started, but 190 | # possibly modified. 191 | # 192 | # NB: a `for` loop captures its iteration list before it begins, so 193 | # changing the positional parameters here affects neither the number of 194 | # iterations, nor the values presented in `arg`. 195 | shift # remove old arg 196 | set -- "$@" "$arg" # push replacement arg 197 | done 198 | fi 199 | 200 | # Collect all arguments for the java command; 201 | # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of 202 | # shell script including quotes and variable substitutions, so put them in 203 | # double quotes to make sure that they get re-expanded; and 204 | # * put everything else in single quotes, so that it's not re-expanded. 205 | 206 | set -- \ 207 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ 208 | -classpath "$CLASSPATH" \ 209 | org.gradle.wrapper.GradleWrapperMain \ 210 | "$@" 211 | 212 | # Stop when "xargs" is not available. 213 | if ! command -v xargs >/dev/null 2>&1 214 | then 215 | die "xargs is not available" 216 | fi 217 | 218 | # Use "xargs" to parse quoted args. 219 | # 220 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 221 | # 222 | # In Bash we could simply go: 223 | # 224 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 225 | # set -- "${ARGS[@]}" "$@" 226 | # 227 | # but POSIX shell has neither arrays nor command substitution, so instead we 228 | # post-process each arg (as a line of input to sed) to backslash-escape any 229 | # character that might be a shell metacharacter, then use eval to reverse 230 | # that process (while maintaining the separation between arguments), and wrap 231 | # the whole thing up as a single "set" statement. 232 | # 233 | # This will of course break if any of these variables contains a newline or 234 | # an unmatched quote. 235 | # 236 | 237 | eval "set -- $( 238 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 239 | xargs -n1 | 240 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 241 | tr '\n' ' ' 242 | )" '"$@"' 243 | 244 | exec "$JAVACMD" "$@" -------------------------------------------------------------------------------- /android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%"=="" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%"=="" set DIRNAME=. 29 | @rem This is normally unused 30 | set APP_BASE_NAME=%~n0 31 | set APP_HOME=%DIRNAME% 32 | 33 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 34 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 35 | 36 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 37 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 38 | 39 | @rem Find java.exe 40 | if defined JAVA_HOME goto findJavaFromJavaHome 41 | 42 | set JAVA_EXE=java.exe 43 | %JAVA_EXE% -version >NUL 2>&1 44 | if %ERRORLEVEL% equ 0 goto execute 45 | 46 | echo. 47 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 48 | echo. 49 | echo Please set the JAVA_HOME variable in your environment to match the 50 | echo location of your Java installation. 51 | 52 | goto fail 53 | 54 | :findJavaFromJavaHome 55 | set JAVA_HOME=%JAVA_HOME:"=% 56 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 57 | 58 | if exist "%JAVA_EXE%" goto execute 59 | 60 | echo. 61 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 62 | echo. 63 | echo Please set the JAVA_HOME variable in your environment to match the 64 | echo location of your Java installation. 65 | 66 | goto fail 67 | 68 | :execute 69 | @rem Setup the command line 70 | 71 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 72 | 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if %ERRORLEVEL% equ 0 goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | set EXIT_CODE=%ERRORLEVEL% 85 | if %EXIT_CODE% equ 0 set EXIT_CODE=1 86 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% 87 | exit /b %EXIT_CODE% 88 | 89 | :mainEnd 90 | if "%OS%"=="Windows_NT" endlocal 91 | 92 | :omega 93 | -------------------------------------------------------------------------------- /android/link-assets-manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "migIndex": 1, 3 | "data": [ 4 | { 5 | "path": "src/assets/fonts/Lato-Black.ttf", 6 | "sha1": "a001eb827743636e04f8efa7d4aeedf0541c46ac" 7 | }, 8 | { 9 | "path": "src/assets/fonts/Lato-BlackItalic.ttf", 10 | "sha1": "b490ec02c69bb74f5b4f487c59e984891c8da71c" 11 | }, 12 | { 13 | "path": "src/assets/fonts/Lato-Bold.ttf", 14 | "sha1": "542498221d97bee5bdbccf86ee8890bf8e8005c9" 15 | }, 16 | { 17 | "path": "src/assets/fonts/Lato-BoldItalic.ttf", 18 | "sha1": "6bf491e78e16d3b9c8a55752e1bd658e15ed7f19" 19 | }, 20 | { 21 | "path": "src/assets/fonts/Lato-Italic.ttf", 22 | "sha1": "190187b720ec2f2ff2e4281237e301000e09673f" 23 | }, 24 | { 25 | "path": "src/assets/fonts/Lato-Light.ttf", 26 | "sha1": "ad0d178564445a535b15d417f5b18019923d3bab" 27 | }, 28 | { 29 | "path": "src/assets/fonts/Lato-LightItalic.ttf", 30 | "sha1": "34388d9a3b64380c9f08d424d0adaa88a0d1650a" 31 | }, 32 | { 33 | "path": "src/assets/fonts/Lato-Regular.ttf", 34 | "sha1": "e923c72eda5e50a87e18ff5c71e9ef4b3b6455a3" 35 | }, 36 | { 37 | "path": "src/assets/fonts/Lato-Thin.ttf", 38 | "sha1": "07290446bee3f81ce501a3c3dbfde6097c70ca15" 39 | }, 40 | { 41 | "path": "src/assets/fonts/Lato-ThinItalic.ttf", 42 | "sha1": "ff4a1a9fe2dcc41d993f4c5067a3baa1c456ff97" 43 | } 44 | ] 45 | } 46 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'ReactNativeStarterApp' 2 | 3 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) 4 | 5 | include ':app' 6 | 7 | include ':react-native-vector-icons' 8 | project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android') 9 | 10 | includeBuild('../node_modules/@react-native/gradle-plugin') 11 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ReactNativeStarterApp", 3 | "displayName": "ReactNativeStarterApp", 4 | "environments": { 5 | "development": { 6 | "API_URL": "https://reqres.in/api", 7 | "ENV": "development" 8 | }, 9 | "staging": { 10 | "API_URL": "https://reqres.in/api", 11 | "ENV": "staging" 12 | }, 13 | "production": { 14 | "API_URL": "https://reqres.in/api", 15 | "ENV": "production" 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /assets/android_splashscreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IronTony/react-native-redux-toolkit-starter-app/4b8d8e87fd76fa1aa2d5f61ba0621513b90336b3/assets/android_splashscreen.png -------------------------------------------------------------------------------- /assets/bootsplash_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IronTony/react-native-redux-toolkit-starter-app/4b8d8e87fd76fa1aa2d5f61ba0621513b90336b3/assets/bootsplash_logo.png -------------------------------------------------------------------------------- /assets/bootsplash_logo@1,5x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IronTony/react-native-redux-toolkit-starter-app/4b8d8e87fd76fa1aa2d5f61ba0621513b90336b3/assets/bootsplash_logo@1,5x.png -------------------------------------------------------------------------------- /assets/bootsplash_logo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IronTony/react-native-redux-toolkit-starter-app/4b8d8e87fd76fa1aa2d5f61ba0621513b90336b3/assets/bootsplash_logo@2x.png -------------------------------------------------------------------------------- /assets/bootsplash_logo@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IronTony/react-native-redux-toolkit-starter-app/4b8d8e87fd76fa1aa2d5f61ba0621513b90336b3/assets/bootsplash_logo@3x.png -------------------------------------------------------------------------------- /assets/bootsplash_logo@4x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IronTony/react-native-redux-toolkit-starter-app/4b8d8e87fd76fa1aa2d5f61ba0621513b90336b3/assets/bootsplash_logo@4x.png -------------------------------------------------------------------------------- /assets/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IronTony/react-native-redux-toolkit-starter-app/4b8d8e87fd76fa1aa2d5f61ba0621513b90336b3/assets/icon.png -------------------------------------------------------------------------------- /assets/ios_splashscreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IronTony/react-native-redux-toolkit-starter-app/4b8d8e87fd76fa1aa2d5f61ba0621513b90336b3/assets/ios_splashscreen.png -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:metro-react-native-babel-preset'], 3 | plugins: [ 4 | [ 5 | 'module-resolver', 6 | { 7 | extensions: ['.js', '.jsx', '.ts', '.tsx', '.android.js', '.android.tsx', '.ios.js', '.ios.tsx'], 8 | root: ['.'], 9 | alias: { 10 | '@api': './src/api', 11 | '@assets': './src/assets', 12 | '@components': './src/components', 13 | '@constants': './src/constants', 14 | '@hooks': './src/hooks', 15 | '@i18n': './src/i18n', 16 | '@mmkv': './src/mmkv', 17 | '@redux': './src/redux', 18 | '@routes': './src/routes', 19 | '@scenes': './src/scenes', 20 | '@services': './src/services', 21 | '@theme': './src/theme', 22 | '@utils': './src/utils', 23 | '@env': './src/env.js', 24 | }, 25 | }, 26 | ], 27 | ], 28 | }; 29 | -------------------------------------------------------------------------------- /commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { extends: ['@commitlint/config-conventional'] }; 2 | -------------------------------------------------------------------------------- /docs/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IronTony/react-native-redux-toolkit-starter-app/4b8d8e87fd76fa1aa2d5f61ba0621513b90336b3/docs/error.png -------------------------------------------------------------------------------- /docs/ios_locations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IronTony/react-native-redux-toolkit-starter-app/4b8d8e87fd76fa1aa2d5f61ba0621513b90336b3/docs/ios_locations.png -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | import { AppRegistry, LogBox } from 'react-native'; 5 | import ContainerApp from 'src/ContainerApp'; 6 | import { name as appName } from './app.json'; 7 | 8 | // Remove YellowBox on Debug application screen 9 | LogBox.ignoreAllLogs(true); 10 | 11 | AppRegistry.registerComponent(appName, () => ContainerApp); 12 | -------------------------------------------------------------------------------- /ios/.xcode.env: -------------------------------------------------------------------------------- 1 | 2 | # This `.xcode.env` file is versioned and is used to source the environment 3 | # used when running script phases inside Xcode. 4 | # To customize your local environment, you can create an `.xcode.env.local` 5 | # file that is not versioned. 6 | 7 | # NODE_BINARY variable contains the PATH to the node executable. 8 | # 9 | # Customize the NODE_BINARY variable here. 10 | # For example, to use nvm with brew, add the following line 11 | # . "$(brew --prefix nvm)/nvm.sh" --no-use 12 | export NODE_BINARY=$(command -v node) -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 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 7 | 8 | platform :ios, min_ios_version_supported 9 | prepare_react_native_project! 10 | 11 | # If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set. 12 | # because `react-native-flipper` depends on (FlipperKit,...) that will be excluded 13 | # 14 | # To fix this you can also exclude `react-native-flipper` using a `react-native.config.js` 15 | # ```js 16 | # module.exports = { 17 | # dependencies: { 18 | # ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}), 19 | # ``` 20 | flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled 21 | 22 | linkage = ENV['USE_FRAMEWORKS'] 23 | if linkage != nil 24 | Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green 25 | use_frameworks! :linkage => linkage.to_sym 26 | end 27 | 28 | target 'ReactNativeStarterApp' do 29 | config = use_native_modules! 30 | 31 | # Flags change depending on the env values. 32 | flags = get_default_flags() 33 | 34 | use_react_native!( 35 | :path => config[:reactNativePath], 36 | # Hermes is now enabled by default. Disable by setting this flag to false. 37 | :hermes_enabled => flags[:hermes_enabled], 38 | :fabric_enabled => flags[:fabric_enabled], 39 | # Enables Flipper. 40 | # 41 | # Note that if you have use_frameworks! enabled, Flipper will not work and 42 | # you should disable the next line. 43 | :flipper_configuration => flipper_config, 44 | # An absolute path to your application root. 45 | :app_path => "#{Pod::Config.instance.installation_root}/.." 46 | ) 47 | 48 | pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons' 49 | 50 | target 'ReactNativeStarterAppTests' do 51 | inherit! :complete 52 | # Pods for testing 53 | end 54 | 55 | post_install do |installer| 56 | # https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202 57 | react_native_post_install( 58 | installer, 59 | config[:reactNativePath], 60 | :mac_catalyst_enabled => false 61 | ) 62 | __apply_Xcode_12_5_M1_post_install_workaround(installer) 63 | end 64 | end -------------------------------------------------------------------------------- /ios/ReactNativeStarterApp.xcodeproj/xcshareddata/xcschemes/ReactNativeStarterApp.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 53 | 55 | 61 | 62 | 63 | 64 | 70 | 72 | 78 | 79 | 80 | 81 | 83 | 84 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /ios/ReactNativeStarterApp.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ios/ReactNativeStarterApp.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/ReactNativeStarterApp/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : RCTAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /ios/ReactNativeStarterApp/AppDelegate.mm: -------------------------------------------------------------------------------- 1 | #import "AppDelegate.h" 2 | #import "RNBootSplash.h" 3 | 4 | #import 5 | 6 | @implementation AppDelegate 7 | 8 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 9 | { 10 | self.moduleName = @"ReactNativeStarterApp"; 11 | // You can add your custom initial props in the dictionary below. 12 | // They will be passed down to the ViewController used by React Native. 13 | self.initialProps = @{}; 14 | 15 | 16 | 17 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 18 | } 19 | 20 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge 21 | { 22 | #if DEBUG 23 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"]; 24 | #else 25 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 26 | #endif 27 | } 28 | 29 | - (UIView *)createRootViewWithBridge:(RCTBridge *)bridge 30 | moduleName:(NSString *)moduleName 31 | initProps:(NSDictionary *)initProps { 32 | UIView *rootView = [super createRootViewWithBridge:bridge 33 | moduleName:moduleName 34 | initProps:initProps]; 35 | 36 | [RNBootSplash initWithStoryboard:@"BootSplash" rootView:rootView]; // ⬅️ initialize the splash screen 37 | 38 | return rootView; 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /ios/ReactNativeStarterApp/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /ios/ReactNativeStarterApp/BootSplash.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /ios/ReactNativeStarterApp/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "version": 1, 4 | "author": "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ios/ReactNativeStarterApp/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ReactNativeStarterApp 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(MARKETING_VERSION) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(CURRENT_PROJECT_VERSION) 25 | LSRequiresIPhoneOS 26 | 27 | NSAppTransportSecurity 28 | 29 | NSExceptionDomains 30 | 31 | localhost 32 | 33 | NSExceptionAllowsInsecureHTTPLoads 34 | 35 | 36 | 37 | 38 | NSLocationWhenInUseUsageDescription 39 | 40 | UILaunchStoryboardName 41 | BootSplash.storyboard 42 | UIRequiredDeviceCapabilities 43 | 44 | armv7 45 | 46 | UISupportedInterfaceOrientations 47 | 48 | UIInterfaceOrientationPortrait 49 | UIInterfaceOrientationPortraitUpsideDown 50 | 51 | UIViewControllerBasedStatusBarAppearance 52 | 53 | UIAppFonts 54 | 55 | AntDesign.ttf 56 | Entypo.ttf 57 | EvilIcons.ttf 58 | Feather.ttf 59 | FontAwesome.ttf 60 | FontAwesome5_Brands.ttf 61 | FontAwesome5_Regular.ttf 62 | FontAwesome5_Solid.ttf 63 | FontAwesome6_Brands.ttf 64 | FontAwesome6_Regular.ttf 65 | FontAwesome6_Solid.ttf 66 | Foundation.ttf 67 | Ionicons.ttf 68 | MaterialIcons.ttf 69 | MaterialCommunityIcons.ttf 70 | SimpleLineIcons.ttf 71 | Octicons.ttf 72 | Zocial.ttf 73 | Fontisto.ttf 74 | Lato-Black.ttf 75 | Lato-BlackItalic.ttf 76 | Lato-Bold.ttf 77 | Lato-BoldItalic.ttf 78 | Lato-Italic.ttf 79 | Lato-Light.ttf 80 | Lato-LightItalic.ttf 81 | Lato-Regular.ttf 82 | Lato-Thin.ttf 83 | Lato-ThinItalic.ttf 84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /ios/ReactNativeStarterApp/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | @autoreleasepool { 8 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /ios/ReactNativeStarterAppTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /ios/ReactNativeStarterAppTests/ReactNativeStarterAppTests.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | #import 5 | #import 6 | 7 | #define TIMEOUT_SECONDS 600 8 | #define TEXT_TO_LOOK_FOR @"Welcome to React" 9 | 10 | @interface ReactNativeStarterAppTests : XCTestCase 11 | 12 | @end 13 | 14 | @implementation ReactNativeStarterAppTests 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 67 | -------------------------------------------------------------------------------- /ios/link-assets-manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "migIndex": 1, 3 | "data": [ 4 | { 5 | "path": "src/assets/fonts/Lato-Black.ttf", 6 | "sha1": "a001eb827743636e04f8efa7d4aeedf0541c46ac" 7 | }, 8 | { 9 | "path": "src/assets/fonts/Lato-BlackItalic.ttf", 10 | "sha1": "b490ec02c69bb74f5b4f487c59e984891c8da71c" 11 | }, 12 | { 13 | "path": "src/assets/fonts/Lato-Bold.ttf", 14 | "sha1": "542498221d97bee5bdbccf86ee8890bf8e8005c9" 15 | }, 16 | { 17 | "path": "src/assets/fonts/Lato-BoldItalic.ttf", 18 | "sha1": "6bf491e78e16d3b9c8a55752e1bd658e15ed7f19" 19 | }, 20 | { 21 | "path": "src/assets/fonts/Lato-Italic.ttf", 22 | "sha1": "190187b720ec2f2ff2e4281237e301000e09673f" 23 | }, 24 | { 25 | "path": "src/assets/fonts/Lato-Light.ttf", 26 | "sha1": "ad0d178564445a535b15d417f5b18019923d3bab" 27 | }, 28 | { 29 | "path": "src/assets/fonts/Lato-LightItalic.ttf", 30 | "sha1": "34388d9a3b64380c9f08d424d0adaa88a0d1650a" 31 | }, 32 | { 33 | "path": "src/assets/fonts/Lato-Regular.ttf", 34 | "sha1": "e923c72eda5e50a87e18ff5c71e9ef4b3b6455a3" 35 | }, 36 | { 37 | "path": "src/assets/fonts/Lato-Thin.ttf", 38 | "sha1": "07290446bee3f81ce501a3c3dbfde6097c70ca15" 39 | }, 40 | { 41 | "path": "src/assets/fonts/Lato-ThinItalic.ttf", 42 | "sha1": "ff4a1a9fe2dcc41d993f4c5067a3baa1c456ff97" 43 | } 44 | ] 45 | } 46 | -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | preset: 'react-native', 3 | moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], 4 | }; 5 | -------------------------------------------------------------------------------- /metro.config.js: -------------------------------------------------------------------------------- 1 | const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config'); 2 | 3 | /** 4 | * Metro configuration 5 | * https://facebook.github.io/metro/docs/configuration 6 | * 7 | * @type {import('metro-config').MetroConfig} 8 | */ 9 | const config = {}; 10 | module.exports = mergeConfig(getDefaultConfig(__dirname), config); -------------------------------------------------------------------------------- /navigation.d.ts: -------------------------------------------------------------------------------- 1 | import { RootStackParamList } from '@routes'; 2 | 3 | // This is to let useNavigation() is typed 4 | declare global { 5 | namespace ReactNavigation { 6 | // eslint-disable-next-line @typescript-eslint/no-empty-interface 7 | interface RootParamList extends RootStackParamList {} 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-starter-app", 3 | "version": "7.1.1", 4 | "private": true, 5 | "scripts": { 6 | "test": "jest", 7 | "start": "react-native start", 8 | "lint": "eslint --fix \"./src/**/*.{js,jsx,ts,tsx}\"", 9 | "lint:staged": "pretty-quick --staged && lint-staged", 10 | "pre-commit": "yarn lint-staged && yarn dependencies:checkCircular && yarn dependencies:graph", 11 | "clean:android": "cd android && ./gradlew cleanBuildCache && ./gradlew clean && cd ..", 12 | "clean:ios": "rm -rf ios/build", 13 | "assets": "npx react-native-asset", 14 | "assets:icons": "rn-toolbox icons", 15 | "assets:splashscreen:ios": "rn-toolbox splash ./assets/ios_splashscreen.png", 16 | "assets:splashscreen:android": "react-native generate-bootsplash ./assets/android_splashscreen.png --background-color=FFFFFF --logo-width=150 --assets-path=assets --flavor=main --platforms=android", 17 | "env:dev": "node scripts/set-environment.js development", 18 | "env:stage": "node scripts/set-environment.js staging", 19 | "env:prod": "node scripts/set-environment.js production", 20 | "setup:ios": "cd ios && pod install --repo-update && cd ..", 21 | "android": "cd android && ./gradlew clean && cd .. && react-native run-android", 22 | "android:dev": "run-s env:dev android", 23 | "android:stage": "run-s env:stage android", 24 | "android:prod": "run-s env:prod android", 25 | "ios": "react-native run-ios", 26 | "ios:dev": "run-s env:dev ios", 27 | "ios:stage": "run-s env:stage ios", 28 | "ios:prod": "run-s env:prod ios", 29 | "android:bundle:create": "rm -rf android/app/build && react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res", 30 | "android:assemble:debug": "cd android && ./gradlew assembleDebug", 31 | "ios:bundle:create": "react-native bundle --entry-file index.js --platform ios --dev false --bundle-output ios/main.jsbundle --assets-dest ios", 32 | "ios:assemble:debug": "xcodebuild -quiet -workspace ios/ReactNativeStarterApp.xcworkspace -scheme ReactNativeStarterApp -configuration Release -sdk iphonesimulator -destination platform='iOS Simulator',OS=13.3,name='iPhone 11 Pro Max' CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=NO", 33 | "build:dev:android": "run-s env:dev android:bundle:create android:assemble:debug", 34 | "build:dev:ios": "run-s env:dev setup:ios ios:assemble:debug", 35 | "prettier-check:staged": "prettier --check \"./src/**/*.{js,jsx,ts,tsx}\"", 36 | "prettier-format:staged": "prettier --write \"./src/**/*.{js,jsx,ts,tsx}\"", 37 | "dependencies:checkCircular": "madge src/ --circular", 38 | "dependencies:graph": "madge src/ --circular --image deps-graph.svg", 39 | "postinstall": "husky install" 40 | }, 41 | "dependencies": { 42 | "@react-navigation/native": "^6.1.9", 43 | "@react-navigation/native-stack": "^6.9.17", 44 | "@reduxjs/toolkit": "1.9.7", 45 | "@tamagui/shorthands": "^1.78.0", 46 | "@tamagui/themes": "^1.78.0", 47 | "axios": "^0.27.2", 48 | "i18next": "^22.5.0", 49 | "lodash": "^4.17.21", 50 | "react": "18.2.0", 51 | "react-i18next": "^12.3.1", 52 | "react-native": "0.72.6", 53 | "react-native-bootsplash": "^4.7.1", 54 | "react-native-indicators": "^0.17.0", 55 | "react-native-localize": "^3.0.3", 56 | "react-native-mmkv": "^2.11.0", 57 | "react-native-safe-area-context": "^4.7.4", 58 | "react-native-screens": "^3.27.0", 59 | "react-native-svg": "^13.14.0", 60 | "react-native-toast-message": "^2.1.7", 61 | "react-native-vector-icons": "^10.0.2", 62 | "react-native-version-number": "^0.3.6", 63 | "react-redux": "8.1.3", 64 | "redux-persist": "^6.0.0", 65 | "redux-saga": "1.2.3", 66 | "tamagui": "^1.78.0" 67 | }, 68 | "devDependencies": { 69 | "@babel/core": "^7.20.0", 70 | "@babel/preset-env": "^7.20.0", 71 | "@babel/runtime": "^7.20.0", 72 | "@commitlint/cli": "^18.4.3", 73 | "@commitlint/config-conventional": "^18.4.3", 74 | "@forward-software/react-native-toolbox": "^3.0.0", 75 | "@react-native/eslint-config": "^0.72.2", 76 | "@react-native/metro-config": "^0.72.11", 77 | "@trivago/prettier-plugin-sort-imports": "^4.3.0", 78 | "@tsconfig/react-native": "^3.0.0", 79 | "@types/lodash": "^4.14.200", 80 | "@types/metro-config": "^0.76.3", 81 | "@types/node": "^20.2.5", 82 | "@types/react": "^18.0.24", 83 | "@types/react-native-indicators": "^0.16.2", 84 | "@types/react-native-vector-icons": "^6.4.15", 85 | "@types/react-redux": "^7.1.23", 86 | "@types/react-test-renderer": "^18.0.0", 87 | "@typescript-eslint/eslint-plugin": "^5.59.8", 88 | "@typescript-eslint/parser": "^5.59.8", 89 | "babel-jest": "^29.2.1", 90 | "babel-plugin-module-resolver": "^5.0.0", 91 | "eslint": "^8.41.0", 92 | "eslint-plugin-no-inline-styles": "^1.0.5", 93 | "eslint-plugin-prettier": "^4.2.1", 94 | "eslint-plugin-react": "^7.32.2", 95 | "eslint-plugin-react-hooks": "^4.6.0", 96 | "husky": "^8.0.3", 97 | "jest": "^29.2.1", 98 | "lint-staged": "^13.2.2", 99 | "madge": "^6.1.0", 100 | "metro-react-native-babel-preset": "0.76.8", 101 | "npm-run-all": "^4.1.5", 102 | "prettier": "^2.8.8", 103 | "pretty-quick": "^3.1.3", 104 | "react-test-renderer": "18.2.0", 105 | "typescript": "4.8.4" 106 | }, 107 | "lint-staged": { 108 | "src/**/*.{js,jsx,ts,tsx}": [ 109 | "eslint", 110 | "npm run prettier-format:staged", 111 | "npm run prettier-check:staged" 112 | ] 113 | }, 114 | "husky": { 115 | "hooks": { 116 | "pre-commit": "lint:staged" 117 | } 118 | }, 119 | "madge": { 120 | "tsConfig": "./tsconfig.json", 121 | "fileExtensions": "ts", 122 | "excludeRegExp": [ 123 | ".*\\.test\\.ts$", 124 | ".*\\.test\\.tsx$" 125 | ], 126 | "detectiveOptions": { 127 | "ts": { 128 | "skipTypeImports": true 129 | } 130 | } 131 | }, 132 | "engines": { 133 | "node": ">=16" 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /react-native-starter-kit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IronTony/react-native-redux-toolkit-starter-app/4b8d8e87fd76fa1aa2d5f61ba0621513b90336b3/react-native-starter-kit.png -------------------------------------------------------------------------------- /react-native.config.js: -------------------------------------------------------------------------------- 1 | // Ported from package.json - see https://github.com/react-native-community/cli/blob/master/docs/configuration.md 2 | // 3 | // "rnpm": { 4 | // "assets": [ 5 | // "./src/assets/fonts" 6 | // ] 7 | // }, 8 | 9 | module.exports = { 10 | project: { 11 | ios: {}, 12 | android: {}, 13 | }, 14 | assets: ['./src/assets/fonts'], 15 | 'react-native-vector-icons': { 16 | platforms: { 17 | ios: null, 18 | }, 19 | }, 20 | }; 21 | -------------------------------------------------------------------------------- /screenshots/screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IronTony/react-native-redux-toolkit-starter-app/4b8d8e87fd76fa1aa2d5f61ba0621513b90336b3/screenshots/screenshot1.png -------------------------------------------------------------------------------- /screenshots/screenshot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IronTony/react-native-redux-toolkit-starter-app/4b8d8e87fd76fa1aa2d5f61ba0621513b90336b3/screenshots/screenshot2.png -------------------------------------------------------------------------------- /screenshots/screenshot3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IronTony/react-native-redux-toolkit-starter-app/4b8d8e87fd76fa1aa2d5f61ba0621513b90336b3/screenshots/screenshot3.png -------------------------------------------------------------------------------- /scripts/set-environment.js: -------------------------------------------------------------------------------- 1 | #!/bin/node 2 | const fs = require('fs'); 3 | 4 | const rnConfig = require('../app.json'); 5 | 6 | const selectedEnv = process.argv[2]; 7 | 8 | if (!Object.keys(rnConfig.environments).includes(selectedEnv)) { 9 | console.error( 10 | '💀💀💀 \x1b[47m\x1b[31mRequested environment', 11 | selectedEnv, 12 | 'does not exists inside app.json\x1b[0m 💀💀💀', 13 | ); 14 | process.exit(1); 15 | } 16 | 17 | const envVars = rnConfig.environments[process.argv[2]]; 18 | 19 | const content = `/* eslint-disable */ 20 | /**************** DO NOT TOUCH *****************/ 21 | /* This file gets generated by 'env:*' scripts */ 22 | /***********************************************/ 23 | 24 | export default ${JSON.stringify(envVars, undefined, 2)}; 25 | `; 26 | 27 | fs.writeFileSync('src/env.js', content); 28 | -------------------------------------------------------------------------------- /src/App.tsx: -------------------------------------------------------------------------------- 1 | import { DARK_THEME, LIGHT_THEME } from '@constants/theme'; 2 | import { messageHandlerReset } from '@redux/messageHandler/actions'; 3 | import { messageHandlerFullInfo } from '@redux/messageHandler/selectors'; 4 | import RootStackScreen from '@routes'; 5 | import React, { useEffect } from 'react'; 6 | import { StatusBar, useColorScheme } from 'react-native'; 7 | import Toast from 'react-native-toast-message'; 8 | import { useDispatch, useSelector } from 'react-redux'; 9 | 10 | function App() { 11 | const colorScheme = useColorScheme() ?? LIGHT_THEME; 12 | const isDarkMode = colorScheme === DARK_THEME; 13 | const dispatch = useDispatch(); 14 | const hasGeneralMessage = useSelector(messageHandlerFullInfo); 15 | 16 | useEffect(() => { 17 | if (hasGeneralMessage?.message) { 18 | Toast.show({ 19 | position: 'top', 20 | onHide: () => dispatch(messageHandlerReset()), 21 | visibilityTime: 3000, 22 | topOffset: 60, 23 | type: hasGeneralMessage?.status, 24 | text1: hasGeneralMessage?.message, 25 | // text2: description..... 26 | }); 27 | } 28 | }, [hasGeneralMessage, dispatch]); 29 | 30 | return ( 31 | <> 32 | 33 | 34 | 35 | 36 | ); 37 | } 38 | 39 | export default App; 40 | -------------------------------------------------------------------------------- /src/ContainerApp.tsx: -------------------------------------------------------------------------------- 1 | import { DARK_THEME, LIGHT_THEME } from '@constants/theme'; 2 | import toastConfig from '@constants/toast'; 3 | import '@i18n'; 4 | import { DarkTheme, DefaultTheme, NavigationContainer } from '@react-navigation/native'; 5 | import { persistor, store } from '@redux/store'; 6 | import { navigationRef } from '@routes/utils'; 7 | import appConfig from '@theme'; 8 | import React, { ReactElement, Suspense, useCallback, useEffect } from 'react'; 9 | import { Text, useColorScheme } from 'react-native'; 10 | import RNBootSplash from 'react-native-bootsplash'; 11 | import { SafeAreaProvider, initialWindowMetrics } from 'react-native-safe-area-context'; 12 | import Toast from 'react-native-toast-message'; 13 | import { Provider } from 'react-redux'; 14 | import { PersistGate } from 'redux-persist/integration/react'; 15 | import App from 'src/App'; 16 | import { TamaguiProvider } from 'tamagui'; 17 | 18 | function ContainerApp(): ReactElement { 19 | const colorScheme = useColorScheme() ?? LIGHT_THEME; 20 | const isDarkMode = colorScheme === DARK_THEME; 21 | 22 | const hideBootSplash = useCallback(async () => { 23 | await RNBootSplash.hide({ fade: true }); 24 | }, []); 25 | 26 | useEffect(() => { 27 | hideBootSplash(); 28 | }, [hideBootSplash]); 29 | 30 | return ( 31 | 32 | 33 | Loading...} persistor={persistor}> 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | ); 47 | } 48 | 49 | export default ContainerApp; 50 | -------------------------------------------------------------------------------- /src/api/index.ts: -------------------------------------------------------------------------------- 1 | import env from '@env'; 2 | import axios from 'axios'; 3 | 4 | const ApiClient = axios.create({ 5 | baseURL: env.API_URL, 6 | headers: { 7 | 'Content-type': 'application/json', 8 | }, 9 | }); 10 | 11 | export default ApiClient; 12 | -------------------------------------------------------------------------------- /src/assets/fonts/Lato-Black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IronTony/react-native-redux-toolkit-starter-app/4b8d8e87fd76fa1aa2d5f61ba0621513b90336b3/src/assets/fonts/Lato-Black.ttf -------------------------------------------------------------------------------- /src/assets/fonts/Lato-BlackItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IronTony/react-native-redux-toolkit-starter-app/4b8d8e87fd76fa1aa2d5f61ba0621513b90336b3/src/assets/fonts/Lato-BlackItalic.ttf -------------------------------------------------------------------------------- /src/assets/fonts/Lato-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IronTony/react-native-redux-toolkit-starter-app/4b8d8e87fd76fa1aa2d5f61ba0621513b90336b3/src/assets/fonts/Lato-Bold.ttf -------------------------------------------------------------------------------- /src/assets/fonts/Lato-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IronTony/react-native-redux-toolkit-starter-app/4b8d8e87fd76fa1aa2d5f61ba0621513b90336b3/src/assets/fonts/Lato-BoldItalic.ttf -------------------------------------------------------------------------------- /src/assets/fonts/Lato-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IronTony/react-native-redux-toolkit-starter-app/4b8d8e87fd76fa1aa2d5f61ba0621513b90336b3/src/assets/fonts/Lato-Italic.ttf -------------------------------------------------------------------------------- /src/assets/fonts/Lato-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IronTony/react-native-redux-toolkit-starter-app/4b8d8e87fd76fa1aa2d5f61ba0621513b90336b3/src/assets/fonts/Lato-Light.ttf -------------------------------------------------------------------------------- /src/assets/fonts/Lato-LightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IronTony/react-native-redux-toolkit-starter-app/4b8d8e87fd76fa1aa2d5f61ba0621513b90336b3/src/assets/fonts/Lato-LightItalic.ttf -------------------------------------------------------------------------------- /src/assets/fonts/Lato-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IronTony/react-native-redux-toolkit-starter-app/4b8d8e87fd76fa1aa2d5f61ba0621513b90336b3/src/assets/fonts/Lato-Regular.ttf -------------------------------------------------------------------------------- /src/assets/fonts/Lato-Thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IronTony/react-native-redux-toolkit-starter-app/4b8d8e87fd76fa1aa2d5f61ba0621513b90336b3/src/assets/fonts/Lato-Thin.ttf -------------------------------------------------------------------------------- /src/assets/fonts/Lato-ThinItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IronTony/react-native-redux-toolkit-starter-app/4b8d8e87fd76fa1aa2d5f61ba0621513b90336b3/src/assets/fonts/Lato-ThinItalic.ttf -------------------------------------------------------------------------------- /src/assets/images/reactnative.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IronTony/react-native-redux-toolkit-starter-app/4b8d8e87fd76fa1aa2d5f61ba0621513b90336b3/src/assets/images/reactnative.png -------------------------------------------------------------------------------- /src/components/AppVersion/index.tsx: -------------------------------------------------------------------------------- 1 | import env from '@env'; 2 | import React, { FC } from 'react'; 3 | import VersionNumber from 'react-native-version-number'; 4 | import { Text, YStack } from 'tamagui'; 5 | 6 | const EnvInfoView: FC = () => { 7 | return ( 8 | 9 | {/* This is just to show you how to get values from the generated ENV file */} 10 | {`ENV: ${env.ENV}`} 11 | 12 | {`v.${VersionNumber.appVersion}-${VersionNumber.buildVersion}`} 16 | 17 | ); 18 | }; 19 | 20 | export default EnvInfoView; 21 | -------------------------------------------------------------------------------- /src/components/CLoader/index.tsx: -------------------------------------------------------------------------------- 1 | import { palette } from '@theme/colors'; 2 | import * as React from 'react'; 3 | import { FC } from 'react'; 4 | import { StyleProp, ViewStyle } from 'react-native'; 5 | import { MaterialIndicator } from 'react-native-indicators'; 6 | import { XStack } from 'tamagui'; 7 | import styles from './styles'; 8 | 9 | interface ICLoader { 10 | color?: string; 11 | size?: number; 12 | style?: StyleProp; 13 | fullPage?: boolean; 14 | } 15 | 16 | const CLoader: FC = ({ color = palette.sun_flower, size = 40, style = {}, fullPage = false }) => { 17 | return ( 18 | 19 | 20 | 21 | ); 22 | }; 23 | 24 | export default CLoader; 25 | -------------------------------------------------------------------------------- /src/components/CLoader/styles.ts: -------------------------------------------------------------------------------- 1 | import { palette } from '@theme/colors'; 2 | import { Platform, StyleSheet } from 'react-native'; 3 | 4 | const styles = StyleSheet.create({ 5 | fullPageLoader: { 6 | backgroundColor: palette.black_opacity_7, 7 | ...Platform.select({ 8 | ios: { 9 | height: '100%', 10 | position: 'absolute', 11 | width: '100%', 12 | bottom: 0, 13 | zIndex: 99, 14 | }, 15 | android: { 16 | // Hackfix for elevation 17 | bottom: 0, 18 | elevation: 4, 19 | height: '101%', 20 | left: -5, 21 | opacity: 1, 22 | position: 'absolute', 23 | top: -5, 24 | width: '103%', 25 | // /Hackfix for elevation 26 | }, 27 | }), 28 | }, 29 | }); 30 | 31 | export default styles; 32 | -------------------------------------------------------------------------------- /src/components/CSafeAreaView/index.tsx: -------------------------------------------------------------------------------- 1 | import React, { FC, ReactNode } from 'react'; 2 | import { YStack } from 'tamagui'; 3 | 4 | interface CSafeAreaViewProps { 5 | children: ReactNode; 6 | } 7 | 8 | const CSafeAreaView: FC = ({ children }) => { 9 | return ( 10 | 11 | {children} 12 | 13 | ); 14 | }; 15 | 16 | export default CSafeAreaView; 17 | -------------------------------------------------------------------------------- /src/components/GenericHeader/index.tsx: -------------------------------------------------------------------------------- 1 | import { palette } from '@theme/colors'; 2 | import React, { FC, memo, ReactNode } from 'react'; 3 | import { Pressable, StyleProp, ViewStyle } from 'react-native'; 4 | import Ionicons from 'react-native-vector-icons/Ionicons'; 5 | import { Text, XStack } from 'tamagui'; 6 | import styles from './styles'; 7 | 8 | interface IGenericHeader { 9 | BodyHeader?: ReactNode; 10 | LeftAction?: ReactNode; 11 | title?: string; 12 | RightAction?: ReactNode; 13 | onBackClicked?: () => void; 14 | style?: StyleProp; 15 | subtitle?: string; 16 | withShadow?: boolean; 17 | } 18 | 19 | const GenericHeader: FC = ({ 20 | BodyHeader, 21 | LeftAction, 22 | title, 23 | RightAction, 24 | onBackClicked, 25 | style = {}, 26 | subtitle = undefined, 27 | withShadow = false, 28 | }) => { 29 | return ( 30 | 36 | 37 | {/* 38 | The GenericHeader component accepts an onBackClicked prop. 39 | The route where you want to go is specified in the import of this Header in your scene component 40 | */} 41 | {!!onBackClicked && ( 42 | 43 | 44 | {/* {t('Header:back')} */} 45 | 46 | )} 47 | {/* 48 | You can also pass a custom component defined in you scene component for the left section of the Header 49 | */} 50 | {LeftAction} 51 | 52 | 53 | 54 | {/* 55 | You can pass the page name or a component that will be rendered in the middle of your Header 56 | */} 57 | 58 | {!!title && ( 59 | 68 | {title} 69 | 70 | )} 71 | {!subtitle ? <> : {subtitle}} 72 | {BodyHeader} 73 | 74 | 75 | 76 | {/* 77 | You can also pass a custom component defined in you scene component for the right section of the Header 78 | */} 79 | 80 | {RightAction} 81 | 82 | 83 | ); 84 | }; 85 | 86 | export default memo(GenericHeader); 87 | -------------------------------------------------------------------------------- /src/components/GenericHeader/styles.ts: -------------------------------------------------------------------------------- 1 | import { palette } from '@theme/colors'; 2 | import { StyleSheet } from 'react-native'; 3 | 4 | const styles = StyleSheet.create({ 5 | headerContainer: { 6 | backgroundColor: palette.white, 7 | paddingHorizontal: 16, 8 | zIndex: 9999, 9 | }, 10 | HeaderShadow: { 11 | elevation: 3, 12 | shadowColor: palette.grey_shadow_7, 13 | shadowOffset: { width: 0, height: 5 }, 14 | shadowOpacity: 0.7, 15 | shadowRadius: 3, 16 | zIndex: 1, 17 | }, 18 | backButtonContainer: {}, 19 | // backButtonStyle: { 20 | // color: customTheme.colors.backButtonText, 21 | // fontFamily: fonts.boldOS, 22 | // fontSize: 18, 23 | // }, 24 | backButtonIcon: { 25 | color: palette.peter_river, 26 | marginRight: 8, 27 | fontSize: 24, 28 | }, 29 | bodyContainer: { 30 | alignItems: 'center', 31 | flex: 1, 32 | }, 33 | mainPageTitle: { 34 | color: palette.peter_river, 35 | // fontFamily: fonts.bold, 36 | fontSize: 24, 37 | lineHeight: 24, 38 | textAlign: 'center', 39 | width: 220, 40 | }, 41 | BodyContent: { 42 | alignItems: 'center', 43 | flex: 1, 44 | justifyContent: 'center', 45 | width: '100%', 46 | }, 47 | }); 48 | 49 | export default styles; 50 | -------------------------------------------------------------------------------- /src/components/GenericModal/index.tsx: -------------------------------------------------------------------------------- 1 | import CSafeAreaView from '@components/CSafeAreaView'; 2 | import GenericHeader from '@components/GenericHeader'; 3 | import { StackActions, useNavigation } from '@react-navigation/native'; 4 | import React, { useCallback, FC, ReactNode } from 'react'; 5 | import { Pressable } from 'react-native'; 6 | import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons'; 7 | import { ScrollView, Text } from 'tamagui'; 8 | 9 | interface IModalPage { 10 | children: ReactNode; 11 | pageTitle: string; 12 | } 13 | 14 | const ModalPage: FC = ({ children, pageTitle }) => { 15 | const navigation = useNavigation(); 16 | const popAction = useCallback(() => StackActions.pop(), []); 17 | 18 | const closeModal = useCallback(() => { 19 | navigation.dispatch(popAction); 20 | }, [navigation, popAction]); 21 | 22 | return ( 23 | 24 | 27 | {pageTitle} 28 | 29 | } 30 | RightAction={ 31 | 32 | 33 | 34 | } 35 | /> 36 | 43 | {children} 44 | 45 | 46 | ); 47 | }; 48 | 49 | export default ModalPage; 50 | -------------------------------------------------------------------------------- /src/constants/theme.ts: -------------------------------------------------------------------------------- 1 | export const DARK_THEME = 'dark'; 2 | export const LIGHT_THEME = 'theme'; 3 | -------------------------------------------------------------------------------- /src/constants/toast.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Text, XStack } from 'tamagui'; 3 | 4 | type Props = { 5 | text1: string; 6 | text2: string; 7 | }; 8 | 9 | const toastConfig = { 10 | /* 11 | Overwrite 'success' type, 12 | by modifying the existing `BaseToast` component 13 | */ 14 | success: (props: Props) => ( 15 | 16 | 17 | {props.text1} 18 | 19 | {props.text2 && ( 20 | 21 | {props.text2} 22 | 23 | )} 24 | 25 | ), 26 | /* 27 | Overwrite 'error' type, 28 | by modifying the existing `ErrorToast` component 29 | */ 30 | error: (props: Props) => ( 31 | 32 | 33 | {props.text1} 34 | 35 | {props.text2 && ( 36 | 37 | {props.text2} 38 | 39 | )} 40 | 41 | ), 42 | /* 43 | Or create a completely new type - `customToast`, 44 | building the layout from scratch. 45 | 46 | I can consume any custom `props` I want. 47 | They will be passed when calling the `show` method (see below) 48 | */ 49 | // customToast: ({ text1, props }) => ( 50 | // 51 | // {text1} 52 | // {props.uuid} 53 | // 54 | // ), 55 | }; 56 | 57 | export default toastConfig; 58 | -------------------------------------------------------------------------------- /src/hooks/useNavigationBack.ts: -------------------------------------------------------------------------------- 1 | import { StackActions, useNavigation } from '@react-navigation/core'; 2 | import { useCallback } from 'react'; 3 | 4 | export const useNavigationBackAction = (count = 1): (() => void) => { 5 | const navigation = useNavigation(); 6 | 7 | const goBack = useCallback(() => { 8 | const popAciton = StackActions.pop(count); 9 | navigation.dispatch(popAciton); 10 | }, [count, navigation]); 11 | 12 | return goBack; 13 | }; 14 | -------------------------------------------------------------------------------- /src/i18n/index.ts: -------------------------------------------------------------------------------- 1 | import i18n from 'i18next'; 2 | import { initReactI18next } from 'react-i18next'; 3 | import { Text } from 'react-native'; 4 | import { defaultLanguage, languagesResources } from './languageConfig'; 5 | import RNLanguageDetector from './languageDetector'; 6 | 7 | // @ts-nocheck 8 | // @ts-ignore 9 | i18n 10 | // @ts-ignore 11 | .use(RNLanguageDetector) 12 | .use(initReactI18next) // passes i18n down to react-i18next 13 | .init({ 14 | // @ts-ignore 15 | debug: process.env.NODE_ENV === 'development', 16 | resources: languagesResources, 17 | compatibilityJSON: 'v3', 18 | // language to use if translations in user language are not available. 19 | fallbackLng: defaultLanguage, 20 | 21 | ns: ['common'], 22 | defaultNS: 'common', 23 | 24 | interpolation: { 25 | escapeValue: false, // not needed for react as it escapes by default 26 | }, 27 | 28 | react: { 29 | useSuspense: true, 30 | defaultTransParent: Text, 31 | transSupportBasicHtmlNodes: false, 32 | }, 33 | }); 34 | 35 | export default i18n; 36 | -------------------------------------------------------------------------------- /src/i18n/languageConfig.ts: -------------------------------------------------------------------------------- 1 | // Import here your languages 2 | import en from './locales/en.json'; 3 | import it from './locales/it.json'; 4 | 5 | // Set here you favourite default language 6 | export const defaultLanguage = 'en'; 7 | 8 | // Export here your language files import 9 | export const languagesResources = { 10 | en, 11 | it, 12 | }; 13 | -------------------------------------------------------------------------------- /src/i18n/languageDetector.ts: -------------------------------------------------------------------------------- 1 | import { mmkvStorage } from '@mmkv'; 2 | import { findBestLanguageTag } from 'react-native-localize'; 3 | import { defaultLanguage, languagesResources } from './languageConfig'; 4 | 5 | const LOCALE_PERSISTENCE_KEY = 'app_locale'; 6 | 7 | const noop = (): void => { 8 | // Do nothing 9 | }; 10 | 11 | const RNLanguageDetector = { 12 | type: 'languageDetector', 13 | async: true, 14 | detect: (cb: (detectedLocale: string) => void): void => { 15 | try { 16 | // Retrieve cached locale 17 | const persistedLocale = mmkvStorage.getString(LOCALE_PERSISTENCE_KEY); 18 | 19 | // If not found, detect from device 20 | if (!persistedLocale) { 21 | // Find best available language from the resource ones 22 | const languageTags = Object.keys(languagesResources); 23 | const detectedLocale = findBestLanguageTag(languageTags); 24 | 25 | // Return detected locale or default language 26 | return cb(detectedLocale?.languageTag ?? defaultLanguage); 27 | } 28 | 29 | cb(persistedLocale); 30 | } catch { 31 | console.warn('Failed to detect locale!'); 32 | console.warn('Will use defaultLanguage:', defaultLanguage); 33 | 34 | cb(defaultLanguage); 35 | } 36 | }, 37 | init: noop, 38 | cacheUserLanguage: (locale: string): void => { 39 | mmkvStorage.set(LOCALE_PERSISTENCE_KEY, locale); 40 | }, 41 | }; 42 | 43 | export default RNLanguageDetector; 44 | -------------------------------------------------------------------------------- /src/i18n/locales/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "common": { 3 | "italian": "Italian", 4 | "english": "English" 5 | }, 6 | "Header": { 7 | "back": "Back" 8 | }, 9 | "Homepage": { 10 | "welcome": "Thank you for using the React Native Starter App\n😍 😘 🙏🏻", 11 | "releasedWithLove": "Created and released with ❤️ for you", 12 | "gotoUsersList": "Go to Users List", 13 | "openModal": "Open Modal", 14 | "createNewUser": " Create new user", 15 | "ModifyUser": "Modify user", 16 | "DeleteUser": "Delete user", 17 | "UserCreated": "User created!", 18 | "UserNotCreated": "Error! User not created!", 19 | "UserModified": "User modified", 20 | "UserNotModified": "Error! User not modified", 21 | "UserDeleted": "User deleted", 22 | "UserNotDeleted": "Error! User not deleted" 23 | }, 24 | "UsersList": { 25 | "UsersList": "Users List" 26 | }, 27 | "ModalPage": { 28 | "PageName": "Modal Page", 29 | "thisIsAModal": "This is a modal!" 30 | }, 31 | "UserDetails": { 32 | "UserDetails": "User Details" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/i18n/locales/it.json: -------------------------------------------------------------------------------- 1 | { 2 | "common": { 3 | "italian": "Italiano", 4 | "english": "Inglese" 5 | }, 6 | "Header": { 7 | "back": "Indietro" 8 | }, 9 | "Homepage": { 10 | "welcome": "Grazie per usare React Native Starter App\n😍 😘 🙏🏻", 11 | "releasedWithLove": "Creato e rilasciato con ❤️ per voi", 12 | "gotoUsersList": "Vai alla pagina degli utenti", 13 | "openModal": "Apri la modale", 14 | "createNewUser": " Crea nuovo utente", 15 | "ModifyUser": "Modifica utente", 16 | "DeleteUser": "Cancella utente", 17 | "UserCreated": "Utente creato con successo!", 18 | "UserNotCreated": "Errore! Utente non creato!", 19 | "UserModified": "Utente modificato", 20 | "UserNotModified": "Errore! Utente non modificato", 21 | "UserDeleted": "Utente eliminato", 22 | "UserNotDeleted": "Errore! Utente non eliminato" 23 | }, 24 | "UsersList": { 25 | "UsersList": "Lista Utenti" 26 | }, 27 | "ModalPage": { 28 | "PageName": "Modale", 29 | "thisIsAModal": "Questa è una modale!" 30 | }, 31 | "UserDetails": { 32 | "UserDetails": "Dettaglio utente" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/mmkv/index.ts: -------------------------------------------------------------------------------- 1 | import { MMKV } from 'react-native-mmkv'; 2 | 3 | export const mmkvStorage = new MMKV({ 4 | id: 'user-starter-storage', 5 | // path: `${USER_DIRECTORY}/storage`, 6 | // encryptionKey: 'encryption_key', 7 | }); 8 | -------------------------------------------------------------------------------- /src/redux/actions.ts: -------------------------------------------------------------------------------- 1 | export * from './reqres/actions'; 2 | -------------------------------------------------------------------------------- /src/redux/messageHandler/actions.ts: -------------------------------------------------------------------------------- 1 | import { createAction } from '@reduxjs/toolkit'; 2 | import type { messageHandlerPayload } from './types'; 3 | 4 | export const messageHandlerSet = createAction('MESSAGE_HANDLER_SET'); 5 | export const messageHandlerReset = createAction('MESSAGE_HANDLER_RESET'); 6 | -------------------------------------------------------------------------------- /src/redux/messageHandler/reducers.ts: -------------------------------------------------------------------------------- 1 | import { createReducer } from '@reduxjs/toolkit'; 2 | import { messageHandlerSet, messageHandlerReset } from './actions'; 3 | 4 | export interface IMessageHandler { 5 | status: 'info' | 'success' | 'error' | undefined; 6 | message: string | undefined; 7 | } 8 | 9 | const initialState: IMessageHandler = { 10 | status: undefined, 11 | message: undefined, 12 | }; 13 | 14 | const messagesReducer = createReducer(initialState, { 15 | [messageHandlerSet.type]: (state, action) => { 16 | state.status = action.payload.status; 17 | state.message = action.payload.message; 18 | }, 19 | [messageHandlerReset.type]: state => { 20 | state.status = undefined; 21 | state.message = undefined; 22 | }, 23 | }); 24 | 25 | export default messagesReducer; 26 | -------------------------------------------------------------------------------- /src/redux/messageHandler/selectors.ts: -------------------------------------------------------------------------------- 1 | import { createSelector } from '@reduxjs/toolkit'; 2 | import type { RootState } from '../reducers'; 3 | 4 | const messageHandlerSelector = (state: RootState) => state.messages; 5 | 6 | export const messageHandlerFullInfo = createSelector(messageHandlerSelector, messageState => messageState); 7 | -------------------------------------------------------------------------------- /src/redux/messageHandler/types.ts: -------------------------------------------------------------------------------- 1 | export type messageHandlerPayload = { 2 | status: 'info' | 'success' | 'error'; 3 | message: string; 4 | }; 5 | -------------------------------------------------------------------------------- /src/redux/reducers.ts: -------------------------------------------------------------------------------- 1 | import { usersReducer } from '@redux/reqres/reducers'; 2 | import { persistCombineReducers } from 'redux-persist'; 3 | import messagesReducer from './messageHandler/reducers'; 4 | import { reduxStorage } from './storage'; 5 | 6 | const reducers = { 7 | users: usersReducer, 8 | messages: messagesReducer, 9 | }; 10 | 11 | const persistConfig = { 12 | key: 'root', 13 | storage: reduxStorage, 14 | // There is an issue in the source code of redux-persist (default setTimeout does not cleaning) 15 | timeout: undefined, 16 | whitelist: [''], 17 | }; 18 | 19 | // Setup Reducers 20 | export const persistedRootReducer = persistCombineReducers(persistConfig, reducers); 21 | 22 | export type RootState = ReturnType; 23 | 24 | export default persistedRootReducer; 25 | -------------------------------------------------------------------------------- /src/redux/reqres/actions.ts: -------------------------------------------------------------------------------- 1 | import { createAction } from '@reduxjs/toolkit'; 2 | import { 3 | CreateUserRequestPayload, 4 | CreateUserSuccessPayload, 5 | DeleteUserRequestPayload, 6 | ModifyUserRequestPayload, 7 | ModifyUserSuccessPayload, 8 | UserDetailsRequestPayload, 9 | UserDetailsSuccessPayload, 10 | UsersRequestPayload, 11 | UsersSuccessPayload, 12 | } from './types'; 13 | 14 | export const getUsersListRequest = createAction('ACTION/GET_USERS_LIST_REQUEST'); 15 | export const getUsersListSuccess = createAction('ACTION/GET_USERS_LIST_SUCCESS'); 16 | export const getUsersListFailed = createAction('ACTION/GET_USERS_LIST_FAILED'); 17 | 18 | export const getUserDetailsRequest = createAction('ACTION/GET_USER_DETAILS_REQUEST'); 19 | export const getUserDetailsSuccess = createAction('ACTION/GET_USER_DETAILS_SUCCESS'); 20 | export const getUserDetailsFailed = createAction('ACTION/GET_USER_DETAILS_FAILED'); 21 | 22 | export const createUserRequest = createAction('ACTION/CREATE_USER_REQUEST'); 23 | export const createUserSuccess = createAction('ACTION/CREATE_USER_SUCCESS'); 24 | export const createUserFailed = createAction('ACTION/CREATE_USER_FAILED'); 25 | 26 | export const modifyUserRequest = createAction('ACTION/MODIFY_USER_REQUEST'); 27 | export const modifyUserSuccess = createAction('ACTION/MODIFY_USER_SUCCESS'); 28 | export const modifyUserFailed = createAction('ACTION/MODIFY_USER_FAILED'); 29 | 30 | export const deleteUserRequest = createAction('ACTION/DELETE_USER_REQUEST'); 31 | export const deleteUserSuccess = createAction('ACTION/DELETE_USER_SUCCESS'); 32 | export const deleteUserFailed = createAction('ACTION/DELETE_USER_FAILED'); 33 | -------------------------------------------------------------------------------- /src/redux/reqres/apiCall.ts: -------------------------------------------------------------------------------- 1 | import ApiClient from '@api'; 2 | import env from '@env'; 3 | import { 4 | CreateUserRequestPayload, 5 | CreateUserSuccessPayload, 6 | DeleteUserRequestPayload, 7 | ModifyUserRequestPayload, 8 | ModifyUserSuccessPayload, 9 | UserDetailsRequestPayload, 10 | UserDetailsSuccessPayload, 11 | UsersRequestPayload, 12 | UsersSuccessPayload, 13 | } from './types'; 14 | 15 | export async function getUsers({ pageParam, per_page }: UsersRequestPayload) { 16 | try { 17 | const response = await ApiClient.get(`${env.API_URL}/users`, { 18 | params: { 19 | ...(pageParam && { 20 | page: pageParam, 21 | }), 22 | ...(per_page && { 23 | per_page, 24 | }), 25 | }, 26 | }); 27 | 28 | return response.data; 29 | } catch (error) { 30 | console.error('getUsers - Error: ', error); 31 | throw error; 32 | } 33 | } 34 | 35 | export async function getUserDetails({ userId }: UserDetailsRequestPayload) { 36 | try { 37 | const response = await ApiClient.get(`${env.API_URL}/users/${userId}`); 38 | 39 | return response.data; 40 | } catch (error) { 41 | console.error('getUserDetails - Error: ', error); 42 | throw error; 43 | } 44 | } 45 | 46 | export async function createUser({ name, job }: CreateUserRequestPayload) { 47 | try { 48 | const response = await ApiClient.post(`${env.API_URL}/users`, { 49 | params: { 50 | name, 51 | job, 52 | }, 53 | }); 54 | 55 | return response.data; 56 | } catch (error) { 57 | console.error('createUser - Error: ', error); 58 | throw error; 59 | } 60 | } 61 | 62 | export async function modifyUser({ userId, name, job }: ModifyUserRequestPayload) { 63 | try { 64 | // You can use also patch 65 | const response = await ApiClient.put(`${env.API_URL}/users/${userId}`, { 66 | params: { 67 | name, 68 | job, 69 | }, 70 | }); 71 | 72 | return response.data; 73 | } catch (error) { 74 | console.error('modifyUser - Error: ', error); 75 | throw error; 76 | } 77 | } 78 | 79 | export async function deleteUser({ userId }: DeleteUserRequestPayload) { 80 | try { 81 | const response = await ApiClient.delete(`${env.API_URL}/users/${userId}`); 82 | 83 | return response; 84 | } catch (error) { 85 | console.error('deleteUser - Error: ', error); 86 | throw error; 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /src/redux/reqres/indexSaga.ts: -------------------------------------------------------------------------------- 1 | import { all, AllEffect, call, ForkEffect, spawn } from 'redux-saga/effects'; 2 | import filmSaga from './sagas'; 3 | 4 | function* filmsRootSaga(): Generator>, void> { 5 | const sagas = [filmSaga]; 6 | 7 | yield all( 8 | sagas.map(saga => 9 | spawn(function* () { 10 | while (true) { 11 | try { 12 | yield call(saga); 13 | break; 14 | } catch (e) { 15 | console.error(e); 16 | } 17 | } 18 | }), 19 | ), 20 | ); 21 | } 22 | 23 | export default filmsRootSaga; 24 | -------------------------------------------------------------------------------- /src/redux/reqres/reducers.ts: -------------------------------------------------------------------------------- 1 | import { createReducer } from '@reduxjs/toolkit'; 2 | import { 3 | getUserDetailsFailed, 4 | getUserDetailsRequest, 5 | getUserDetailsSuccess, 6 | getUsersListFailed, 7 | getUsersListRequest, 8 | getUsersListSuccess, 9 | } from './actions'; 10 | import { User } from './types'; 11 | 12 | export interface UsersState { 13 | usersList: { 14 | loading: boolean; 15 | users: User[]; 16 | page: number; 17 | total: number | undefined; 18 | total_pages: number | undefined; 19 | }; 20 | userDetails: { 21 | loading: boolean; 22 | details: User | null; 23 | }; 24 | } 25 | 26 | const initialState: UsersState = { 27 | usersList: { 28 | loading: false, 29 | users: [], 30 | page: 1, 31 | total: undefined, 32 | total_pages: undefined, 33 | }, 34 | userDetails: { 35 | loading: false, 36 | details: null, 37 | }, 38 | }; 39 | 40 | export const usersReducer = createReducer(initialState, { 41 | [getUsersListRequest.type]: state => { 42 | state.usersList.loading = true; 43 | }, 44 | [getUsersListSuccess.type]: (state, action) => { 45 | state.usersList.loading = false; 46 | state.usersList.users = [...state.usersList.users, ...action.payload.data]; 47 | state.usersList.page = action.payload.page; 48 | state.usersList.total = action.payload.total; 49 | state.usersList.total_pages = action.payload.total_pages; 50 | }, 51 | [getUsersListFailed.type]: state => { 52 | state.usersList.loading = false; 53 | }, 54 | [getUserDetailsRequest.type]: state => { 55 | state.userDetails.loading = true; 56 | }, 57 | [getUserDetailsSuccess.type]: (state, action) => { 58 | state.userDetails.loading = false; 59 | state.userDetails.details = action.payload.data; 60 | }, 61 | [getUserDetailsFailed.type]: state => { 62 | state.usersList.loading = false; 63 | }, 64 | }); 65 | -------------------------------------------------------------------------------- /src/redux/reqres/sagas.ts: -------------------------------------------------------------------------------- 1 | import i18n from '@i18n'; 2 | import { messageHandlerSet } from '@redux/messageHandler/actions'; 3 | import { PayloadAction } from '@reduxjs/toolkit'; 4 | import isEmpty from 'lodash/isEmpty'; 5 | import { call, ForkEffect, put, takeLatest } from 'redux-saga/effects'; 6 | import { 7 | createUserFailed, 8 | createUserRequest, 9 | createUserSuccess, 10 | deleteUserRequest, 11 | getUserDetailsFailed, 12 | getUserDetailsRequest, 13 | getUserDetailsSuccess, 14 | getUsersListFailed, 15 | getUsersListRequest, 16 | getUsersListSuccess, 17 | modifyUserRequest, 18 | } from './actions'; 19 | import * as UsersAPI from './apiCall'; 20 | import { 21 | UsersSuccessPayload, 22 | UsersRequestPayload, 23 | UserDetailsRequestPayload, 24 | UserDetailsSuccessPayload, 25 | CreateUserRequestPayload, 26 | CreateUserSuccessPayload, 27 | ModifyUserRequestPayload, 28 | ModifyUserSuccessPayload, 29 | DeleteUserRequestPayload, 30 | } from './types'; 31 | 32 | function* getUsersListSaga({ payload }: PayloadAction) { 33 | try { 34 | const response: UsersSuccessPayload = yield call(UsersAPI.getUsers, { ...payload }); 35 | 36 | if (!isEmpty(response)) { 37 | yield put(getUsersListSuccess(response)); 38 | } else { 39 | yield put(getUsersListFailed()); 40 | } 41 | } catch (err) { 42 | yield put(getUsersListFailed()); 43 | } 44 | } 45 | 46 | function* getUserDetailsSaga({ payload }: PayloadAction) { 47 | try { 48 | const response: UserDetailsSuccessPayload = yield call(UsersAPI.getUserDetails, { ...payload }); 49 | 50 | if (!isEmpty(response)) { 51 | yield put(getUserDetailsSuccess(response)); 52 | } else { 53 | yield put(getUserDetailsFailed()); 54 | } 55 | } catch (err) { 56 | yield put(getUserDetailsFailed()); 57 | } 58 | } 59 | 60 | function* createUserSaga({ payload }: PayloadAction) { 61 | try { 62 | const response: CreateUserSuccessPayload = yield call(UsersAPI.createUser, { ...payload }); 63 | 64 | if (!isEmpty(response)) { 65 | yield put(createUserSuccess(response)); 66 | yield put(messageHandlerSet({ message: i18n.t('Homepage:UserCreated'), status: 'success' })); 67 | } else { 68 | yield put(createUserFailed()); 69 | yield put(messageHandlerSet({ message: i18n.t('Homepage:UserNotCreated'), status: 'error' })); 70 | } 71 | } catch (err: any) { 72 | yield put(createUserFailed()); 73 | yield put( 74 | messageHandlerSet({ message: err?.message?.message ?? i18n.t('Homepage:UserNotCreated'), status: 'error' }), 75 | ); 76 | } 77 | } 78 | 79 | function* modifyUserSaga({ payload }: PayloadAction) { 80 | try { 81 | const response: ModifyUserSuccessPayload = yield call(UsersAPI.modifyUser, { ...payload }); 82 | 83 | if (!isEmpty(response)) { 84 | yield put(messageHandlerSet({ message: i18n.t('Homepage:UserModified'), status: 'success' })); 85 | } else { 86 | yield put(messageHandlerSet({ message: i18n.t('Homepage:UserNotModified'), status: 'error' })); 87 | } 88 | } catch (err: any) { 89 | yield put( 90 | messageHandlerSet({ message: err?.message?.message ?? i18n.t('Homepage:UserNotModified'), status: 'error' }), 91 | ); 92 | } 93 | } 94 | 95 | function* deleteUserSaga({ payload }: PayloadAction) { 96 | try { 97 | const response: { status: number } = yield call(UsersAPI.deleteUser, { ...payload }); 98 | 99 | if (response.status === 204) { 100 | yield put(messageHandlerSet({ message: i18n.t('Homepage:UserDeleted'), status: 'success' })); 101 | } else { 102 | yield put(messageHandlerSet({ message: i18n.t('Homepage:UserNotDeleted'), status: 'error' })); 103 | } 104 | } catch (err: any) { 105 | yield put( 106 | messageHandlerSet({ message: err?.message?.message ?? i18n.t('Homepage:UserNotDeleted'), status: 'error' }), 107 | ); 108 | } 109 | } 110 | 111 | function* usersSaga(): Generator, void> { 112 | yield takeLatest(getUsersListRequest.type, getUsersListSaga); 113 | yield takeLatest(getUserDetailsRequest.type, getUserDetailsSaga); 114 | yield takeLatest(createUserRequest.type, createUserSaga); 115 | yield takeLatest(modifyUserRequest.type, modifyUserSaga); 116 | yield takeLatest(deleteUserRequest.type, deleteUserSaga); 117 | } 118 | 119 | export default usersSaga; 120 | -------------------------------------------------------------------------------- /src/redux/reqres/selectors.ts: -------------------------------------------------------------------------------- 1 | import type { RootState } from '@redux/reducers'; 2 | import { createSelector } from '@reduxjs/toolkit'; 3 | import { uniqBy } from 'lodash'; 4 | 5 | const usersSelector = (state: RootState) => state.users; 6 | 7 | export const allUsersLoading = createSelector(usersSelector, usersState => usersState.usersList.loading); 8 | export const allUsers = createSelector(usersSelector, usersState => uniqBy(usersState.usersList.users, 'id') || []); 9 | export const usersListCurrentPage = createSelector(usersSelector, usersState => usersState.usersList.page); 10 | export const usersListTotalResults = createSelector(usersSelector, usersState => usersState.usersList.total); 11 | export const usersListTotalPages = createSelector(usersSelector, usersState => usersState.usersList.total_pages); 12 | 13 | export const userDetailsLoading = createSelector(usersSelector, usersState => usersState.userDetails.loading); 14 | export const userDetails = createSelector(usersSelector, usersState => usersState.userDetails.details); 15 | -------------------------------------------------------------------------------- /src/redux/reqres/types.ts: -------------------------------------------------------------------------------- 1 | export type CreateUserRequestPayload = { 2 | name: string; 3 | job: string; 4 | }; 5 | 6 | export type CreateUserSuccessPayload = { 7 | name: string; 8 | job: string; 9 | id: string; 10 | createdAt: string; 11 | }; 12 | 13 | export type ModifyUserRequestPayload = { 14 | userId: string; 15 | name: string; 16 | job: string; 17 | }; 18 | 19 | export type ModifyUserSuccessPayload = { 20 | name: string; 21 | job: string; 22 | updatedAt: string; 23 | }; 24 | 25 | export type DeleteUserRequestPayload = { 26 | userId: string; 27 | }; 28 | 29 | export type UsersRequestPayload = { 30 | pageParam?: number; 31 | per_page?: number; 32 | }; 33 | 34 | export type UsersSuccessPayload = { 35 | page: number; 36 | per_page: number; 37 | total: number; 38 | total_pages: number; 39 | data?: User[] | null; 40 | support: Support; 41 | }; 42 | 43 | export type UserDetailsRequestPayload = { 44 | userId: number; 45 | }; 46 | 47 | export type UserDetailsSuccessPayload = { 48 | data: User; 49 | support: Support; 50 | }; 51 | 52 | export type User = { 53 | id: number; 54 | email: string; 55 | first_name: string; 56 | last_name: string; 57 | avatar: string; 58 | }; 59 | 60 | export type Support = { 61 | url: string; 62 | text: string; 63 | }; 64 | -------------------------------------------------------------------------------- /src/redux/rootSaga.ts: -------------------------------------------------------------------------------- 1 | import userSagas from '@redux/reqres/sagas'; 2 | import { all, AllEffect, call, ForkEffect, spawn } from 'redux-saga/effects'; 3 | 4 | function* rootSaga(): Generator>> { 5 | const sagas = [userSagas]; 6 | 7 | yield all( 8 | sagas.map(saga => 9 | spawn(function* () { 10 | while (true) { 11 | try { 12 | yield call(saga); 13 | break; 14 | } catch (e) { 15 | console.error(e); 16 | } 17 | } 18 | }), 19 | ), 20 | ); 21 | } 22 | 23 | export default rootSaga; 24 | -------------------------------------------------------------------------------- /src/redux/storage/index.ts: -------------------------------------------------------------------------------- 1 | import { MMKV } from 'react-native-mmkv'; 2 | import { Storage } from 'redux-persist'; 3 | 4 | const storage = new MMKV(); 5 | 6 | export const reduxStorage: Storage = { 7 | setItem: (key, value) => { 8 | storage.set(key, value); 9 | return Promise.resolve(true); 10 | }, 11 | getItem: key => { 12 | const value = storage.getString(key); 13 | return Promise.resolve(value); 14 | }, 15 | removeItem: key => { 16 | storage.delete(key); 17 | return Promise.resolve(); 18 | }, 19 | }; 20 | -------------------------------------------------------------------------------- /src/redux/store.ts: -------------------------------------------------------------------------------- 1 | import { persistedRootReducer } from '@redux/reducers'; 2 | import rootSaga from '@redux/rootSaga'; 3 | import { configureStore } from '@reduxjs/toolkit'; 4 | import { persistStore } from 'redux-persist'; 5 | import createSagaMiddleware from 'redux-saga'; 6 | 7 | // Setup Middlewares 8 | const sagaMiddleware = createSagaMiddleware(); 9 | const middleware = [sagaMiddleware]; 10 | 11 | // Create Store 12 | const store = configureStore({ 13 | reducer: persistedRootReducer, 14 | middleware: getDefaultMiddleware => 15 | getDefaultMiddleware({ 16 | immutableCheck: false, 17 | serializableCheck: false, 18 | }).concat(middleware), 19 | devTools: process.env.NODE_ENV !== 'production', 20 | }); 21 | 22 | // Start rootSaga 23 | sagaMiddleware.run(rootSaga); 24 | 25 | // Setup Store persistence 26 | const persistor = persistStore(store, null); 27 | 28 | export { store, persistor }; 29 | -------------------------------------------------------------------------------- /src/routes/index.tsx: -------------------------------------------------------------------------------- 1 | import { NavigatorScreenParams } from '@react-navigation/native'; 2 | import { createNativeStackNavigator } from '@react-navigation/native-stack'; 3 | import { MainStackParamList, MainStackScreen } from '@routes/stacks/MainStack'; 4 | import ModalPage from '@scenes/ModalPage'; 5 | import React from 'react'; 6 | 7 | export type RootStackParamList = { 8 | MainStack: NavigatorScreenParams; // Assuming 'MainStack' is the name of the screen in your MainStackScreen 9 | MyModal: undefined; 10 | }; 11 | 12 | const RootStack = createNativeStackNavigator(); 13 | 14 | function RootStackScreen() { 15 | return ( 16 | 17 | 24 | <>, 31 | headerBackVisible: false, 32 | }} 33 | /> 34 | 35 | ); 36 | } 37 | 38 | export default RootStackScreen; 39 | -------------------------------------------------------------------------------- /src/routes/stacks/MainStack.tsx: -------------------------------------------------------------------------------- 1 | import { createNativeStackNavigator } from '@react-navigation/native-stack'; 2 | import Homepage from '@scenes/Homepage'; 3 | import UserDetails from '@scenes/UserDetails'; 4 | import UsersList from '@scenes/UsersList'; 5 | // import customTheme from '@theme'; 6 | import { FC } from 'react'; 7 | import * as React from 'react'; 8 | 9 | export type MainStackParamList = { 10 | Home: undefined; 11 | UsersList: undefined; 12 | UserDetails: { 13 | userId: number; 14 | }; 15 | }; 16 | 17 | const MainStack = createNativeStackNavigator(); 18 | 19 | export const MainStackScreen: FC = () => { 20 | return ( 21 | 26 | 35 | 44 | 53 | 54 | ); 55 | }; 56 | -------------------------------------------------------------------------------- /src/routes/utils/index.ts: -------------------------------------------------------------------------------- 1 | import { NavigationContainerRef, ParamListBase } from '@react-navigation/native'; 2 | import { createRef } from 'react'; 3 | 4 | export const navigationRef = createRef>(); 5 | export const isMountedRef = createRef(); 6 | 7 | type NavigateProps = { 8 | (name: keyof ParamListBase, params?: ParamListBase[keyof ParamListBase]): void; 9 | }; 10 | 11 | // Use this function to navigate to specific page when you are not using a component 12 | export const navigate: NavigateProps = (name, params) => { 13 | if (isMountedRef.current && navigationRef.current) { 14 | // Perform navigation if the app has mounted 15 | navigationRef.current.navigate(name, params); 16 | } else { 17 | // You can decide what to do if the app hasn't mounted 18 | // You can ignore this, or add these actions to a queue you can call later 19 | } 20 | }; 21 | -------------------------------------------------------------------------------- /src/scenes/Homepage/index.tsx: -------------------------------------------------------------------------------- 1 | import EnvInfoView from '@components/AppVersion'; 2 | import CSafeAreaView from '@components/CSafeAreaView'; 3 | import { useNavigation } from '@react-navigation/native'; 4 | import { createUserRequest, deleteUserRequest, modifyUserRequest } from '@redux/actions'; 5 | import { palette } from '@theme/colors'; 6 | import React, { useCallback, FC, memo, useLayoutEffect } from 'react'; 7 | import { useTranslation } from 'react-i18next'; 8 | import EvilIcons from 'react-native-vector-icons/EvilIcons'; 9 | import FontAwesome5Icon from 'react-native-vector-icons/FontAwesome5'; 10 | import { useDispatch } from 'react-redux'; 11 | import { Button, ScrollView, Text, XStack, YStack } from 'tamagui'; 12 | import styles from './styles'; 13 | 14 | const Home: FC = () => { 15 | const { t, i18n } = useTranslation(); 16 | const dispatch = useDispatch(); 17 | const navigation = useNavigation(); 18 | const { setOptions } = useNavigation(); 19 | const currentLocale = i18n.language; 20 | 21 | const switchLocaleToEn = useCallback(() => { 22 | i18n.changeLanguage('en'); 23 | }, [i18n]); 24 | 25 | const switchLocaleToIt = useCallback(() => { 26 | i18n.changeLanguage('it'); 27 | }, [i18n]); 28 | 29 | const onCreateUser = useCallback(() => { 30 | dispatch(createUserRequest({ name: 'John', job: 'some-title' })); 31 | }, [dispatch]); 32 | 33 | const onModifyUser = useCallback(() => { 34 | dispatch(modifyUserRequest({ userId: '666', name: 'Jil', job: 'some-title-edited' })); 35 | }, [dispatch]); 36 | 37 | const onDeleteUser = useCallback(() => { 38 | dispatch(deleteUserRequest({ userId: '999' })); 39 | }, [dispatch]); 40 | 41 | useLayoutEffect(() => { 42 | setOptions({ 43 | headerLeft: () => <>, 44 | headerTitle: () => , 45 | }); 46 | }, [setOptions]); 47 | 48 | return ( 49 | 50 | 51 | 52 | {t('Homepage:welcome')} 53 | 54 | 55 | {t('Homepage:releasedWithLove')} 56 | 57 | 58 | 59 | 70 | 71 | 82 | 83 | 84 | 95 | 96 | 104 | 105 | 113 | 114 | 122 | 123 | 134 | 135 | 136 | 137 | 138 | ); 139 | }; 140 | 141 | export default memo(Home); 142 | -------------------------------------------------------------------------------- /src/scenes/Homepage/styles.ts: -------------------------------------------------------------------------------- 1 | import { StyleSheet } from 'react-native'; 2 | 3 | const styles = StyleSheet.create({ 4 | ContentViewContainer: { 5 | alignItems: 'center', 6 | flex: 1, 7 | flexGrow: 1, 8 | justifyContent: 'center', 9 | padding: 15, 10 | }, 11 | }); 12 | 13 | export default styles; 14 | -------------------------------------------------------------------------------- /src/scenes/ModalPage/index.tsx: -------------------------------------------------------------------------------- 1 | import { useNavigationBackAction } from '@hooks/useNavigationBack'; 2 | import { useNavigation } from '@react-navigation/native'; 3 | import React, { FC, useLayoutEffect } from 'react'; 4 | import { useTranslation } from 'react-i18next'; 5 | import { Pressable } from 'react-native'; 6 | import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons'; 7 | import { ScrollView, Stack, Text } from 'tamagui'; 8 | 9 | const ModalPage: FC = () => { 10 | const { t } = useTranslation(); 11 | const { setOptions } = useNavigation(); 12 | const goBack = useNavigationBackAction(); 13 | 14 | useLayoutEffect(() => { 15 | setOptions({ 16 | headerTitle: () => ( 17 | 18 | {t('ModalPage:PageName')} 19 | 20 | ), 21 | headerRight: () => ( 22 | 23 | 24 | 25 | 26 | 27 | ), 28 | }); 29 | }, [goBack, setOptions, t]); 30 | 31 | return ( 32 | 39 | 40 | {t('ModalPage:thisIsAModal')} 41 | 42 | 43 | ); 44 | }; 45 | 46 | export default ModalPage; 47 | -------------------------------------------------------------------------------- /src/scenes/UserDetails/index.tsx: -------------------------------------------------------------------------------- 1 | import CLoader from '@components/CLoader'; 2 | import CSafeAreaView from '@components/CSafeAreaView'; 3 | import { useNavigationBackAction } from '@hooks/useNavigationBack'; 4 | import { Route, useFocusEffect, useNavigation, useRoute } from '@react-navigation/native'; 5 | import { getUserDetailsRequest } from '@redux/actions'; 6 | import { userDetails, userDetailsLoading } from '@redux/reqres/selectors'; 7 | import { palette } from '@theme/colors'; 8 | import { FC, useCallback, useLayoutEffect } from 'react'; 9 | import * as React from 'react'; 10 | import { useTranslation } from 'react-i18next'; 11 | import { Pressable } from 'react-native'; 12 | import MaterialIcons from 'react-native-vector-icons/MaterialIcons'; 13 | import { useDispatch, useSelector } from 'react-redux'; 14 | import { Avatar, ScrollView, Text, YStack } from 'tamagui'; 15 | 16 | interface UserDetailsProps { 17 | userId: number; 18 | } 19 | 20 | const UserDetails: FC = () => { 21 | const { t } = useTranslation(); 22 | const dispatch = useDispatch(); 23 | const route = useRoute>(); 24 | const { setOptions } = useNavigation(); 25 | const goBack = useNavigationBackAction(); 26 | const userId = route?.params?.userId; 27 | const detailsLoading = useSelector(userDetailsLoading); 28 | const userDetailsData = useSelector(userDetails); 29 | 30 | useLayoutEffect(() => { 31 | setOptions({ 32 | headerLeft: () => ( 33 | 34 | 35 | 36 | ), 37 | headerTitle: () => ( 38 | 39 | {t('UserDetails:UserDetails')} 40 | 41 | ), 42 | }); 43 | }, [goBack, setOptions, t]); 44 | 45 | useFocusEffect( 46 | useCallback(() => { 47 | if (userId) { 48 | dispatch(getUserDetailsRequest({ userId })); 49 | } 50 | }, [dispatch, userId]), 51 | ); 52 | 53 | return ( 54 | 55 | {detailsLoading && } 56 | 57 | 63 | 64 | 65 | {/* */} 66 | 67 | 68 | 69 | 70 | {`${userDetailsData?.first_name} ${userDetailsData?.last_name}`} 71 | 72 | 73 | 74 | {userDetailsData?.email} 75 | 76 | 77 | 78 | 79 | ); 80 | }; 81 | 82 | export default UserDetails; 83 | -------------------------------------------------------------------------------- /src/scenes/UsersList/index.tsx: -------------------------------------------------------------------------------- 1 | import CLoader from '@components/CLoader'; 2 | import CSafeAreaView from '@components/CSafeAreaView'; 3 | import { useNavigationBackAction } from '@hooks/useNavigationBack'; 4 | import { useNavigation, useFocusEffect } from '@react-navigation/native'; 5 | import { getUsersListRequest } from '@redux/actions'; 6 | import { 7 | allUsers, 8 | allUsersLoading, 9 | usersListCurrentPage, 10 | usersListTotalPages, // usersListTotalResults, 11 | } from '@redux/reqres/selectors'; 12 | import { User } from '@redux/reqres/types'; 13 | import { palette } from '@theme/colors'; 14 | import { isEmpty, isUndefined } from 'lodash'; 15 | import * as React from 'react'; 16 | import { useCallback, FC, useLayoutEffect } from 'react'; 17 | import { useTranslation } from 'react-i18next'; 18 | import { FlatList, Pressable } from 'react-native'; 19 | import MaterialIcons from 'react-native-vector-icons/MaterialIcons'; 20 | import { useSelector, useDispatch } from 'react-redux'; 21 | import { Avatar, Text, XStack, YStack } from 'tamagui'; 22 | 23 | const UsersList: FC = () => { 24 | const { t } = useTranslation(); 25 | const dispatch = useDispatch(); 26 | const navigation = useNavigation(); 27 | const { setOptions } = useNavigation(); 28 | const goBack = useNavigationBackAction(); 29 | const onUsersListLoading = useSelector(allUsersLoading); 30 | const usersList = useSelector(allUsers); 31 | const currentPage = useSelector(usersListCurrentPage); 32 | const totalPages = useSelector(usersListTotalPages); 33 | // const totalResults = useSelector(usersListTotalResults); 34 | 35 | const onGotoUserDetails = useCallback( 36 | (userId: number) => { 37 | navigation.navigate('MainStack', { 38 | screen: 'UserDetails', 39 | params: { 40 | userId, 41 | }, 42 | }); 43 | }, 44 | [navigation], 45 | ); 46 | 47 | const renderItem = useCallback( 48 | ({ item }: { item: User }) => ( 49 | onGotoUserDetails(item?.id)}> 50 | 51 | 52 | 53 | {/* */} 54 | 55 | 56 | {`${item.first_name} ${item.last_name}`} 62 | 63 | 64 | ), 65 | [onGotoUserDetails], 66 | ); 67 | 68 | const loadMoreUsers = useCallback(() => { 69 | if (!isEmpty(usersList)) { 70 | const nextOffset = currentPage + 1; 71 | if (!isUndefined(totalPages) && currentPage < totalPages) { 72 | dispatch(getUsersListRequest({ pageParam: nextOffset, per_page: 10 })); 73 | } 74 | } 75 | }, [currentPage, dispatch, totalPages, usersList]); 76 | 77 | const onLoadUsersList = useCallback(() => { 78 | dispatch(getUsersListRequest({ pageParam: 1, per_page: 10 })); 79 | }, [dispatch]); 80 | 81 | const onRefreshLists = useCallback(() => { 82 | onLoadUsersList(); 83 | }, [onLoadUsersList]); 84 | 85 | useFocusEffect( 86 | useCallback(() => { 87 | onLoadUsersList(); 88 | }, [onLoadUsersList]), 89 | ); 90 | 91 | useLayoutEffect(() => { 92 | setOptions({ 93 | headerLeft: () => ( 94 | 95 | 96 | 97 | 98 | 99 | ), 100 | headerTitle: () => ( 101 | 102 | {t('UsersList:UsersList')} 103 | 104 | ), 105 | }); 106 | }, [goBack, setOptions, t]); 107 | 108 | return ( 109 | 110 | {/* {onUsersListLoading && } */} 111 | 112 | : null} 126 | initialNumToRender={10} 127 | windowSize={1} 128 | /> 129 | 130 | ); 131 | }; 132 | 133 | export default React.memo(UsersList); 134 | -------------------------------------------------------------------------------- /src/theme/animations.ts: -------------------------------------------------------------------------------- 1 | import { createAnimations } from '@tamagui/animations-react-native'; 2 | 3 | const animations = createAnimations({ 4 | bouncy: { 5 | type: 'spring', 6 | damping: 10, 7 | mass: 0.9, 8 | stiffness: 100, 9 | }, 10 | lazy: { 11 | type: 'spring', 12 | damping: 20, 13 | stiffness: 60, 14 | }, 15 | quick: { 16 | type: 'spring', 17 | damping: 20, 18 | mass: 1.2, 19 | stiffness: 250, 20 | }, 21 | }); 22 | 23 | export { animations }; 24 | -------------------------------------------------------------------------------- /src/theme/colors.ts: -------------------------------------------------------------------------------- 1 | import { tokens } from '@tamagui/themes'; 2 | import { createTokens } from 'tamagui'; 3 | 4 | const palette = { 5 | torquise: '#1abc9c', 6 | emerald: '#2ecc71', 7 | green_sea: '#16a085', 8 | nephritis: '#27ae60', 9 | sun_flower: '#f1c40f', 10 | orange: '#f39c12', 11 | carrot: '#e67e22', 12 | pumpkin: '#d35400', 13 | peter_river: '#3498db', 14 | belize_hole: '#2980b9', 15 | alizarin: '#e74c3c', 16 | pomegranate: '#c0392b', 17 | amethyst: '#9b59b6', 18 | wisteria: '#8e44ad', 19 | wet_asphalt: '#34495e', 20 | midnight_blue: '#2c3e50', 21 | absestos: '#7f8c8d', 22 | concrete: '#95a5a6', 23 | silver: '#bdc3c7', 24 | clouds: '#ecf0f1', 25 | white: '#fff', 26 | black: '#000', 27 | transparent: '#00000000', 28 | grey_shadow_7: 'rgba(216,216,216,0.7)', 29 | black_opacity_7: 'rgba(0,0,0,0.7)', 30 | }; 31 | 32 | const customTokens = createTokens({ 33 | ...tokens, 34 | color: { 35 | ...palette, 36 | }, 37 | }); 38 | 39 | export { customTokens, palette }; 40 | -------------------------------------------------------------------------------- /src/theme/fonts.ts: -------------------------------------------------------------------------------- 1 | import { createFont } from 'tamagui'; 2 | 3 | const genericFontSizes = { 4 | 1: 10, 5 | 2: 11, 6 | 3: 12, 7 | 4: 14, 8 | 5: 15, 9 | 6: 16, 10 | 7: 20, 11 | 8: 22, 12 | 9: 30, 13 | 10: 42, 14 | 11: 52, 15 | 12: 62, 16 | 13: 72, 17 | 14: 92, 18 | 15: 114, 19 | 16: 124, 20 | true: 16, 21 | } as const; 22 | 23 | const latoFont = createFont({ 24 | family: 'Lato, sans-serif', 25 | size: genericFontSizes, 26 | lineHeight: { 27 | 3: 17, 28 | 4: 22, 29 | 5: 25, 30 | }, 31 | weight: { 32 | 1: '100', 33 | 3: '300', 34 | 4: '400', 35 | 7: '700', 36 | 9: '900', 37 | }, 38 | letterSpacing: { 39 | 5: 2, 40 | 6: 1, 41 | 7: 5, 42 | 8: -1, 43 | 9: -2, 44 | 10: -3, 45 | 12: -4, 46 | 14: -5, 47 | 15: -6, 48 | }, 49 | // these will be used when run in native mode 50 | face: { 51 | 100: { normal: 'Lato-Thin', italic: 'Lato-ThinItalic' }, 52 | 300: { normal: 'Lato-Light', italic: 'Lato-LightItalic' }, 53 | 400: { normal: 'Lato-Regular', italic: 'Lato-Italic' }, 54 | 700: { normal: 'Lato-Bold', italic: 'Lato-BoldItalic' }, 55 | 900: { normal: 'Lato-Black', italic: 'Lato-BlackItalic' }, 56 | }, 57 | }); 58 | 59 | export { genericFontSizes, latoFont }; 60 | -------------------------------------------------------------------------------- /src/theme/global.ts: -------------------------------------------------------------------------------- 1 | import { AppConfig } from './tamagui.config'; 2 | 3 | declare module 'tamagui' { 4 | // overrides TamaguiCustomConfig so your custom types 5 | // work everywhere you import `tamagui` 6 | type TamaguiCustomConfig = AppConfig; 7 | } 8 | 9 | export * from 'tamagui'; 10 | -------------------------------------------------------------------------------- /src/theme/index.ts: -------------------------------------------------------------------------------- 1 | import appConfig from './tamagui.config'; 2 | 3 | export default appConfig; 4 | -------------------------------------------------------------------------------- /src/theme/margin.ts: -------------------------------------------------------------------------------- 1 | import { StyleSheet } from 'react-native'; 2 | 3 | const globalMarginStyles = StyleSheet.create({ 4 | marginBottom10: { 5 | marginBottom: 10, 6 | }, 7 | marginBottom20: { 8 | marginBottom: 20, 9 | }, 10 | marginBottom25: { 11 | marginBottom: 25, 12 | }, 13 | marginBottom30: { 14 | marginBottom: 30, 15 | }, 16 | marginBottom40: { 17 | marginBottom: 40, 18 | }, 19 | marginTop10: { 20 | marginTop: 10, 21 | }, 22 | marginTop15: { 23 | marginTop: 15, 24 | }, 25 | marginTop20: { 26 | marginTop: 20, 27 | }, 28 | marginTop25: { 29 | marginTop: 25, 30 | }, 31 | marginTop40: { 32 | marginTop: 40, 33 | }, 34 | marginTop45: { 35 | marginTop: 45, 36 | }, 37 | marginTop50: { 38 | marginTop: 50, 39 | }, 40 | marginRight20: { 41 | marginRight: 20, 42 | }, 43 | marginHorizontal10: { 44 | marginHorizontal: 10, 45 | }, 46 | marginHorizontal24: { 47 | marginHorizontal: 24, 48 | }, 49 | }); 50 | 51 | export default globalMarginStyles; 52 | -------------------------------------------------------------------------------- /src/theme/padding.ts: -------------------------------------------------------------------------------- 1 | import { StyleSheet } from 'react-native'; 2 | 3 | const globalPaddingStyles = StyleSheet.create({ 4 | padding60: { 5 | padding: 60, 6 | }, 7 | paddingVertical30: { 8 | paddingVertical: 30, 9 | }, 10 | paddingVertical60: { 11 | paddingVertical: 60, 12 | }, 13 | paddingHorizontal10: { 14 | paddingHorizontal: 10, 15 | }, 16 | paddingHorizontal50: { 17 | paddingHorizontal: 50, 18 | }, 19 | }); 20 | 21 | export default globalPaddingStyles; 22 | -------------------------------------------------------------------------------- /src/theme/tamagui.config.ts: -------------------------------------------------------------------------------- 1 | import { shorthands } from '@tamagui/shorthands'; 2 | import { themes } from '@tamagui/themes'; 3 | import { createTamagui } from 'tamagui'; 4 | import { animations } from './animations'; 5 | import { customTokens } from './colors'; 6 | import { latoFont } from './fonts'; 7 | 8 | const config = createTamagui({ 9 | animations, 10 | defaultTheme: 'dark', 11 | shouldAddPrefersColorThemes: false, 12 | themeClassNameOnRoot: false, 13 | fonts: { 14 | heading: latoFont, 15 | body: latoFont, 16 | }, 17 | shorthands, 18 | themes, 19 | tokens: customTokens, 20 | }); 21 | 22 | export type AppConfig = typeof config; 23 | 24 | export default config; 25 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@tsconfig/react-native/tsconfig.json", 3 | "compilerOptions": { 4 | "jsx": "react", 5 | "allowJs": true, /* Allow javascript files to be compiled. */ 6 | // "checkJs": true, /* Report errors in .js files. */ 7 | "declaration": true, /* Generates corresponding '.d.ts' file. */ 8 | // "sourceMap": true, /* Generates corresponding '.map' file. */ 9 | // "outFile": "./", /* Concatenate and emit output to single file. */ 10 | // "outDir": "./", /* Redirect output structure to the directory. */ 11 | // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ 12 | // "removeComments": true, /* Do not emit comments to output. */ 13 | "noEmit": true, /* Do not emit outputs. */ 14 | // "incremental": true, /* Enable incremental compilation */ 15 | // "importHelpers": true, /* Import emit helpers from 'tslib'. */ 16 | // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ 17 | "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ 18 | 19 | /* Strict Type-Checking Options */ 20 | "strict": true, /* Enable all strict type-checking options. */ 21 | // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ 22 | // "strictNullChecks": true, /* Enable strict null checks. */ 23 | // "strictFunctionTypes": true, /* Enable strict checking of function types. */ 24 | // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ 25 | // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ 26 | // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ 27 | 28 | /* Additional Checks */ 29 | "noUnusedLocals": true, /* Report errors on unused locals. */ 30 | "noUnusedParameters": true, /* Report errors on unused parameters. */ 31 | "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ 32 | "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ 33 | 34 | /* Module Resolution Options */ 35 | "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ 36 | // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ 37 | // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ 38 | // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ 39 | // "typeRoots": [], /* List of folders to include type definitions from. */ 40 | // "types": [], /* Type declaration files to be included in compilation. */ 41 | "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ 42 | "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ 43 | // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ 44 | "skipLibCheck": true, /* Skip type checking of declaration files. */ 45 | "resolveJsonModule": true, /* Allows importing modules with a ‘.json’ extension, which is a common practice in node projects. */ 46 | 47 | /* Source Map Options */ 48 | // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ 49 | // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */ 50 | // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ 51 | // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ 52 | 53 | "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ 54 | "paths": { /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ 55 | "@*": ["src/*"], 56 | "@api/*": [ 57 | "src/api/*" 58 | ], 59 | "@assets/*": [ 60 | "src/assets/*" 61 | ], 62 | "@components/*": [ 63 | "src/components/*" 64 | ], 65 | "@constants/*": [ 66 | "src/constants/*" 67 | ], 68 | "@hooks/*": [ 69 | "src/hooks/*" 70 | ], 71 | "@i18n/*": [ 72 | "src/i18n/*" 73 | ], 74 | "@mmkv/*": ["src/mmkv/*"], 75 | "@redux/*": [ 76 | "src/redux/*" 77 | ], 78 | "@routes/*": [ 79 | "src/routes/*" 80 | ], 81 | "@scenes/*": [ 82 | "src/scenes/*" 83 | ], 84 | "@services/*": [ 85 | "src/services/*" 86 | ], 87 | "@theme/*": [ 88 | "src/theme/*" 89 | ], 90 | "@utils/*": [ 91 | "src/utils/*" 92 | ], 93 | "@env": [ 94 | "src/env.js" 95 | ] 96 | } 97 | }, 98 | "exclude": [ 99 | "node_modules", 100 | "babel.config.js", 101 | "metro.config.js", 102 | "jest.config.js" 103 | ] 104 | } 105 | --------------------------------------------------------------------------------