├── .watchmanconfig ├── web ├── robot.txt ├── index.web.tsx ├── index.html ├── webpack.loaders.js └── webpack.config.js ├── .eslintignore ├── app.json ├── src ├── utils │ ├── debuggers │ │ ├── flipper.web.ts │ │ ├── reactotron.web.ts │ │ ├── flipper.ts │ │ └── reactotron.ts │ └── async.ts ├── store │ ├── user │ │ ├── types.ts │ │ ├── users.json │ │ └── index.ts │ ├── useSelectors.ts │ ├── types.ts │ ├── reducers.ts │ ├── index.ts │ ├── index.web.ts │ └── middlewares.ts ├── routes │ ├── types.ts │ ├── stacks │ │ └── Home.tsx │ ├── linking.ts │ ├── Router.tsx │ └── BottomTabs.tsx ├── types │ └── common.d.ts ├── i18n │ ├── hooks.ts │ ├── en │ │ └── translation.json │ ├── vi │ │ └── translation.json │ └── index.ts ├── styles │ ├── theme │ │ ├── colors.ts │ │ └── index.ts │ └── types.ts ├── screens │ ├── Home.test.tsx │ ├── Settings.test.tsx │ ├── Home.tsx │ └── Settings.tsx ├── services │ └── Navigation.ts ├── Root.tsx └── contexts │ └── ThemeContext.tsx ├── public └── assets │ ├── icon.png │ ├── logo.png │ ├── bootsplash_logo.png │ ├── bootsplash_logo@2x.png │ ├── bootsplash_logo@3x.png │ ├── bootsplash_logo@4x.png │ └── bootsplash_logo@1,5x.png ├── android ├── app │ ├── debug.keystore │ ├── src │ │ ├── main │ │ │ ├── res │ │ │ │ ├── values │ │ │ │ │ ├── strings.xml │ │ │ │ │ ├── colors.xml │ │ │ │ │ └── styles.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── bootsplash_logo.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-ldpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── bootsplash_logo.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── bootsplash_logo.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── bootsplash_logo.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ └── mipmap-xxxhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── bootsplash_logo.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ ├── assets │ │ │ │ └── fonts │ │ │ │ │ ├── Entypo.ttf │ │ │ │ │ ├── Feather.ttf │ │ │ │ │ ├── Fontisto.ttf │ │ │ │ │ ├── Ionicons.ttf │ │ │ │ │ ├── Octicons.ttf │ │ │ │ │ ├── Zocial.ttf │ │ │ │ │ ├── AntDesign.ttf │ │ │ │ │ ├── EvilIcons.ttf │ │ │ │ │ ├── Foundation.ttf │ │ │ │ │ ├── FontAwesome.ttf │ │ │ │ │ ├── MaterialIcons.ttf │ │ │ │ │ ├── SimpleLineIcons.ttf │ │ │ │ │ ├── FontAwesome5_Solid.ttf │ │ │ │ │ ├── FontAwesome5_Brands.ttf │ │ │ │ │ ├── FontAwesome5_Regular.ttf │ │ │ │ │ └── MaterialCommunityIcons.ttf │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── rnstarter │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ └── MainApplication.java │ │ │ └── AndroidManifest.xml │ │ └── debug │ │ │ ├── res │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-ldpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ └── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ └── com │ │ │ └── typescriptreactnativestarter │ │ │ └── ReactNativeFlipper.java │ ├── proguard-rules.pro │ ├── build_defs.bzl │ ├── BUCK │ └── build.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── settings.gradle ├── build.gradle ├── gradle.properties ├── gradlew.bat └── gradlew ├── ios ├── rnStarter │ ├── Images.xcassets │ │ ├── Contents.json │ │ ├── AppIcon.appiconset │ │ │ ├── ipad-20x20-1x.png │ │ │ ├── ipad-20x20-2x.png │ │ │ ├── ipad-29x29-1x.png │ │ │ ├── ipad-29x29-2x.png │ │ │ ├── ipad-40x40-1x.png │ │ │ ├── ipad-40x40-2x.png │ │ │ ├── ipad-50x50-1x.png │ │ │ ├── ipad-50x50-2x.png │ │ │ ├── ipad-72x72-1x.png │ │ │ ├── ipad-72x72-2x.png │ │ │ ├── ipad-76x76-1x.png │ │ │ ├── ipad-76x76-2x.png │ │ │ ├── iphone-20x20-2x.png │ │ │ ├── iphone-20x20-3x.png │ │ │ ├── iphone-29x29-1x.png │ │ │ ├── iphone-29x29-2x.png │ │ │ ├── iphone-29x29-3x.png │ │ │ ├── iphone-40x40-2x.png │ │ │ ├── iphone-40x40-3x.png │ │ │ ├── iphone-57x57-1x.png │ │ │ ├── iphone-57x57-2x.png │ │ │ ├── iphone-60x60-2x.png │ │ │ ├── iphone-60x60-3x.png │ │ │ ├── ipad-83.5x83.5-2x.png │ │ │ ├── ios-marketing-1024x1024-1x.png │ │ │ └── Contents.json │ │ └── BootSplashLogo.imageset │ │ │ ├── bootsplash_logo.png │ │ │ ├── bootsplash_logo@2x.png │ │ │ ├── bootsplash_logo@3x.png │ │ │ └── Contents.json │ ├── AppDelegate.h │ ├── main.m │ ├── ExportOptions.plist │ ├── AppDelegate.m │ ├── Info.plist │ ├── BootSplash.storyboard │ └── LaunchScreen.storyboard ├── rnStarter.xcodeproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ ├── rnStarter.xcscheme │ │ └── rnStarter-tvOS.xcscheme ├── rnStarter.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── rnStarterTests │ ├── Info.plist │ └── rnStarterTests.m ├── Podfile └── Podfile.lock ├── scripts ├── electron_release.sh └── preelectron.sh ├── .buckconfig ├── .gitattributes ├── netlify.toml ├── .prettierrc.js ├── index.js ├── metro.config.js ├── jest.config.js ├── tsconfig.json ├── babel.config.js ├── jest.setup.js ├── LICENSE ├── .gitignore ├── .eslintrc.js ├── __mocks__ └── react-i18next.js ├── index.electron.js ├── README.md ├── i18next-parser.config.js └── package.json /.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /web/robot.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | coverage 3 | __mocks__ -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rnStarter", 3 | "displayName": "rnStarter" 4 | } -------------------------------------------------------------------------------- /src/utils/debuggers/flipper.web.ts: -------------------------------------------------------------------------------- 1 | /** Do not use Flipper for web */ 2 | export {} -------------------------------------------------------------------------------- /src/store/user/types.ts: -------------------------------------------------------------------------------- 1 | export type UserState = { 2 | id: number; 3 | name: string; 4 | } -------------------------------------------------------------------------------- /public/assets/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/public/assets/icon.png -------------------------------------------------------------------------------- /public/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/public/assets/logo.png -------------------------------------------------------------------------------- /src/routes/types.ts: -------------------------------------------------------------------------------- 1 | export type AppTabParamList = { 2 | Home: undefined; 3 | Settings: { userID?: string; }; 4 | }; 5 | -------------------------------------------------------------------------------- /android/app/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/debug.keystore -------------------------------------------------------------------------------- /android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | rnStarter 3 | 4 | -------------------------------------------------------------------------------- /ios/rnStarter/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /scripts/electron_release.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | electron-packager .dist --all --asar --icon=/tmp/app --overwrite --out=electron -------------------------------------------------------------------------------- /src/utils/async.ts: -------------------------------------------------------------------------------- 1 | export const sleep = (ms: number) => { 2 | return new Promise((resolve) => setTimeout(resolve, ms)); 3 | }; 4 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | #FFFFFF 3 | 4 | -------------------------------------------------------------------------------- /src/utils/debuggers/reactotron.web.ts: -------------------------------------------------------------------------------- 1 | import Reactotron from 'reactotron-react-js' 2 | 3 | Reactotron 4 | .configure() 5 | .connect() -------------------------------------------------------------------------------- /public/assets/bootsplash_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/public/assets/bootsplash_logo.png -------------------------------------------------------------------------------- /public/assets/bootsplash_logo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/public/assets/bootsplash_logo@2x.png -------------------------------------------------------------------------------- /public/assets/bootsplash_logo@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/public/assets/bootsplash_logo@3x.png -------------------------------------------------------------------------------- /public/assets/bootsplash_logo@4x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/public/assets/bootsplash_logo@4x.png -------------------------------------------------------------------------------- /.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Windows files should use crlf line endings 2 | # https://help.github.com/articles/dealing-with-line-endings/ 3 | *.bat text eol=crlf 4 | -------------------------------------------------------------------------------- /public/assets/bootsplash_logo@1,5x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/public/assets/bootsplash_logo@1,5x.png -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /netlify.toml: -------------------------------------------------------------------------------- 1 | [build] 2 | command = "yarn web:build" 3 | publish = ".dist" 4 | environment = { NODE_VERSION = "v14.15.0", YARN_VERSION = "1.22.4" } 5 | -------------------------------------------------------------------------------- /src/store/user/users.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": 1, 4 | "name": "Turbo" 5 | }, 6 | { 7 | "id": 2, 8 | "name": "John" 9 | } 10 | ] -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Entypo.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/src/main/assets/fonts/Entypo.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Feather.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/src/main/assets/fonts/Feather.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Fontisto.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/src/main/assets/fonts/Fontisto.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Ionicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/src/main/assets/fonts/Ionicons.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Octicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/src/main/assets/fonts/Octicons.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Zocial.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/src/main/assets/fonts/Zocial.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/AntDesign.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/src/main/assets/fonts/AntDesign.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/EvilIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/src/main/assets/fonts/EvilIcons.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Foundation.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/src/main/assets/fonts/Foundation.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/FontAwesome.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/src/main/assets/fonts/FontAwesome.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/MaterialIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/src/main/assets/fonts/MaterialIcons.ttf -------------------------------------------------------------------------------- /src/types/common.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'redux-persist/lib/*'; 2 | declare module 'reactotron-react-native/dist/flipper'; 3 | declare module 'i18next-react-native-async-storage'; -------------------------------------------------------------------------------- /android/app/src/debug/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/src/debug/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/debug/res/mipmap-ldpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/src/debug/res/mipmap-ldpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/debug/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/src/debug/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/SimpleLineIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/src/main/assets/fonts/SimpleLineIcons.ttf -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-ldpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/src/main/res/mipmap-ldpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/debug/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/src/debug/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/debug/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/src/debug/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/debug/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/src/debug/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/FontAwesome5_Solid.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/src/main/assets/fonts/FontAwesome5_Solid.ttf -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/bootsplash_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/src/main/res/mipmap-hdpi/bootsplash_logo.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/bootsplash_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/src/main/res/mipmap-mdpi/bootsplash_logo.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/FontAwesome5_Brands.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/src/main/assets/fonts/FontAwesome5_Brands.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/FontAwesome5_Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/src/main/assets/fonts/FontAwesome5_Regular.ttf -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-ldpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/src/main/res/mipmap-ldpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/bootsplash_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/src/main/res/mipmap-xhdpi/bootsplash_logo.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/bootsplash_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/src/main/res/mipmap-xxhdpi/bootsplash_logo.png -------------------------------------------------------------------------------- /android/app/src/debug/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/src/debug/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/debug/res/mipmap-ldpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/src/debug/res/mipmap-ldpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/debug/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/src/debug/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/debug/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/src/debug/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/debug/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/src/debug/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/bootsplash_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/src/main/res/mipmap-xxxhdpi/bootsplash_logo.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /scripts/preelectron.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | PUBLIC_URL=. npm run web:build || exit $? 4 | cp index.electron.js .dist/index.js || exit $? 5 | echo {} > .dist/package.json || exit $? -------------------------------------------------------------------------------- /android/app/src/debug/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/android/app/src/debug/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /ios/rnStarter/Images.xcassets/AppIcon.appiconset/ipad-20x20-1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/ios/rnStarter/Images.xcassets/AppIcon.appiconset/ipad-20x20-1x.png -------------------------------------------------------------------------------- /ios/rnStarter/Images.xcassets/AppIcon.appiconset/ipad-20x20-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/ios/rnStarter/Images.xcassets/AppIcon.appiconset/ipad-20x20-2x.png -------------------------------------------------------------------------------- /ios/rnStarter/Images.xcassets/AppIcon.appiconset/ipad-29x29-1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/ios/rnStarter/Images.xcassets/AppIcon.appiconset/ipad-29x29-1x.png -------------------------------------------------------------------------------- /ios/rnStarter/Images.xcassets/AppIcon.appiconset/ipad-29x29-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/ios/rnStarter/Images.xcassets/AppIcon.appiconset/ipad-29x29-2x.png -------------------------------------------------------------------------------- /ios/rnStarter/Images.xcassets/AppIcon.appiconset/ipad-40x40-1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/ios/rnStarter/Images.xcassets/AppIcon.appiconset/ipad-40x40-1x.png -------------------------------------------------------------------------------- /ios/rnStarter/Images.xcassets/AppIcon.appiconset/ipad-40x40-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/ios/rnStarter/Images.xcassets/AppIcon.appiconset/ipad-40x40-2x.png -------------------------------------------------------------------------------- /ios/rnStarter/Images.xcassets/AppIcon.appiconset/ipad-50x50-1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/ios/rnStarter/Images.xcassets/AppIcon.appiconset/ipad-50x50-1x.png -------------------------------------------------------------------------------- /ios/rnStarter/Images.xcassets/AppIcon.appiconset/ipad-50x50-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/ios/rnStarter/Images.xcassets/AppIcon.appiconset/ipad-50x50-2x.png -------------------------------------------------------------------------------- /ios/rnStarter/Images.xcassets/AppIcon.appiconset/ipad-72x72-1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/ios/rnStarter/Images.xcassets/AppIcon.appiconset/ipad-72x72-1x.png -------------------------------------------------------------------------------- /ios/rnStarter/Images.xcassets/AppIcon.appiconset/ipad-72x72-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/ios/rnStarter/Images.xcassets/AppIcon.appiconset/ipad-72x72-2x.png -------------------------------------------------------------------------------- /ios/rnStarter/Images.xcassets/AppIcon.appiconset/ipad-76x76-1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/ios/rnStarter/Images.xcassets/AppIcon.appiconset/ipad-76x76-1x.png -------------------------------------------------------------------------------- /ios/rnStarter/Images.xcassets/AppIcon.appiconset/ipad-76x76-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/ios/rnStarter/Images.xcassets/AppIcon.appiconset/ipad-76x76-2x.png -------------------------------------------------------------------------------- /ios/rnStarter/Images.xcassets/AppIcon.appiconset/iphone-20x20-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/ios/rnStarter/Images.xcassets/AppIcon.appiconset/iphone-20x20-2x.png -------------------------------------------------------------------------------- /ios/rnStarter/Images.xcassets/AppIcon.appiconset/iphone-20x20-3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/ios/rnStarter/Images.xcassets/AppIcon.appiconset/iphone-20x20-3x.png -------------------------------------------------------------------------------- /ios/rnStarter/Images.xcassets/AppIcon.appiconset/iphone-29x29-1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/ios/rnStarter/Images.xcassets/AppIcon.appiconset/iphone-29x29-1x.png -------------------------------------------------------------------------------- /ios/rnStarter/Images.xcassets/AppIcon.appiconset/iphone-29x29-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/ios/rnStarter/Images.xcassets/AppIcon.appiconset/iphone-29x29-2x.png -------------------------------------------------------------------------------- /ios/rnStarter/Images.xcassets/AppIcon.appiconset/iphone-29x29-3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/ios/rnStarter/Images.xcassets/AppIcon.appiconset/iphone-29x29-3x.png -------------------------------------------------------------------------------- /ios/rnStarter/Images.xcassets/AppIcon.appiconset/iphone-40x40-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/ios/rnStarter/Images.xcassets/AppIcon.appiconset/iphone-40x40-2x.png -------------------------------------------------------------------------------- /ios/rnStarter/Images.xcassets/AppIcon.appiconset/iphone-40x40-3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/ios/rnStarter/Images.xcassets/AppIcon.appiconset/iphone-40x40-3x.png -------------------------------------------------------------------------------- /ios/rnStarter/Images.xcassets/AppIcon.appiconset/iphone-57x57-1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/ios/rnStarter/Images.xcassets/AppIcon.appiconset/iphone-57x57-1x.png -------------------------------------------------------------------------------- /ios/rnStarter/Images.xcassets/AppIcon.appiconset/iphone-57x57-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/ios/rnStarter/Images.xcassets/AppIcon.appiconset/iphone-57x57-2x.png -------------------------------------------------------------------------------- /ios/rnStarter/Images.xcassets/AppIcon.appiconset/iphone-60x60-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/ios/rnStarter/Images.xcassets/AppIcon.appiconset/iphone-60x60-2x.png -------------------------------------------------------------------------------- /ios/rnStarter/Images.xcassets/AppIcon.appiconset/iphone-60x60-3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/ios/rnStarter/Images.xcassets/AppIcon.appiconset/iphone-60x60-3x.png -------------------------------------------------------------------------------- /ios/rnStarter/Images.xcassets/AppIcon.appiconset/ipad-83.5x83.5-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/ios/rnStarter/Images.xcassets/AppIcon.appiconset/ipad-83.5x83.5-2x.png -------------------------------------------------------------------------------- /src/store/useSelectors.ts: -------------------------------------------------------------------------------- 1 | import { createSelectorHook } from 'react-redux'; 2 | import { RootAction, RootState } from 'src/store/types'; 3 | 4 | export const useStore = createSelectorHook(); 5 | -------------------------------------------------------------------------------- /ios/rnStarter/Images.xcassets/BootSplashLogo.imageset/bootsplash_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/ios/rnStarter/Images.xcassets/BootSplashLogo.imageset/bootsplash_logo.png -------------------------------------------------------------------------------- /ios/rnStarter/Images.xcassets/BootSplashLogo.imageset/bootsplash_logo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/ios/rnStarter/Images.xcassets/BootSplashLogo.imageset/bootsplash_logo@2x.png -------------------------------------------------------------------------------- /ios/rnStarter/Images.xcassets/BootSplashLogo.imageset/bootsplash_logo@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/ios/rnStarter/Images.xcassets/BootSplashLogo.imageset/bootsplash_logo@3x.png -------------------------------------------------------------------------------- /ios/rnStarter.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/rnStarter/Images.xcassets/AppIcon.appiconset/ios-marketing-1024x1024-1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t18n/react-native-cross-platform-starter/HEAD/ios/rnStarter/Images.xcassets/AppIcon.appiconset/ios-marketing-1024x1024-1x.png -------------------------------------------------------------------------------- /src/utils/debuggers/flipper.ts: -------------------------------------------------------------------------------- 1 | import AsyncStorage from '@react-native-community/async-storage'; 2 | import RNAsyncStorageFlipper from 'rn-async-storage-flipper'; 3 | 4 | if (__DEV__) { 5 | RNAsyncStorageFlipper(AsyncStorage); 6 | } -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | jsxBracketSameLine: true, 3 | singleQuote: true, 4 | trailingComma: 'all', 5 | printWidth: 100, 6 | tabWidth: 2, 7 | useTabs: false, 8 | bracketSpacing: true, 9 | semi: true, 10 | }; 11 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | import 'react-native-gesture-handler'; 2 | import { AppRegistry } from 'react-native'; 3 | import { Root } from './src/Root'; 4 | import { name as appName } from './app.json'; 5 | 6 | AppRegistry.registerComponent(appName, () => Root); 7 | -------------------------------------------------------------------------------- /ios/rnStarter/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : UIResponder 5 | 6 | @property (nonatomic, strong) UIWindow *window; 7 | 8 | @end 9 | -------------------------------------------------------------------------------- /metro.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | transformer: { 3 | getTransformOptions: async () => ({ 4 | transform: { 5 | experimentalImportSupport: false, 6 | inlineRequires: true, 7 | }, 8 | }), 9 | }, 10 | }; 11 | -------------------------------------------------------------------------------- /ios/rnStarter/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char * argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/store/types.ts: -------------------------------------------------------------------------------- 1 | import { store } from '.'; 2 | import { rootReducer } from './reducers'; 3 | 4 | export type RootState = ReturnType 5 | export type RootAction = ReturnType 6 | export type AppDispatch = typeof store.dispatch; 7 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Dec 14 14:54:57 CET 2020 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip 7 | -------------------------------------------------------------------------------- /ios/rnStarter.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ios/rnStarter.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/rnStarter.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'rnStarter' 2 | include ':react-native-vector-icons' 3 | project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android') 4 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) 5 | include ':app' 6 | -------------------------------------------------------------------------------- /src/routes/stacks/Home.tsx: -------------------------------------------------------------------------------- 1 | import { createStackNavigator } from "@react-navigation/stack"; 2 | 3 | import React from 'react'; 4 | import { Home } from 'src/screens/Home'; 5 | 6 | export const HomeStack = () => { 7 | const Stack = createStackNavigator(); 8 | 9 | return ( 10 | 11 | 12 | 13 | ); 14 | }; -------------------------------------------------------------------------------- /web/index.web.tsx: -------------------------------------------------------------------------------- 1 | import { name as appName } from '../app.json'; 2 | import React from 'react'; 3 | import { AppRegistry, View } from 'react-native'; 4 | import { Root } from 'src/Root'; 5 | 6 | const App = () => ( 7 | 8 | 9 | 10 | ); 11 | 12 | AppRegistry.registerComponent(appName, () => App); 13 | 14 | AppRegistry.runApplication(appName, { 15 | rootTag: document.getElementById('root'), 16 | }); 17 | -------------------------------------------------------------------------------- /src/i18n/hooks.ts: -------------------------------------------------------------------------------- 1 | import { useTranslation } from 'react-i18next'; 2 | 3 | export const useI18n = () => { 4 | const { t, i18n } = useTranslation(); 5 | 6 | const changeLanguage = (languageId: string) => i18n.changeLanguage(languageId, (err: any, t: any) => { 7 | if (err) return console.log('Cannot change language', err); 8 | t('Language ready'); // -> same as i18next.t 9 | }) 10 | 11 | return { 12 | changeLanguage, 13 | i18n, 14 | t 15 | } 16 | } -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /src/styles/theme/colors.ts: -------------------------------------------------------------------------------- 1 | import { ThemePalette } from '../types'; 2 | 3 | export const lightPallette: ThemePalette = { 4 | paletteName: 'light', 5 | palette: { 6 | background: '#f7f7f8', 7 | onBackground: '#000014', 8 | onBackgroundTint: '#3a3a44', 9 | } 10 | }; 11 | 12 | export const darkPallette: ThemePalette = { 13 | paletteName: 'dark', 14 | palette: { 15 | background: '#000014', 16 | onBackground: '#efeff1', 17 | onBackgroundTint: '#7f7f8b', 18 | } 19 | }; 20 | -------------------------------------------------------------------------------- /src/i18n/en/translation.json: -------------------------------------------------------------------------------- 1 | { 2 | "Dark": "Dark", 3 | "english": "English", 4 | "home": "Home", 5 | "Home": "Home", 6 | "home.text.platform.android": "You are using Android app", 7 | "home.text.platform.ios": "You are using iOS app", 8 | "home.text.platform.web": "You are using Web app", 9 | "Language ready": "Language ready", 10 | "Language translation is ready!": "Language translation is ready", 11 | "Light": "Light", 12 | "settings": "Settings", 13 | "vietnamese": "Vietnamese" 14 | } 15 | -------------------------------------------------------------------------------- /src/styles/theme/index.ts: -------------------------------------------------------------------------------- 1 | import { darkPallette, lightPallette } from './colors'; 2 | 3 | const grid = 4; 4 | 5 | export const theme = { 6 | ...lightPallette, 7 | 8 | grid, 9 | 10 | space: { 11 | 's': grid * 2, 12 | 'm': grid * 5, 13 | 'l': grid * 8, 14 | }, 15 | 16 | borderRadius: { 17 | 's': grid, 18 | 'm': grid * 2, 19 | 'l': grid * 10 20 | }, 21 | }; 22 | 23 | export const lightTheme = theme; 24 | 25 | export const darkTheme = { 26 | ...theme, 27 | ...darkPallette 28 | } -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | RN Cross-platform Starter 4 | 5 | 6 | 10 | 11 | 12 | 13 | 16 |
17 | 18 | 19 | -------------------------------------------------------------------------------- /src/i18n/vi/translation.json: -------------------------------------------------------------------------------- 1 | { 2 | "Dark": "Tối", 3 | "english": "Tiếng Anh", 4 | "home": "Trang chủ", 5 | "Home": "Home", 6 | "home.text.platform.android": "Bạn đang sử dụng Android App", 7 | "home.text.platform.ios": "Bạn đang sử dụng iOS App", 8 | "home.text.platform.web": "Bạn đang sử dụng Web App", 9 | "Language ready": "Ngôn ngữ sẵn sáng", 10 | "Language translation is ready!": "Ngôn ngữ của bạn đã sẵn sáng", 11 | "Light": "Sáng", 12 | "settings": "Cài đặt", 13 | "vietnamese": "Tiếng Việt" 14 | } 15 | -------------------------------------------------------------------------------- /ios/rnStarter/Images.xcassets/BootSplashLogo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "idiom": "universal", 5 | "filename": "bootsplash_logo.png", 6 | "scale": "1x" 7 | }, 8 | { 9 | "idiom": "universal", 10 | "filename": "bootsplash_logo@2x.png", 11 | "scale": "2x" 12 | }, 13 | { 14 | "idiom": "universal", 15 | "filename": "bootsplash_logo@3x.png", 16 | "scale": "3x" 17 | } 18 | ], 19 | "info": { 20 | "version": 1, 21 | "author": "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/store/reducers.ts: -------------------------------------------------------------------------------- 1 | import { combineReducers } from 'redux'; 2 | import { userReducers } from './user'; 3 | import AsyncStorage from '@react-native-community/async-storage'; 4 | import { persistReducer } from 'redux-persist'; 5 | 6 | export const rootReducer = combineReducers({ 7 | user: userReducers, 8 | }); 9 | 10 | export const persistConfig = { 11 | key: 'root', 12 | storage: AsyncStorage, 13 | whitelist: ['user', 'auth'], 14 | blacklist: [], 15 | }; 16 | 17 | export const persistedReducer = persistReducer(persistConfig, rootReducer) 18 | -------------------------------------------------------------------------------- /src/screens/Home.test.tsx: -------------------------------------------------------------------------------- 1 | import { render } from '@testing-library/react-native'; 2 | import React from 'react'; 3 | import 'react-native'; 4 | import { Provider } from 'react-redux'; 5 | import { Home } from 'src/screens/Home'; 6 | import { store } from 'src/store'; 7 | 8 | describe('Home', () => { 9 | const pageTree = ( 10 | 11 | 12 | 13 | ); 14 | 15 | it('Should match snapshot', () => { 16 | const page = render(pageTree); 17 | expect(page.toJSON()).toMatchSnapshot(); 18 | }); 19 | }); 20 | -------------------------------------------------------------------------------- /ios/rnStarter/ExportOptions.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | compileBitcode 6 | 7 | method 8 | ad-hoc 9 | signingStyle 10 | automatic 11 | stripSwiftSymbols 12 | 13 | teamID 14 | 6D8S32J5J2 15 | thinning 16 | <none> 17 | 18 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/screens/Settings.test.tsx: -------------------------------------------------------------------------------- 1 | import { render } from '@testing-library/react-native'; 2 | import React from 'react'; 3 | import { Provider } from 'react-redux'; 4 | import { Settings } from 'src/screens/Settings'; 5 | import { store } from 'src/store'; 6 | 7 | describe('Settings', () => { 8 | jest.useFakeTimers(); 9 | const pageTree = ( 10 | 11 | 12 | 13 | ); 14 | 15 | it('Should match snapshot', () => { 16 | const page = render(pageTree); 17 | expect(page.toJSON()).toMatchSnapshot(); 18 | }); 19 | }); 20 | -------------------------------------------------------------------------------- /src/routes/linking.ts: -------------------------------------------------------------------------------- 1 | /** Link prefixes/domains for deep linking */ 2 | const linkingPrefixes = [ 3 | 'https://rnStarter.app', 4 | 'rnStarter://', 5 | ]; 6 | 7 | // FIXME: Better type 8 | export const linking = { 9 | prefixes: linkingPrefixes, 10 | config: { 11 | screens: { 12 | HomeStack: { 13 | path: "home", 14 | initialRouteName: "Home", 15 | screens: { 16 | Home: "/", 17 | Profile: { 18 | path: "user/:id", 19 | }, 20 | }, 21 | }, 22 | Settings: "settings", 23 | }, 24 | }, 25 | }; 26 | -------------------------------------------------------------------------------- /src/store/index.ts: -------------------------------------------------------------------------------- 1 | import { persistStore } from 'redux-persist'; 2 | import { middleware } from './middlewares'; 3 | import { persistedReducer } from './reducers'; 4 | import { configureStore } from '@reduxjs/toolkit'; 5 | 6 | /** 7 | * Add Redux flipper 8 | */ 9 | if (__DEV__) { 10 | const createDebugger = require('redux-flipper').default; 11 | middleware.push(createDebugger()); 12 | } 13 | 14 | export const store = configureStore({ 15 | reducer: persistedReducer, 16 | middleware, 17 | devTools: false, // Disable Redux dev-tools on mobile app 18 | }); 19 | 20 | export const persistor = persistStore(store); -------------------------------------------------------------------------------- /src/store/index.web.ts: -------------------------------------------------------------------------------- 1 | import { persistStore } from 'redux-persist'; 2 | import { middleware } from './middlewares'; 3 | import { configureStore } from '@reduxjs/toolkit'; 4 | import { persistedReducer } from './reducers'; 5 | 6 | export const store = configureStore({ 7 | reducer: persistedReducer, 8 | middleware, 9 | devTools: true, 10 | }); 11 | 12 | if (process.env.NODE_ENV === 'development' && module.hot) { 13 | module.hot.accept('./reducers', () => { 14 | const newRootReducer = require('./reducers').default 15 | store.replaceReducer(newRootReducer) 16 | }) 17 | } 18 | 19 | export const persistor = persistStore(store); -------------------------------------------------------------------------------- /src/routes/Router.tsx: -------------------------------------------------------------------------------- 1 | import React, { useEffect } from 'react'; 2 | import { linking } from './linking'; 3 | import { BottomTabs } from './BottomTabs'; 4 | import { NavigationContainer } from '@react-navigation/native'; 5 | import NavigationService, { navigationRef } from 'src/services/Navigation'; 6 | 7 | export const Router = () => { 8 | useEffect(() => { 9 | NavigationService.isReady = false; 10 | }, []); 11 | 12 | return ( 13 | { NavigationService.isReady = true; }} 17 | > 18 | 19 | 20 | ); 21 | }; -------------------------------------------------------------------------------- /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/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | preset: 'react-native', 3 | moduleNameMapper: { 4 | '^@/(.*)$': '/$1', 5 | }, 6 | moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], 7 | testRegex: '(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$', 8 | testPathIgnorePatterns: ['\\.snap$', '/node_modules/'], 9 | transformIgnorePatterns: ['node_modules/?!(static-container)'], 10 | cacheDirectory: '.jest/cache', 11 | globals: { 12 | 'ts-jest': { 13 | isolatedModules: true, 14 | }, 15 | }, 16 | clearMocks: true, 17 | setupFilesAfterEnv: ['./jest.setup.js'], 18 | collectCoverageFrom: ['src/**/*.{ts,tsx}', '!**/node_modules/**'], 19 | coverageDirectory: '.coverage' 20 | }; 21 | -------------------------------------------------------------------------------- /src/services/Navigation.ts: -------------------------------------------------------------------------------- 1 | import { NavigationAction, NavigationContainerRef } from '@react-navigation/native'; 2 | import React from 'react'; 3 | 4 | export const navigationRef: React.RefObject> = React.createRef(); 5 | 6 | export default class NavigationService { 7 | public static isReady: boolean; 8 | 9 | public static navigate(name: string, params?: Record) { 10 | if (this.isReady && navigationRef.current) { 11 | navigationRef.current.navigate(name, params); 12 | } else { 13 | console.log('App hasn\'t mounted'); 14 | } 15 | } 16 | 17 | public static dispatch(action: NavigationAction) { 18 | if (this.isReady && navigationRef.current) navigationRef.current.dispatch(action); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | // More config: https://www.staging-typescript.org/tsconfig 3 | "compilerOptions": { 4 | "baseUrl": ".", 5 | "paths": { 6 | "src/*": [ 7 | "src/*" 8 | ], 9 | }, 10 | "moduleResolution": "node", 11 | "lib": ["es6", "dom", "ES2019.Array"], 12 | "target": "es5", // Define generated code generation 13 | "jsx": "react", 14 | "strict": true, 15 | "noEmit": true, 16 | "allowJs": true, 17 | "isolatedModules": true, 18 | "allowSyntheticDefaultImports": true, 19 | "esModuleInterop": true, 20 | "resolveJsonModule": true, 21 | "experimentalDecorators": true, 22 | "skipLibCheck": true, 23 | "forceConsistentCasingInFileNames": true, 24 | }, 25 | "exclude": [ 26 | "node_modules", 27 | ] 28 | } -------------------------------------------------------------------------------- /ios/rnStarterTests/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 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:metro-react-native-babel-preset'], 3 | 4 | /** 5 | * Plugins: Order of including these plugins matters 6 | */ 7 | plugins: [ 8 | // ES Features 9 | ['@babel/plugin-proposal-decorators', { legacy: true }], 10 | ['@babel/plugin-proposal-class-properties', { loose: true }], 11 | ['@babel/plugin-proposal-optional-chaining', {}], 12 | 13 | 'react-native-reanimated/plugin', 14 | 15 | // Module resolver 16 | ['module-resolver', { 17 | root: ['./src'], 18 | extensions: ['.ios.js', '.android.js', '.js', '.ts', '.tsx', '.json'], 19 | alias: { 20 | src: './src', 21 | }, 22 | }, 23 | ], 24 | ], 25 | 26 | env: { 27 | production: { 28 | plugins: [ 29 | 'transform-remove-console', 30 | ], 31 | }, 32 | }, 33 | }; 34 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | require_relative '../node_modules/react-native/scripts/react_native_pods' 2 | require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' 3 | 4 | platform :ios, '11.0' 5 | 6 | target 'rnStarter' do 7 | config = use_native_modules! 8 | 9 | use_react_native!(:path => config["reactNativePath"]) 10 | 11 | pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons' 12 | 13 | target 'rnStarterTests' do 14 | inherit! :complete 15 | # Pods for testing 16 | end 17 | 18 | # Enables Flipper. 19 | # 20 | use_flipper!({ 'Flipper-Folly' => '2.5.3', 'Flipper' => '0.87.0', 'Flipper-RSocket' => '1.3.1' }) 21 | end 22 | 23 | target 'rnStarter-tvOS' do 24 | # Pods for rnStarter-tvOS 25 | 26 | target 'rnStarter-tvOSTests' do 27 | inherit! :search_paths 28 | # Pods for testing 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /src/screens/Home.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { useTranslation } from 'react-i18next'; 3 | import { useThemeSystem } from 'src/contexts/ThemeContext'; 4 | import { View, Text, StyleSheet } from 'react-native'; 5 | 6 | const styles = StyleSheet.create({ 7 | container: { 8 | flex: 1, justifyContent: 'center', alignItems: 'center', 9 | }, 10 | text: { 11 | fontSize: 30 12 | } 13 | }) 14 | 15 | export const Home = () => { 16 | const { t } = useTranslation(); 17 | const { theme } = useThemeSystem(); 18 | 19 | return ( 20 | 21 | 26 | {t('Home')} 27 | 28 | 29 | ); 30 | }; 31 | -------------------------------------------------------------------------------- /src/store/user/index.ts: -------------------------------------------------------------------------------- 1 | import { createSlice, PayloadAction, CaseReducer } from '@reduxjs/toolkit'; 2 | import { UserState } from './types'; 3 | import users from './users.json'; 4 | 5 | const initialState: Partial = { 6 | id: undefined, 7 | name: undefined 8 | } 9 | 10 | type ILoginAction = { 11 | userId?: number 12 | } 13 | 14 | const loginAction: CaseReducer, PayloadAction> = (state, action) => { 15 | if (!action.payload.userId) { 16 | throw new Error('User Id cannot be empty'); 17 | } 18 | 19 | state = users[action.payload.userId]; 20 | return state; 21 | } 22 | 23 | export const userSlice = createSlice({ 24 | name: 'auth', 25 | initialState, 26 | reducers: { 27 | login: loginAction 28 | }, 29 | }); 30 | 31 | export const userActions = userSlice.actions; 32 | export const userReducers = userSlice.reducer; 33 | -------------------------------------------------------------------------------- /src/utils/debuggers/reactotron.ts: -------------------------------------------------------------------------------- 1 | import AsyncStorage from '@react-native-community/async-storage'; 2 | import Reactotron from 'reactotron-react-native' 3 | import ReactotronFlipper from "reactotron-react-native/dist/flipper" 4 | 5 | if (__DEV__) { 6 | Reactotron.configure({ 7 | name: "RN Cross-platform Starter", 8 | createSocket: path => new ReactotronFlipper(path), 9 | }) 10 | .useReactNative({ 11 | asyncStorage: false, // there are more options to the async storage. 12 | networking: { // optionally, you can turn it off with false. 13 | ignoreUrls: /symbolicate/ 14 | }, 15 | editor: false, // there are more options to editor 16 | errors: { veto: () => false }, // or turn it off with false 17 | overlay: false, // just turning off overlay 18 | }) 19 | .setAsyncStorageHandler?.(AsyncStorage) // Avoid creating new conn every refresh 20 | .connect(); // let's connect! 21 | } -------------------------------------------------------------------------------- /android/app/src/main/java/com/rnstarter/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.rnstarter; 2 | 3 | import com.facebook.react.ReactActivity; 4 | import com.facebook.react.ReactActivityDelegate; 5 | import com.zoontek.rnbootsplash.RNBootSplash; 6 | 7 | public class MainActivity extends ReactActivity { 8 | 9 | /** 10 | * Returns the name of the main component registered from JavaScript. This is used to schedule 11 | * rendering of the component. 12 | */ 13 | @Override 14 | protected String getMainComponentName() { 15 | return "rnStarter"; 16 | } 17 | 18 | @Override 19 | protected ReactActivityDelegate createReactActivityDelegate() { 20 | return new ReactActivityDelegate(this, getMainComponentName()) { 21 | 22 | @Override 23 | protected void loadApp(String appKey) { 24 | RNBootSplash.init(MainActivity.this); 25 | super.loadApp(appKey); 26 | } 27 | }; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Root.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Provider } from 'react-redux'; 3 | import { PersistGate } from 'redux-persist/integration/react'; 4 | import { Router } from 'src/routes/Router'; 5 | import { persistor, store } from 'src/store'; 6 | import { enableScreens } from 'react-native-screens'; 7 | import { ThemeProvider } from './contexts/ThemeContext'; 8 | import 'src/utils/debuggers/reactotron'; 9 | import 'src/utils/debuggers/flipper'; 10 | import { initI18n } from './i18n'; 11 | 12 | // Optimize React Navigation: https://reactnavigation.org/docs/react-native-screens/ 13 | enableScreens(); 14 | 15 | export const Root = () => { 16 | initI18n(); 17 | 18 | return ( 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | ); 27 | }; 28 | -------------------------------------------------------------------------------- /src/contexts/ThemeContext.tsx: -------------------------------------------------------------------------------- 1 | import React, { 2 | createContext, 3 | useContext, 4 | useState, 5 | useCallback, 6 | } from 'react'; 7 | 8 | import { lightTheme, darkTheme } from 'src/styles/theme'; 9 | 10 | interface ThemeContextData { 11 | toggleTheme(): void; 12 | theme: any; 13 | } 14 | 15 | const ThemeContext = createContext({} as ThemeContextData); 16 | 17 | const ThemeProvider: React.FC = ({ children }) => { 18 | const [theme, setTheme] = useState(lightTheme); 19 | 20 | const toggleTheme = useCallback(() => { 21 | setTheme(theme.paletteName === 'light' ? darkTheme : lightTheme); 22 | }, [theme]); 23 | 24 | return ( 25 | 26 | {children} 27 | 28 | ); 29 | }; 30 | 31 | const useThemeSystem = (): ThemeContextData => { 32 | const context = useContext(ThemeContext); 33 | 34 | return context; 35 | }; 36 | 37 | export { ThemeProvider, useThemeSystem }; -------------------------------------------------------------------------------- /src/styles/types.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Flex 3 | */ 4 | export type FlexWrap = 'nowrap' | 'wrap' | 'wrap-reverse'; 5 | export type FlexDirection = 'row' | 'row-reverse' | 'column' | 'column-reverse'; 6 | export type FlexAlign = 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around'; 7 | export type AlignItem = 'stretch' | 'center' | 'flex-start' | 'flex-end' | 'baseline'; 8 | 9 | /** 10 | * Text 11 | */ 12 | export type TextType = 'H1' | 'H2' | 'H3' | 'Body'; 13 | export type FontStyle = 'normal' | 'italic'; 14 | export type FontWeight = 'normal' | 'bold' | 'bolder' | 'lighter'; 15 | export type TextAlign = 'auto' | 'left' | 'right' | 'center' | 'justify'; 16 | 17 | /** 18 | * Size 19 | */ 20 | export type Size = 's' | 'm' | 'l' | 'xl' | 'xxl'; 21 | 22 | /** 23 | * Theme 24 | */ 25 | export type PaletteName = 'dark' | 'light'; 26 | 27 | export type ThemePalette = { 28 | paletteName: PaletteName; 29 | palette: { 30 | background: string, 31 | onBackground: string, 32 | onBackgroundTint: string, 33 | }; 34 | } -------------------------------------------------------------------------------- /jest.setup.js: -------------------------------------------------------------------------------- 1 | import 'isomorphic-fetch'; 2 | import mockAsyncStorage from '@react-native-community/async-storage/jest/async-storage-mock'; 3 | import 'react-native-gesture-handler/jestSetup'; 4 | 5 | jest.useFakeTimers(); 6 | jest.runAllTimers(); 7 | 8 | jest.mock('@react-native-community/async-storage', () => mockAsyncStorage); 9 | 10 | jest.mock('react-native-bootsplash', () => { 11 | return { 12 | hide: jest.fn(), 13 | show: jest.fn(), 14 | }; 15 | }); 16 | 17 | jest.mock('react-native-reanimated', () => { 18 | const Reanimated = require('react-native-reanimated/mock'); 19 | 20 | // The mock for `call` immediately calls the callback which is incorrect 21 | // So we override it with a no-op 22 | // eslint-disable-next-line @typescript-eslint/no-empty-function 23 | Reanimated.default.call = () => {}; 24 | 25 | return Reanimated; 26 | }); 27 | 28 | // Silence the warning: Animated: `useNativeDriver` is not supported because the native animated module is missing 29 | jest.mock('react-native/Libraries/Animated/src/NativeAnimatedHelper'); 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Turbo Thinh 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/store/middlewares.ts: -------------------------------------------------------------------------------- 1 | import { getDefaultMiddleware } from '@reduxjs/toolkit'; 2 | import { Dispatch, MiddlewareAPI } from 'redux'; 3 | import { RootState } from 'src/store/types'; 4 | import { userActions } from './user/index'; 5 | import { 6 | FLUSH, 7 | REHYDRATE, 8 | PAUSE, 9 | PERSIST, 10 | PURGE, 11 | REGISTER 12 | } from 'redux-persist'; 13 | 14 | /** 15 | * Middleware logger 16 | */ 17 | const loggerMiddleware = (_store: MiddlewareAPI) => (next: Dispatch) => (action: any) => { 18 | const state: RootState = _store.getState(); 19 | console.log('User', state.user.name); 20 | 21 | switch (action.type) { 22 | case userActions.login.type: 23 | console.log('User login action'); 24 | break; 25 | default: 26 | console.log(JSON.stringify(action)); 27 | break; 28 | } 29 | 30 | next(action); 31 | }; 32 | 33 | export const middleware = [ 34 | loggerMiddleware, 35 | ...getDefaultMiddleware({ 36 | serializableCheck: { 37 | // specifically ignore all the action types it dispatches for redux-persist 38 | ignoredActions: [FLUSH, REHYDRATE, PAUSE, PERSIST, PURGE, REGISTER] 39 | } 40 | }) 41 | ] -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 13 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /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 = "31.0.0" 6 | minSdkVersion = 26 7 | compileSdkVersion = 31 8 | targetSdkVersion = 31 9 | ndkVersion = "21.2.6472646" 10 | } 11 | repositories { 12 | google() 13 | jcenter() 14 | } 15 | dependencies { 16 | classpath('com.android.tools.build:gradle:4.2.2') 17 | // NOTE: Do not place your application dependencies here; they belong 18 | // in the individual module build.gradle files 19 | } 20 | } 21 | 22 | allprojects { 23 | repositories { 24 | mavenLocal() 25 | maven { 26 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 27 | url("$rootDir/../node_modules/react-native/android") 28 | } 29 | maven { 30 | // Android JSC is installed from npm 31 | url("$rootDir/../node_modules/jsc-android/dist") 32 | } 33 | 34 | google() 35 | jcenter() 36 | maven { url 'https://www.jitpack.io' } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /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: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 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.99.0 29 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | *.pbxuser 8 | !default.pbxuser 9 | *.mode1v3 10 | !default.mode1v3 11 | *.mode2v3 12 | !default.mode2v3 13 | *.perspectivev3 14 | !default.perspectivev3 15 | xcuserdata 16 | *.xccheckout 17 | *.moved-aside 18 | DerivedData 19 | *.hmap 20 | *.ipa 21 | *.xcuserstate 22 | 23 | # Android/IntelliJ 24 | # 25 | build/ 26 | .idea 27 | .gradle 28 | local.properties 29 | *.iml 30 | .keystore 31 | android/private_key* 32 | *.aab 33 | 34 | # Visual Studio Code 35 | # 36 | .vscode/ 37 | 38 | # node.js 39 | # 40 | node_modules/ 41 | npm-debug.log 42 | yarn-error.log 43 | 44 | # BUCK 45 | buck-out/ 46 | \.buckd/ 47 | *.keystore 48 | !debug.keystore 49 | 50 | # fastlane 51 | # 52 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 53 | # screenshots whenever they are needed. 54 | # For more information about the recommended setup visit: 55 | # https://docs.fastlane.tools/best-practices/source-control/ 56 | 57 | */fastlane/report.xml 58 | */fastlane/Preview.html 59 | */fastlane/screenshots 60 | 61 | # Bundle artifact 62 | *.jsbundle 63 | 64 | # Jest 65 | .jest/ 66 | coverage/ 67 | .coverage/ 68 | reports/ 69 | 70 | # ESLint 71 | .eslintcache 72 | 73 | 74 | 75 | # CocoaPods 76 | /ios/Pods/ 77 | 78 | coverage/ 79 | 80 | credentials 81 | 82 | 83 | ._* 84 | 85 | # Builds 86 | .dist/ 87 | build/ 88 | electron/ -------------------------------------------------------------------------------- /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.rnstarter", 39 | ) 40 | 41 | android_resource( 42 | name = "res", 43 | package = "com.rnstarter", 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 | -------------------------------------------------------------------------------- /src/screens/Settings.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Button, Platform, View, Text, StyleSheet } from 'react-native'; 3 | import { useThemeSystem } from 'src/contexts/ThemeContext'; 4 | import { useI18n } from 'src/i18n/hooks'; 5 | 6 | const styles = StyleSheet.create({ 7 | container: { 8 | flex: 1, justifyContent: 'center', alignItems: 'center', 9 | }, 10 | theme: { 11 | flexDirection: 'row', 12 | alignItems: 'center', 13 | marginBottom: 40, 14 | }, 15 | languages: { 16 | marginBottom: 20, 17 | }, 18 | footer: { 19 | marginTop: 40 20 | } 21 | }) 22 | 23 | export const Settings = () => { 24 | const { t, changeLanguage } = useI18n(); 25 | const { theme, toggleTheme } = useThemeSystem(); 26 | 27 | const platform = Platform.select({ 28 | ios: t('home.text.platform.ios'), 29 | android: t('home.text.platform.android'), 30 | web: t('home.text.platform.web'), 31 | }); 32 | 33 | return ( 34 | 35 | 36 | Theme: 37 |