├── .babelrc ├── .buckconfig ├── .flowconfig ├── .gitattributes ├── .gitignore ├── .vscode └── tasks.json ├── .watchmanconfig ├── README.md ├── __tests__ ├── index.android.js └── index.ios.js ├── android ├── app │ ├── BUCK │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── assets │ │ └── fonts │ │ │ ├── Andale Mono.ttf │ │ │ ├── Arial Black.ttf │ │ │ ├── Arial.ttf │ │ │ ├── Comic Sans MS.ttf │ │ │ ├── Courier New.ttf │ │ │ ├── Entypo.ttf │ │ │ ├── EvilIcons.ttf │ │ │ ├── FontAwesome.ttf │ │ │ ├── Foundation.ttf │ │ │ ├── Georgia.ttf │ │ │ ├── Ionicons.ttf │ │ │ ├── MaterialCommunityIcons.ttf │ │ │ ├── MaterialIcons.ttf │ │ │ ├── Microsoft Sans Serif.ttf │ │ │ ├── Octicons.ttf │ │ │ ├── Roboto.ttf │ │ │ ├── Roboto_medium.ttf │ │ │ ├── SF-UI-Text-Regular.otf │ │ │ ├── SimpleLineIcons.ttf │ │ │ ├── Skia.ttf │ │ │ ├── Times New Roman.ttf │ │ │ └── Zocial.ttf │ │ ├── java │ │ └── com │ │ │ └── reactnativestartkit │ │ │ ├── MainActivity.java │ │ │ └── MainApplication.java │ │ └── res │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ └── values │ │ ├── strings.xml │ │ └── styles.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── keystores │ ├── BUCK │ └── debug.keystore.properties └── settings.gradle ├── app.json ├── demo.gif ├── index.android.js ├── index.ios.js ├── ios ├── reactnativestartkit-tvOS │ └── Info.plist ├── reactnativestartkit-tvOSTests │ └── Info.plist ├── reactnativestartkit.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ ├── reactnativestartkit-tvOS.xcscheme │ │ └── reactnativestartkit.xcscheme ├── reactnativestartkit │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ │ └── LaunchScreen.xib │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Info.plist │ └── main.m └── reactnativestartkitTests │ ├── Info.plist │ └── reactnativestartkitTests.m ├── jsconfig.json ├── package-lock.json ├── package.json ├── src ├── Navigation.js ├── app.js ├── assets │ └── images │ │ └── bgUser.png ├── commons │ ├── Colors.js │ ├── Constants.js │ ├── Images.js │ ├── Styles.js │ ├── arrays.js │ ├── configs.js │ ├── index.js │ └── json │ │ ├── home.json │ │ ├── noti.json │ │ ├── profile.json │ │ └── search.json ├── components │ ├── Header.js │ ├── Icon.js │ ├── SnackBar.js │ ├── Stories.js │ ├── Timeline.js │ ├── Toast.js │ ├── index.js │ └── styles │ │ ├── Header.js │ │ ├── SnackBar.js │ │ ├── Stories.js │ │ ├── Timeline.js │ │ └── Toast.js ├── helper │ ├── AsyncStorage.js │ ├── Fetch.js │ └── index.js ├── redux │ ├── actions │ │ ├── app.js │ │ └── index.js │ └── reducers │ │ ├── app.js │ │ └── index.js ├── scenes │ ├── Camera.js │ ├── Comments.js │ ├── Home.js │ ├── Main.js │ ├── Messages.js │ ├── NewCamera.js │ ├── NewGallery.js │ ├── NewPost.js │ ├── NewVideo.js │ ├── Notification.js │ ├── Profile.js │ ├── Search.js │ └── styles │ │ ├── Camera.js │ │ ├── Comments.js │ │ ├── Home.js │ │ ├── NewCamera.js │ │ ├── NewGallery.js │ │ ├── Notification.js │ │ ├── Profile.js │ │ └── Search.js └── setup.js └── yarn.lock /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["react-native"] 3 | } -------------------------------------------------------------------------------- /.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | ; We fork some components by platform 3 | .*/*[.]android.js 4 | 5 | ; Ignore "BUCK" generated dirs 6 | /\.buckd/ 7 | 8 | ; Ignore unexpected extra "@providesModule" 9 | .*/node_modules/.*/node_modules/fbjs/.* 10 | 11 | ; Ignore duplicate module providers 12 | ; For RN Apps installed via npm, "Libraries" folder is inside 13 | ; "node_modules/react-native" but in the source repo it is in the root 14 | .*/Libraries/react-native/React.js 15 | .*/Libraries/react-native/ReactNative.js 16 | 17 | [include] 18 | 19 | [libs] 20 | node_modules/react-native/Libraries/react-native/react-native-interface.js 21 | node_modules/react-native/flow 22 | flow/ 23 | 24 | [options] 25 | module.system=haste 26 | 27 | experimental.strict_type_args=true 28 | 29 | munge_underscores=true 30 | 31 | 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\)$' -> 'RelativeImageStub' 32 | 33 | suppress_type=$FlowIssue 34 | suppress_type=$FlowFixMe 35 | suppress_type=$FixMe 36 | 37 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-7]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) 38 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-7]\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ 39 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy 40 | 41 | unsafe.enable_getters_and_setters=true 42 | 43 | [version] 44 | ^0.37.0 45 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | 25 | # Android/IntelliJ 26 | # 27 | build/ 28 | .idea 29 | .gradle 30 | local.properties 31 | *.iml 32 | 33 | # node.js 34 | # 35 | node_modules/ 36 | npm-debug.log 37 | yarn-error.log 38 | 39 | # BUCK 40 | buck-out/ 41 | \.buckd/ 42 | android/app/libs 43 | *.keystore 44 | 45 | # fastlane 46 | # 47 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 48 | # screenshots whenever they are needed. 49 | # For more information about the recommended setup visit: 50 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 51 | 52 | fastlane/report.xml 53 | fastlane/Preview.html 54 | fastlane/screenshots 55 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.1.0", 3 | "command": "react-native", 4 | "isShellCommand": true, 5 | "args": [], 6 | "showOutput": "always", 7 | "echoCommand": true, 8 | "suppressTaskName": true, 9 | "tasks": [ 10 | { 11 | "taskName": "log android", 12 | "args": ["log-android"] 13 | }, 14 | { 15 | "taskName": "log ios", 16 | "args": ["log-ios"] 17 | } 18 | ] 19 | } -------------------------------------------------------------------------------- /.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # REACT-NATIVE-START_KIT 2 | 3 | boilerplate for React Native 4 | 5 | ## Example 6 | ![](/demo.gif?raw=true) 7 | 8 | ## Key Features 9 | 10 | - boilerplate 11 | - react-naitve-camera 12 | - FlatList 13 | - redux (redux-thunk) 14 | - custom Dialog (using redux) 15 | - custom Toast (using redux) 16 | 17 | ## Install 18 | 19 | Once you have downloaded or cloned this repository, follow 20 | you can use **yarn** or **npm** 21 | install node_module 22 | 23 | ```sh 24 | $ yarn # or npm 25 | ``` 26 | 27 | ```sh 28 | $ react-native link 29 | ``` 30 | runs your app in development mode start post 31 | 32 | ```sh 33 | $ react-native start 34 | ``` 35 | 36 | build app android or ios 37 | 38 | ```sh 39 | $ react-native run-android #build for android 40 | $ react-native run-ios #build for ios 41 | ``` 42 | 43 | ## Usage 44 | 45 | - [Setting up React Native for Android](https://facebook.github.io/react-native/docs/android-setup.html#content) 46 | - [Running app on Android Device](https://facebook.github.io/react-native/docs/running-on-device-android.html#content) 47 | - [Running app on iOS Device](https://facebook.github.io/react-native/docs/running-on-device-ios.html#content) 48 | 49 | ## Made with help of 50 | 51 | - [redux](https://redux.js.org/) 52 | - [react-native](https://github.com/facebook/react-native) 53 | - [react-navigation](https://github.com/react-community/react-navigation) 54 | - [eact-naitve-camera] (https://github.com/lwansbrough/react-native-camera) 55 | 56 | ## Can I hire you guys? 57 | 58 | Yes!simply leave us a message to [luulam0911@gmail.com](mailto:luulam0911@gmail.com). We will be happy to work with you! 59 | 60 | ## License 61 | 62 | [LUULAM](LICENSE.txt) license. 63 | 64 | ## How can I support developers? 65 | 66 | - Star our GitHub repo :star: 67 | - Create pull requests, submit bugs, suggest new features or documentation updates :wrench: 68 | - Follow us on [Github](https://github.com/luulam) :feet: 69 | - add friend [Facebook](https://www.facebook.com/luu.bang.77/) :thumbsup: 70 | - blog [luulam.github.io](luulam.github.io) 71 | 72 | ### From Luulam 73 | 74 | Enjoy :metal: 75 | We're always happy to receive your feedback! -------------------------------------------------------------------------------- /__tests__/index.android.js: -------------------------------------------------------------------------------- 1 | import 'react-native'; 2 | import React from 'react'; 3 | import Index from '../index.android.js'; 4 | 5 | // Note: test renderer must be required after react-native. 6 | import renderer from 'react-test-renderer'; 7 | 8 | it('renders correctly', () => { 9 | const tree = renderer.create( 10 | 11 | ); 12 | }); 13 | -------------------------------------------------------------------------------- /__tests__/index.ios.js: -------------------------------------------------------------------------------- 1 | import 'react-native'; 2 | import React from 'react'; 3 | import Index from '../index.ios.js'; 4 | 5 | // Note: test renderer must be required after react-native. 6 | import renderer from 'react-test-renderer'; 7 | 8 | it('renders correctly', () => { 9 | const tree = renderer.create( 10 | 11 | ); 12 | }); 13 | -------------------------------------------------------------------------------- /android/app/BUCK: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | # To learn about Buck see [Docs](https://buckbuild.com/). 4 | # To run your application with Buck: 5 | # - install Buck 6 | # - `npm start` - to start the packager 7 | # - `cd android` 8 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 9 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 10 | # - `buck install -r android/app` - compile, install and run application 11 | # 12 | 13 | lib_deps = [] 14 | for jarfile in glob(['libs/*.jar']): 15 | name = 'jars__' + re.sub(r'^.*/([^/]+)\.jar$', r'\1', jarfile) 16 | lib_deps.append(':' + name) 17 | prebuilt_jar( 18 | name = name, 19 | binary_jar = jarfile, 20 | ) 21 | 22 | for aarfile in glob(['libs/*.aar']): 23 | name = 'aars__' + re.sub(r'^.*/([^/]+)\.aar$', r'\1', aarfile) 24 | lib_deps.append(':' + name) 25 | android_prebuilt_aar( 26 | name = name, 27 | aar = aarfile, 28 | ) 29 | 30 | android_library( 31 | name = 'all-libs', 32 | exported_deps = lib_deps 33 | ) 34 | 35 | android_library( 36 | name = 'app-code', 37 | srcs = glob([ 38 | 'src/main/java/**/*.java', 39 | ]), 40 | deps = [ 41 | ':all-libs', 42 | ':build_config', 43 | ':res', 44 | ], 45 | ) 46 | 47 | android_build_config( 48 | name = 'build_config', 49 | package = 'com.reactnativestartkit', 50 | ) 51 | 52 | android_resource( 53 | name = 'res', 54 | res = 'src/main/res', 55 | package = 'com.reactnativestartkit', 56 | ) 57 | 58 | android_binary( 59 | name = 'app', 60 | package_type = 'debug', 61 | manifest = 'src/main/AndroidManifest.xml', 62 | keystore = '//android/keystores:debug', 63 | deps = [ 64 | ':app-code', 65 | ], 66 | ) 67 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | 3 | import com.android.build.OutputFile 4 | 5 | /** 6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets 7 | * and bundleReleaseJsAndAssets). 8 | * These basically call `react-native bundle` with the correct arguments during the Android build 9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the 10 | * bundle directly from the development server. Below you can see all the possible configurations 11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the 12 | * `apply from: "../../node_modules/react-native/react.gradle"` line. 13 | * 14 | * project.ext.react = [ 15 | * // the name of the generated asset file containing your JS bundle 16 | * bundleAssetName: "index.android.bundle", 17 | * 18 | * // the entry file for bundle generation 19 | * entryFile: "index.android.js", 20 | * 21 | * // whether to bundle JS and assets in debug mode 22 | * bundleInDebug: false, 23 | * 24 | * // whether to bundle JS and assets in release mode 25 | * bundleInRelease: true, 26 | * 27 | * // whether to bundle JS and assets in another build variant (if configured). 28 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants 29 | * // The configuration property can be in the following formats 30 | * // 'bundleIn${productFlavor}${buildType}' 31 | * // 'bundleIn${buildType}' 32 | * // bundleInFreeDebug: true, 33 | * // bundleInPaidRelease: true, 34 | * // bundleInBeta: true, 35 | * 36 | * // the root of your project, i.e. where "package.json" lives 37 | * root: "../../", 38 | * 39 | * // where to put the JS bundle asset in debug mode 40 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 41 | * 42 | * // where to put the JS bundle asset in release mode 43 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 44 | * 45 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 46 | * // require('./image.png')), in debug mode 47 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 48 | * 49 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 50 | * // require('./image.png')), in release mode 51 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 52 | * 53 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 54 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 55 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 56 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 57 | * // for example, you might want to remove it from here. 58 | * inputExcludes: ["android/**", "ios/**"], 59 | * 60 | * // override which node gets called and with what additional arguments 61 | * nodeExecutableAndArgs: ["node"] 62 | * 63 | * // supply additional arguments to the packager 64 | * extraPackagerArgs: [] 65 | * ] 66 | */ 67 | 68 | apply from: "../../node_modules/react-native/react.gradle" 69 | 70 | /** 71 | * Set this to true to create two separate APKs instead of one: 72 | * - An APK that only works on ARM devices 73 | * - An APK that only works on x86 devices 74 | * The advantage is the size of the APK is reduced by about 4MB. 75 | * Upload all the APKs to the Play Store and people will download 76 | * the correct one based on the CPU architecture of their device. 77 | */ 78 | def enableSeparateBuildPerCPUArchitecture = false 79 | 80 | /** 81 | * Run Proguard to shrink the Java bytecode in release builds. 82 | */ 83 | def enableProguardInReleaseBuilds = false 84 | 85 | android { 86 | compileSdkVersion 23 87 | buildToolsVersion "23.0.1" 88 | 89 | defaultConfig { 90 | applicationId "com.reactnativestartkit" 91 | minSdkVersion 16 92 | targetSdkVersion 22 93 | versionCode 1 94 | versionName "1.0" 95 | ndk { 96 | abiFilters "armeabi-v7a", "x86" 97 | } 98 | } 99 | // signingConfigs { 100 | // release { 101 | // if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) { 102 | // storeFile file(MYAPP_RELEASE_STORE_FILE_TEST) 103 | // storePassword MYAPP_RELEASE_STORE_PASSWORD_TEST 104 | // keyAlias MYAPP_RELEASE_KEY_ALIAS_TEST 105 | // keyPassword MYAPP_RELEASE_KEY_PASSWORD_TEST 106 | // } 107 | // } 108 | // } 109 | splits { 110 | abi { 111 | reset() 112 | enable enableSeparateBuildPerCPUArchitecture 113 | universalApk false // If true, also generate a universal APK 114 | include "armeabi-v7a", "x86" 115 | } 116 | } 117 | buildTypes { 118 | release { 119 | minifyEnabled enableProguardInReleaseBuilds 120 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 121 | // signingConfig signingConfigs.release 122 | } 123 | } 124 | // applicationVariants are e.g. debug, release 125 | applicationVariants.all { variant -> 126 | variant.outputs.each { output -> 127 | // For each separate APK per architecture, set a unique version code as described here: 128 | // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits 129 | def versionCodes = ["armeabi-v7a":1, "x86":2] 130 | def abi = output.getFilter(OutputFile.ABI) 131 | if (abi != null) { // null for the universal-debug, universal-release variants 132 | output.versionCodeOverride = 133 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode 134 | } 135 | } 136 | } 137 | } 138 | 139 | dependencies { 140 | compile project(':react-native-camera') 141 | compile project(':react-native-vector-icons') 142 | compile fileTree(dir: "libs", include: ["*.jar"]) 143 | compile "com.android.support:appcompat-v7:23.0.1" 144 | compile "com.facebook.react:react-native:+" // From node_modules 145 | } 146 | 147 | // Run this once to be able to run the application with BUCK 148 | // puts all compile dependencies into folder libs for BUCK to use 149 | task copyDownloadableDepsToLibs(type: Copy) { 150 | from configurations.compile 151 | into 'libs' 152 | } 153 | -------------------------------------------------------------------------------- /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 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Disabling obfuscation is useful if you collect stack traces from production crashes 20 | # (unless you are using a system that supports de-obfuscate the stack traces). 21 | -dontobfuscate 22 | 23 | # React Native 24 | 25 | # Keep our interfaces so they can be used by other ProGuard rules. 26 | # See http://sourceforge.net/p/proguard/bugs/466/ 27 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip 28 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters 29 | -keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip 30 | 31 | # Do not strip any method/class that is annotated with @DoNotStrip 32 | -keep @com.facebook.proguard.annotations.DoNotStrip class * 33 | -keep @com.facebook.common.internal.DoNotStrip class * 34 | -keepclassmembers class * { 35 | @com.facebook.proguard.annotations.DoNotStrip *; 36 | @com.facebook.common.internal.DoNotStrip *; 37 | } 38 | 39 | -keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * { 40 | void set*(***); 41 | *** get*(); 42 | } 43 | 44 | -keep class * extends com.facebook.react.bridge.JavaScriptModule { *; } 45 | -keep class * extends com.facebook.react.bridge.NativeModule { *; } 46 | -keepclassmembers,includedescriptorclasses class * { native ; } 47 | -keepclassmembers class * { @com.facebook.react.uimanager.UIProp ; } 48 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp ; } 49 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup ; } 50 | 51 | -dontwarn com.facebook.react.** 52 | 53 | # okhttp 54 | 55 | -keepattributes Signature 56 | -keepattributes *Annotation* 57 | -keep class okhttp3.** { *; } 58 | -keep interface okhttp3.** { *; } 59 | -dontwarn okhttp3.** 60 | 61 | # okio 62 | 63 | -keep class sun.misc.Unsafe { *; } 64 | -dontwarn java.nio.file.* 65 | -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement 66 | -dontwarn okio.** 67 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 16 | 17 | 23 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Andale Mono.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luulam/React-Native-Start-Kit/36450f0a97aac505d4abcc4df0b18077cda6e140/android/app/src/main/assets/fonts/Andale Mono.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Arial Black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luulam/React-Native-Start-Kit/36450f0a97aac505d4abcc4df0b18077cda6e140/android/app/src/main/assets/fonts/Arial Black.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Arial.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luulam/React-Native-Start-Kit/36450f0a97aac505d4abcc4df0b18077cda6e140/android/app/src/main/assets/fonts/Arial.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Comic Sans MS.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luulam/React-Native-Start-Kit/36450f0a97aac505d4abcc4df0b18077cda6e140/android/app/src/main/assets/fonts/Comic Sans MS.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Courier New.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luulam/React-Native-Start-Kit/36450f0a97aac505d4abcc4df0b18077cda6e140/android/app/src/main/assets/fonts/Courier New.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Entypo.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luulam/React-Native-Start-Kit/36450f0a97aac505d4abcc4df0b18077cda6e140/android/app/src/main/assets/fonts/Entypo.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/EvilIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luulam/React-Native-Start-Kit/36450f0a97aac505d4abcc4df0b18077cda6e140/android/app/src/main/assets/fonts/EvilIcons.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/FontAwesome.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luulam/React-Native-Start-Kit/36450f0a97aac505d4abcc4df0b18077cda6e140/android/app/src/main/assets/fonts/FontAwesome.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Foundation.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luulam/React-Native-Start-Kit/36450f0a97aac505d4abcc4df0b18077cda6e140/android/app/src/main/assets/fonts/Foundation.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Georgia.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luulam/React-Native-Start-Kit/36450f0a97aac505d4abcc4df0b18077cda6e140/android/app/src/main/assets/fonts/Georgia.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Ionicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luulam/React-Native-Start-Kit/36450f0a97aac505d4abcc4df0b18077cda6e140/android/app/src/main/assets/fonts/Ionicons.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luulam/React-Native-Start-Kit/36450f0a97aac505d4abcc4df0b18077cda6e140/android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/MaterialIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luulam/React-Native-Start-Kit/36450f0a97aac505d4abcc4df0b18077cda6e140/android/app/src/main/assets/fonts/MaterialIcons.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Microsoft Sans Serif.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luulam/React-Native-Start-Kit/36450f0a97aac505d4abcc4df0b18077cda6e140/android/app/src/main/assets/fonts/Microsoft Sans Serif.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Octicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luulam/React-Native-Start-Kit/36450f0a97aac505d4abcc4df0b18077cda6e140/android/app/src/main/assets/fonts/Octicons.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Roboto.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luulam/React-Native-Start-Kit/36450f0a97aac505d4abcc4df0b18077cda6e140/android/app/src/main/assets/fonts/Roboto.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Roboto_medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luulam/React-Native-Start-Kit/36450f0a97aac505d4abcc4df0b18077cda6e140/android/app/src/main/assets/fonts/Roboto_medium.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/SF-UI-Text-Regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luulam/React-Native-Start-Kit/36450f0a97aac505d4abcc4df0b18077cda6e140/android/app/src/main/assets/fonts/SF-UI-Text-Regular.otf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/SimpleLineIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luulam/React-Native-Start-Kit/36450f0a97aac505d4abcc4df0b18077cda6e140/android/app/src/main/assets/fonts/SimpleLineIcons.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Skia.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luulam/React-Native-Start-Kit/36450f0a97aac505d4abcc4df0b18077cda6e140/android/app/src/main/assets/fonts/Skia.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Times New Roman.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luulam/React-Native-Start-Kit/36450f0a97aac505d4abcc4df0b18077cda6e140/android/app/src/main/assets/fonts/Times New Roman.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Zocial.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luulam/React-Native-Start-Kit/36450f0a97aac505d4abcc4df0b18077cda6e140/android/app/src/main/assets/fonts/Zocial.ttf -------------------------------------------------------------------------------- /android/app/src/main/java/com/reactnativestartkit/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.reactnativestartkit; 2 | 3 | import com.facebook.react.ReactActivity; 4 | 5 | public class MainActivity extends ReactActivity { 6 | 7 | /** 8 | * Returns the name of the main component registered from JavaScript. 9 | * This is used to schedule rendering of the component. 10 | */ 11 | @Override 12 | protected String getMainComponentName() { 13 | return "reactnativestartkit"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/reactnativestartkit/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.reactnativestartkit; 2 | 3 | import android.app.Application; 4 | import android.util.Log; 5 | 6 | import com.facebook.react.ReactApplication; 7 | import com.lwansbrough.RCTCamera.RCTCameraPackage; 8 | import com.oblador.vectoricons.VectorIconsPackage; 9 | import com.facebook.react.ReactInstanceManager; 10 | import com.facebook.react.ReactNativeHost; 11 | import com.facebook.react.ReactPackage; 12 | import com.facebook.react.shell.MainReactPackage; 13 | import com.facebook.soloader.SoLoader; 14 | 15 | import java.util.Arrays; 16 | import java.util.List; 17 | 18 | public class MainApplication extends Application implements ReactApplication { 19 | 20 | private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { 21 | @Override 22 | public boolean getUseDeveloperSupport() { 23 | return BuildConfig.DEBUG; 24 | } 25 | 26 | @Override 27 | protected List getPackages() { 28 | return Arrays.asList( 29 | new MainReactPackage(), 30 | new RCTCameraPackage(), 31 | new VectorIconsPackage() 32 | ); 33 | } 34 | }; 35 | 36 | @Override 37 | public ReactNativeHost getReactNativeHost() { 38 | return mReactNativeHost; 39 | } 40 | 41 | @Override 42 | public void onCreate() { 43 | super.onCreate(); 44 | SoLoader.init(this, /* native exopackage */ false); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luulam/React-Native-Start-Kit/36450f0a97aac505d4abcc4df0b18077cda6e140/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luulam/React-Native-Start-Kit/36450f0a97aac505d4abcc4df0b18077cda6e140/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luulam/React-Native-Start-Kit/36450f0a97aac505d4abcc4df0b18077cda6e140/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luulam/React-Native-Start-Kit/36450f0a97aac505d4abcc4df0b18077cda6e140/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | reactnativestartkit 3 | 4 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:1.3.1' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | mavenLocal() 18 | jcenter() 19 | maven { 20 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 21 | url "$rootDir/../node_modules/react-native/android" 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /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 | android.useDeprecatedNdk=true 21 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luulam/React-Native-Start-Kit/36450f0a97aac505d4abcc4df0b18077cda6e140/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip 6 | -------------------------------------------------------------------------------- /android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # For Cygwin, ensure paths are in UNIX format before anything is touched. 46 | if $cygwin ; then 47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 48 | fi 49 | 50 | # Attempt to set APP_HOME 51 | # Resolve links: $0 may be a link 52 | PRG="$0" 53 | # Need this for relative symlinks. 54 | while [ -h "$PRG" ] ; do 55 | ls=`ls -ld "$PRG"` 56 | link=`expr "$ls" : '.*-> \(.*\)$'` 57 | if expr "$link" : '/.*' > /dev/null; then 58 | PRG="$link" 59 | else 60 | PRG=`dirname "$PRG"`"/$link" 61 | fi 62 | done 63 | SAVED="`pwd`" 64 | cd "`dirname \"$PRG\"`/" >&- 65 | APP_HOME="`pwd -P`" 66 | cd "$SAVED" >&- 67 | 68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 69 | 70 | # Determine the Java command to use to start the JVM. 71 | if [ -n "$JAVA_HOME" ] ; then 72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 73 | # IBM's JDK on AIX uses strange locations for the executables 74 | JAVACMD="$JAVA_HOME/jre/sh/java" 75 | else 76 | JAVACMD="$JAVA_HOME/bin/java" 77 | fi 78 | if [ ! -x "$JAVACMD" ] ; then 79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 80 | 81 | Please set the JAVA_HOME variable in your environment to match the 82 | location of your Java installation." 83 | fi 84 | else 85 | JAVACMD="java" 86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 87 | 88 | Please set the JAVA_HOME variable in your environment to match the 89 | location of your Java installation." 90 | fi 91 | 92 | # Increase the maximum file descriptors if we can. 93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 94 | MAX_FD_LIMIT=`ulimit -H -n` 95 | if [ $? -eq 0 ] ; then 96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 97 | MAX_FD="$MAX_FD_LIMIT" 98 | fi 99 | ulimit -n $MAX_FD 100 | if [ $? -ne 0 ] ; then 101 | warn "Could not set maximum file descriptor limit: $MAX_FD" 102 | fi 103 | else 104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 105 | fi 106 | fi 107 | 108 | # For Darwin, add options to specify how the application appears in the dock 109 | if $darwin; then 110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 111 | fi 112 | 113 | # For Cygwin, switch paths to Windows format before running java 114 | if $cygwin ; then 115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 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 %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="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 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /android/keystores/BUCK: -------------------------------------------------------------------------------- 1 | keystore( 2 | name = 'debug', 3 | store = 'debug.keystore', 4 | properties = 'debug.keystore.properties', 5 | visibility = [ 6 | 'PUBLIC', 7 | ], 8 | ) 9 | -------------------------------------------------------------------------------- /android/keystores/debug.keystore.properties: -------------------------------------------------------------------------------- 1 | key.store=debug.keystore 2 | key.alias=androiddebugkey 3 | key.store.password=android 4 | key.alias.password=android 5 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'reactnativestartkit' 2 | include ':react-native-camera' 3 | project(':react-native-camera').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-camera/android') 4 | include ':react-native-vector-icons' 5 | project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android') 6 | 7 | include ':app' 8 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "reactnativestartkit", 3 | "displayName": "reactnativestartkit" 4 | } -------------------------------------------------------------------------------- /demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luulam/React-Native-Start-Kit/36450f0a97aac505d4abcc4df0b18077cda6e140/demo.gif -------------------------------------------------------------------------------- /index.android.js: -------------------------------------------------------------------------------- 1 | import { AppRegistry } from 'react-native' 2 | import App from './src/App' 3 | 4 | AppRegistry.registerComponent('reactnativestartkit', () => App) 5 | -------------------------------------------------------------------------------- /index.ios.js: -------------------------------------------------------------------------------- 1 | import { AppRegistry } from 'react-native' 2 | import App from './src/App' 3 | 4 | AppRegistry.registerComponent('reactnativestartkit', () => App) 5 | -------------------------------------------------------------------------------- /ios/reactnativestartkit-tvOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UIViewControllerBasedStatusBarAppearance 38 | 39 | NSLocationWhenInUseUsageDescription 40 | 41 | NSAppTransportSecurity 42 | 43 | 44 | NSExceptionDomains 45 | 46 | localhost 47 | 48 | NSExceptionAllowsInsecureHTTPLoads 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /ios/reactnativestartkit-tvOSTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 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/reactnativestartkit.xcodeproj/xcshareddata/xcschemes/reactnativestartkit-tvOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 43 | 49 | 50 | 51 | 52 | 53 | 58 | 59 | 61 | 67 | 68 | 69 | 70 | 71 | 77 | 78 | 79 | 80 | 81 | 82 | 92 | 94 | 100 | 101 | 102 | 103 | 104 | 105 | 111 | 113 | 119 | 120 | 121 | 122 | 124 | 125 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /ios/reactnativestartkit.xcodeproj/xcshareddata/xcschemes/reactnativestartkit.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 43 | 49 | 50 | 51 | 52 | 53 | 58 | 59 | 61 | 67 | 68 | 69 | 70 | 71 | 77 | 78 | 79 | 80 | 81 | 82 | 92 | 94 | 100 | 101 | 102 | 103 | 104 | 105 | 111 | 113 | 119 | 120 | 121 | 122 | 124 | 125 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /ios/reactnativestartkit/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface AppDelegate : UIResponder 13 | 14 | @property (nonatomic, strong) UIWindow *window; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /ios/reactnativestartkit/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "AppDelegate.h" 11 | 12 | #import 13 | #import 14 | 15 | @implementation AppDelegate 16 | 17 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 18 | { 19 | NSURL *jsCodeLocation; 20 | 21 | jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil]; 22 | 23 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation 24 | moduleName:@"reactnativestartkit" 25 | initialProperties:nil 26 | launchOptions:launchOptions]; 27 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; 28 | 29 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 30 | UIViewController *rootViewController = [UIViewController new]; 31 | rootViewController.view = rootView; 32 | self.window.rootViewController = rootViewController; 33 | [self.window makeKeyAndVisible]; 34 | return YES; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /ios/reactnativestartkit/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /ios/reactnativestartkit/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | } 43 | ], 44 | "info" : { 45 | "version" : 1, 46 | "author" : "xcode" 47 | } 48 | } -------------------------------------------------------------------------------- /ios/reactnativestartkit/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSPhotoLibraryUsageDescription 6 | Camera Roll Access 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleDisplayName 10 | reactnativestartkit 11 | CFBundleExecutable 12 | $(EXECUTABLE_NAME) 13 | CFBundleIdentifier 14 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | $(PRODUCT_NAME) 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1 27 | LSRequiresIPhoneOS 28 | 29 | UILaunchStoryboardName 30 | LaunchScreen 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | UIViewControllerBasedStatusBarAppearance 42 | 43 | NSLocationWhenInUseUsageDescription 44 | 45 | NSAppTransportSecurity 46 | 47 | NSAllowsArbitraryLoads 48 | 49 | NSExceptionDomains 50 | 51 | localhost 52 | 53 | NSExceptionAllowsInsecureHTTPLoads 54 | 55 | 56 | 57 | 58 | UIAppFonts 59 | 60 | Andale Mono.ttf 61 | Arial Black.ttf 62 | Arial.ttf 63 | Comic Sans MS.ttf 64 | Courier New.ttf 65 | Georgia.ttf 66 | Microsoft Sans Serif.ttf 67 | Roboto_medium.ttf 68 | Roboto.ttf 69 | SF-UI-Text-Regular.otf 70 | Skia.ttf 71 | Times New Roman.ttf 72 | Entypo.ttf 73 | EvilIcons.ttf 74 | FontAwesome.ttf 75 | Foundation.ttf 76 | Ionicons.ttf 77 | MaterialCommunityIcons.ttf 78 | MaterialIcons.ttf 79 | Octicons.ttf 80 | SimpleLineIcons.ttf 81 | Zocial.ttf 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /ios/reactnativestartkit/main.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import "AppDelegate.h" 13 | 14 | int main(int argc, char * argv[]) { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ios/reactnativestartkitTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 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/reactnativestartkitTests/reactnativestartkitTests.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | #import 12 | 13 | #import 14 | #import 15 | 16 | #define TIMEOUT_SECONDS 600 17 | #define TEXT_TO_LOOK_FOR @"Welcome to React Native!" 18 | 19 | @interface reactnativestartkitTests : XCTestCase 20 | 21 | @end 22 | 23 | @implementation reactnativestartkitTests 24 | 25 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test 26 | { 27 | if (test(view)) { 28 | return YES; 29 | } 30 | for (UIView *subview in [view subviews]) { 31 | if ([self findSubviewInView:subview matching:test]) { 32 | return YES; 33 | } 34 | } 35 | return NO; 36 | } 37 | 38 | - (void)testRendersWelcomeScreen 39 | { 40 | UIViewController *vc = [[[[UIApplication sharedApplication] delegate] window] rootViewController]; 41 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 42 | BOOL foundElement = NO; 43 | 44 | __block NSString *redboxError = nil; 45 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { 46 | if (level >= RCTLogLevelError) { 47 | redboxError = message; 48 | } 49 | }); 50 | 51 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { 52 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 53 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 54 | 55 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { 56 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { 57 | return YES; 58 | } 59 | return NO; 60 | }]; 61 | } 62 | 63 | RCTSetLogFunction(RCTDefaultLogFunction); 64 | 65 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 66 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 67 | } 68 | 69 | 70 | @end 71 | -------------------------------------------------------------------------------- /jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowJs": true, 4 | "allowSyntheticDefaultImports": true 5 | }, 6 | "exclude": [ 7 | "node_modules" 8 | ] 9 | } -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "reactnativestartkit", 3 | "version": "0.0.1", 4 | "lockfileVersion": 1, 5 | "dependencies": { 6 | "react-native-camera": { 7 | "version": "0.6.0", 8 | "resolved": "https://registry.npmjs.org/react-native-camera/-/react-native-camera-0.6.0.tgz", 9 | "integrity": "sha1-3Sdgt4V9Zgdhx48tpXW0lP3I3LU=" 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "reactnativestartkit", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "start": "node node_modules/react-native/local-cli/cli.js start", 7 | "test": "jest" 8 | }, 9 | "dependencies": { 10 | "react": "16.0.0-alpha.6", 11 | "react-native": "0.44.0", 12 | "react-native-camera": "^0.6.0", 13 | "react-native-vector-icons": "^4.1.1", 14 | "react-navigation": "^1.0.0-beta.11", 15 | "react-redux": "^5.0.4", 16 | "redux": "^3.6.0", 17 | "redux-thunk": "^2.2.0", 18 | "uuid": "^3.0.1" 19 | }, 20 | "devDependencies": { 21 | "babel-jest": "19.0.0", 22 | "babel-preset-react-native": "1.9.1", 23 | "jest": "19.0.2", 24 | "react-test-renderer": "~15.4.0" 25 | }, 26 | "jest": { 27 | "preset": "react-native" 28 | } 29 | } -------------------------------------------------------------------------------- /src/Navigation.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | import React from 'react' 4 | import { Platform } from 'react-native' 5 | import { TabNavigator , TabBarBottom } from 'react-navigation'; 6 | 7 | import Main from './scenes/Main' 8 | import Search from './scenes/Search' 9 | import NewPost from './scenes/NewPost' 10 | import Notification from './scenes/Notification' 11 | import Profile from './scenes/Profile' 12 | 13 | const AppNavigator = TabNavigator( 14 | { 15 | Main: { 16 | screen: Main, 17 | }, 18 | Search: { 19 | screen: Search, 20 | }, 21 | NewPost: { 22 | screen: NewPost, 23 | }, 24 | Notification: { 25 | screen: Notification, 26 | }, 27 | Profile: { 28 | screen: Profile, 29 | } 30 | }, 31 | { 32 | tabBarComponent: TabBarBottom, 33 | tabBarPosition: 'bottom', 34 | swipeEnabled: false, 35 | lazy:true, 36 | tabBarOptions: { 37 | activeTintColor: 'black', 38 | showLabel: false, 39 | showIcon: true, 40 | } 41 | } 42 | ) 43 | 44 | export default AppNavigator -------------------------------------------------------------------------------- /src/app.js: -------------------------------------------------------------------------------- 1 | import React ,{Component}from 'react'; 2 | import { createStore, applyMiddleware } from 'redux'; 3 | import { Provider } from 'react-redux'; 4 | import thunk from 'redux-thunk'; 5 | import Setup from './Setup' 6 | import reducers from './redux/reducers'; 7 | import Navigation from './Navigation' 8 | const store = createStore(reducers, applyMiddleware(thunk)) 9 | 10 | const App = () => { 11 | return ( 12 | 13 | 14 | 15 | 16 | 17 | ); 18 | } 19 | export default App -------------------------------------------------------------------------------- /src/assets/images/bgUser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luulam/React-Native-Start-Kit/36450f0a97aac505d4abcc4df0b18077cda6e140/src/assets/images/bgUser.png -------------------------------------------------------------------------------- /src/commons/Colors.js: -------------------------------------------------------------------------------- 1 | export const colors = { 2 | background: 'white', 3 | accent: '#3897f0', 4 | cover:'rgba(169, 169, 169, 0.6)' 5 | } 6 | 7 | export default colors 8 | -------------------------------------------------------------------------------- /src/commons/Constants.js: -------------------------------------------------------------------------------- 1 | //apikey newsapi.org 2 | export const API_KEY = 'bd6a346fbc934d0eb691c04320661937' 3 | 4 | //url 5 | export const URL_BASE = 'http://beta.json-generator.com/' 6 | export const URL_VESSION = 'api/json/get/' 7 | export const TIMELINE = `${URL_BASE}${URL_VESSION}4JFFcKT77` 8 | export const URL_ARTICLE = `${URL_BASE}${URL_VESSION}article?apiKey=${API_KEY}` 9 | 10 | //asynStorage 11 | export const ASYN_STO_LANGUAGE = 'ASYN_STO_LANGUAGE' 12 | export const ASYN_STO_CATEGORY = 'ASYN_STO_CATEGORY' 13 | 14 | export default { 15 | URL_BASE, 16 | URL_VESSION, 17 | TIMELINE, 18 | URL_ARTICLE, 19 | 20 | ASYN_STO_LANGUAGE, 21 | ASYN_STO_CATEGORY 22 | } -------------------------------------------------------------------------------- /src/commons/Images.js: -------------------------------------------------------------------------------- 1 | export const images = { 2 | bgAvatarUser: require('../assets/images/bgUser.png'), 3 | } 4 | 5 | export default images 6 | -------------------------------------------------------------------------------- /src/commons/Styles.js: -------------------------------------------------------------------------------- 1 | import { StyleSheet } from 'react-native' 2 | import configs from './Configs' 3 | import colors from './Colors' 4 | 5 | export default styles = { 6 | app: { 7 | paddingTop: configs.statusBarHeight, 8 | flex: 1, 9 | backgroundColor: 'transparent' 10 | }, 11 | appConst: { 12 | flex: 1, 13 | backgroundColor: colors.background 14 | }, 15 | appHor: { 16 | flexDirection: 'row' 17 | }, 18 | appVer: { 19 | flexDirection: 'column' 20 | }, 21 | appCenter: { 22 | flex: 1, 23 | justifyContent: 'center', 24 | alignItems: 'center' 25 | }, 26 | appIcon: { 27 | width: 30, 28 | height: 30, 29 | marginRight: 4 30 | }, 31 | appLabel: { 32 | color: '#5D5D5D', 33 | }, 34 | appTitle: { 35 | color: '#262626', 36 | fontWeight: '500', 37 | fontSize: configs.font.big, 38 | }, 39 | appLine: { 40 | borderBottomColor: '#c9c9c9', 41 | borderBottomWidth: 0.4, 42 | }, 43 | appPaddingButton: { 44 | paddingHorizontal: 8, 45 | paddingVertical: 4, 46 | borderRadius: 4 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/commons/arrays.js: -------------------------------------------------------------------------------- 1 | export const arr_value_srouce_category = [ 2 | 'business', 3 | 'entertainment', 4 | 'gaming', 5 | 'general', 6 | 'music', 7 | 'politics', 8 | 'science-and-nature', 9 | 'sport', 10 | 'technology' 11 | ] 12 | export const arr_value_source_language = [ 13 | 'en', 14 | 'fr' 15 | ] 16 | export const arr_value_articles = [ 17 | 'top', 18 | 'latest', 19 | 'popular' 20 | ] 21 | 22 | export default { 23 | arr_value_srouce_category, 24 | arr_value_source_language, 25 | arr_value_articles 26 | } -------------------------------------------------------------------------------- /src/commons/configs.js: -------------------------------------------------------------------------------- 1 | import { Dimensions, Platform } from 'react-native' 2 | 3 | const { width, height } = Dimensions.get('window') 4 | 5 | export const configs = { 6 | screenWidth: width < height ? width : height, 7 | screenHeight: width < height ? height : width, 8 | navBarHeight: (Platform.OS === 'ios') ? 64 : 54, 9 | statusBarHeight: Platform.OS === 'ios' ? 22 : 22, 10 | paddingHorizontal: 12, 11 | paddingVertical: 8, 12 | toolBarHeight: 54, 13 | borderWidth: 1, 14 | borderRadius: 4, 15 | opacityPress: .2, 16 | snackBar: { 17 | height: 54 18 | }, 19 | button: { 20 | 21 | }, 22 | header: { 23 | height: (Platform.OS === 'ios') ? 48 : 48, 24 | }, 25 | icons: { 26 | tiny: 15, 27 | small: 20, 28 | medium: 26, 29 | large: 45, 30 | xl: 50 31 | }, 32 | images: { 33 | small: 20, 34 | medium: 40, 35 | large: 60, 36 | logo: 200 37 | }, 38 | font: { 39 | big: 16, 40 | medium: 14, 41 | small: 12, 42 | tiny: 8 43 | }, 44 | time: { 45 | showToast: 1000, 46 | showSnackBar: 1000, 47 | } 48 | } 49 | 50 | export default configs -------------------------------------------------------------------------------- /src/commons/index.js: -------------------------------------------------------------------------------- 1 | import configs from './Configs' 2 | import arrays from './Arrays' 3 | import constants from './Constants' 4 | import colors from './Colors' 5 | import styles from './Styles' 6 | import images from './Images' 7 | 8 | export { 9 | configs, 10 | arrays, 11 | constants, 12 | styles, 13 | colors, 14 | images 15 | } -------------------------------------------------------------------------------- /src/commons/json/home.json: -------------------------------------------------------------------------------- 1 | { 2 | "newsfeed": [ 3 | { 4 | "profile": { 5 | "name": "tranghy.1603", 6 | "image": "https://instagram.fhan3-1.fna.fbcdn.net/t51.2885-19/s150x150/19367895_317432235364500_4219807691897307136_a.jpg" 7 | }, 8 | "post": { 9 | "image": "https://instagram.fhan3-1.fna.fbcdn.net/t51.2885-15/e35/19429240_328983444191740_1422015546597048320_n.jpg?se=7", 10 | "like": 4058, 11 | "ratio": 1, 12 | "time": "", 13 | "comment": [ 14 | { 15 | "image": "https://instagram.fhan3-1.fna.fbcdn.net/t51.2885-19/s150x150/19367895_317432235364500_4219807691897307136_a.jpg", 16 | "name": "tranghy.1603", 17 | "content": "Nhìu khi đi quay thấy còn ăn ún đàng quàng hơn ở nhà á !!!", 18 | "time": "2017-06-28T23:57:10.000Z" 19 | }, 20 | { 21 | "image": "https://instagram.fhan3-1.fna.fbcdn.net/t51.2885-19/s150x150/19367895_317432235364500_4219807691897307136_a.jpg", 22 | "name": "bof._.15", 23 | "content": "Quay gì v ạ :)))", 24 | "time": "2017-06-28T23:57:10.000Z" 25 | }, 26 | { 27 | "image": "https://instagram.fhan3-1.fna.fbcdn.net/t51.2885-19/s150x150/19367895_317432235364500_4219807691897307136_a.jpg", 28 | "name": "thaosstagram", 29 | "content": "Quay quảng cáo của chị Đông Nhi phải hôn Changgg :))", 30 | "time": "2017-06-28T23:57:10.000Z" 31 | }, 32 | { 33 | "image": "https://instagram.fhan3-1.fna.fbcdn.net/t51.2885-19/s150x150/19367895_317432235364500_4219807691897307136_a.jpg", 34 | "name": "tranghy.1603", 35 | "content": "Nhìu khi đi quay thấy còn ăn ún đàng quàng hơn ở nhà á !!!", 36 | "time": "2017-06-28T23:57:10.000Z" 37 | }, 38 | { 39 | "image": "https://instagram.fhan3-1.fna.fbcdn.net/t51.2885-19/s150x150/19367895_317432235364500_4219807691897307136_a.jpg", 40 | "name": "bof._.15", 41 | "content": "Quay gì v ạ :)))", 42 | "time": "2017-06-28T23:57:10.000Z" 43 | }, 44 | { 45 | "image": "https://instagram.fhan3-1.fna.fbcdn.net/t51.2885-19/s150x150/19367895_317432235364500_4219807691897307136_a.jpg", 46 | "name": "thaosstagram", 47 | "content": "Quay quảng cáo của chị Đông Nhi phải hôn Changgg :))", 48 | "time": "2017-06-28T23:57:10.000Z" 49 | }, 50 | { 51 | "image": "https://instagram.fhan3-1.fna.fbcdn.net/t51.2885-19/s150x150/19367895_317432235364500_4219807691897307136_a.jpg", 52 | "name": "tranghy.1603", 53 | "content": "Nhìu khi đi quay thấy còn ăn ún đàng quàng hơn ở nhà á !!!", 54 | "time": "2017-06-28T23:57:10.000Z" 55 | }, 56 | { 57 | "image": "https://instagram.fhan3-1.fna.fbcdn.net/t51.2885-19/s150x150/19367895_317432235364500_4219807691897307136_a.jpg", 58 | "name": "bof._.15", 59 | "content": "Quay gì v ạ :)))", 60 | "time": "2017-06-28T23:57:10.000Z" 61 | }, 62 | { 63 | "image": "https://instagram.fhan3-1.fna.fbcdn.net/t51.2885-19/s150x150/19367895_317432235364500_4219807691897307136_a.jpg", 64 | "name": "thaosstagram", 65 | "content": "Quay quảng cáo của chị Đông Nhi phải hôn Changgg :))", 66 | "time": "2017-06-28T23:57:10.000Z" 67 | }, 68 | { 69 | "image": "https://instagram.fhan3-1.fna.fbcdn.net/t51.2885-19/s150x150/19367895_317432235364500_4219807691897307136_a.jpg", 70 | "name": "thaosstagram", 71 | "content": "Quay quảng cáo của chị Đông Nhi phải hôn Changgg :))", 72 | "time": "2017-06-28T23:57:10.000Z" 73 | }, 74 | { 75 | "image": "https://instagram.fhan3-1.fna.fbcdn.net/t51.2885-19/s150x150/19367895_317432235364500_4219807691897307136_a.jpg", 76 | "name": "thaosstagram", 77 | "content": "Quay quảng cáo của chị Đông Nhi phải hôn Changgg :))", 78 | "time": "2017-06-28T23:57:10.000Z" 79 | }, 80 | { 81 | "image": "https://instagram.fhan3-1.fna.fbcdn.net/t51.2885-19/s150x150/19367895_317432235364500_4219807691897307136_a.jpg", 82 | "name": "thaosstagram", 83 | "content": "Quay quảng cáo của chị Đông Nhi phải hôn Changgg :))", 84 | "time": "2017-06-28T23:57:10.000Z" 85 | } 86 | ] 87 | } 88 | }, 89 | { 90 | "profile": { 91 | "name": "luu_the_lam", 92 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s150x150/15877193_1870112409891624_5358819450994819072_n.jpg" 93 | }, 94 | "post": { 95 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-15/e35/18888402_1188623407933773_1313075049753739264_n.jpg?se=7", 96 | "ratio":1, 97 | "like": 4058, 98 | "time": "", 99 | "comment": [ 100 | { 101 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s150x150/15877193_1870112409891624_5358819450994819072_n.jpg", 102 | "name": "luu_the_lam", 103 | "content": "#butterfly", 104 | "time": "2017-06-28T23:57:10.000Z" 105 | }, 106 | { 107 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s320x320/17881179_1327020924051239_5237531429981650944_a.jpg", 108 | "name": "giangnamha", 109 | "content": "Bím", 110 | "time": "2017-06-28T23:57:10.000Z" 111 | }, 112 | { 113 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s320x320/18645568_301261020322194_7435805260985139200_a.jpg", 114 | "name": "bibo150693", 115 | "content": "Đm luu_lam mới sợ", 116 | "time": "2017-06-28T23:57:10.000Z" 117 | }, 118 | { 119 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s150x150/15877193_1870112409891624_5358819450994819072_n.jpg", 120 | "name": "luu_the_lam", 121 | "content": "@bibo150693 đm mới sợ", 122 | "time": "2017-06-28T23:57:10.000Z" 123 | }, 124 | { 125 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s320x320/18645568_301261020322194_7435805260985139200_a.jpg", 126 | "name": "bibo150693", 127 | "content": "@luu_the_lam haha", 128 | "time": "2017-06-28T23:57:10.000Z" 129 | } 130 | ] 131 | } 132 | }, 133 | { 134 | "profile": { 135 | "name": "tranghy.1603", 136 | "image": "https://instagram.fhan3-1.fna.fbcdn.net/t51.2885-19/s150x150/19367895_317432235364500_4219807691897307136_a.jpg" 137 | }, 138 | "post": { 139 | "image": "https://instagram.fhan3-1.fna.fbcdn.net/t51.2885-15/e35/19428886_243128002847908_1110663703633592320_n.jpg?se=7", 140 | "like": 4058, 141 | "ratio": 1, 142 | "time": "", 143 | "comment": [ 144 | { 145 | "image": "https://instagram.fhan3-1.fna.fbcdn.net/t51.2885-19/s150x150/19367895_317432235364500_4219807691897307136_a.jpg", 146 | "name": "tranghy.1603", 147 | "content": "Nhìu khi đi quay thấy còn ăn ún đàng quàng hơn ở nhà á !!!", 148 | "time": "2017-06-28T23:57:10.000Z" 149 | }, 150 | { 151 | "image": "https://instagram.fhan3-1.fna.fbcdn.net/t51.2885-19/s150x150/19367895_317432235364500_4219807691897307136_a.jpg", 152 | "name": "bof._.15", 153 | "content": "Quay gì v ạ :)))", 154 | "time": "2017-06-28T23:57:10.000Z" 155 | }, 156 | { 157 | "image": "https://instagram.fhan3-1.fna.fbcdn.net/t51.2885-19/s150x150/19367895_317432235364500_4219807691897307136_a.jpg", 158 | "name": "thaosstagram", 159 | "content": "Quay quảng cáo của chị Đông Nhi phải hôn Changgg :))", 160 | "time": "2017-06-28T23:57:10.000Z" 161 | } 162 | ] 163 | } 164 | }, 165 | { 166 | "profile": { 167 | "name": "luu_the_lam", 168 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s150x150/15877193_1870112409891624_5358819450994819072_n.jpg" 169 | }, 170 | "post": { 171 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-15/e35/16123160_1847679702174375_1118359739567177728_n.jpg?se=7", 172 | "ratio":1, 173 | "like": 1000, 174 | "time": "", 175 | "comment": [ 176 | { 177 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s150x150/15877193_1870112409891624_5358819450994819072_n.jpg", 178 | "name": "luu_the_lam", 179 | "content": "#chóhó", 180 | "time": "2017-06-28T23:57:10.000Z" 181 | } 182 | ] 183 | } 184 | } 185 | ], 186 | "stories": [ 187 | { 188 | "avatar": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s150x150/19428766_1219438588157948_6825595102346346496_a.jpg", 189 | "name": "ha__hoaa", 190 | "imgPost": "", 191 | "see": false 192 | }, 193 | { 194 | "avatar": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s150x150/14482193_211954805888654_388847346634457088_a.jpg", 195 | "name": "heo2409", 196 | "imgPost": "", 197 | "see": false 198 | }, 199 | { 200 | "avatar": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s150x150/19984223_1336790443106501_588892071285227520_a.jpg", 201 | "name": "district.vy", 202 | "imgPost": "", 203 | "see": true 204 | }, 205 | { 206 | "avatar": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s150x150/16229444_1483018205072126_8994056543146082304_a.jpg", 207 | "name": "dat_nguyen.adn", 208 | "imgPost": "", 209 | "see": false 210 | }, 211 | { 212 | "avatar": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s150x150/19120626_1375244229195989_3138387527228981248_a.jpg", 213 | "name": "anly1712", 214 | "imgPost": "", 215 | "see": false 216 | }, 217 | { 218 | "avatar": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s150x150/19428655_529034300553632_7491730549837398016_a.jpg", 219 | "name": "_dieugiandi_", 220 | "imgPost": "", 221 | "see": true 222 | }, 223 | { 224 | "avatar": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s150x150/16908887_1863610690595328_6898759818694098944_a.jpg", 225 | "name": "linhchenggg", 226 | "imgPost": "", 227 | "see": false 228 | } 229 | ] 230 | } -------------------------------------------------------------------------------- /src/commons/json/noti.json: -------------------------------------------------------------------------------- 1 | { 2 | "you": [ 3 | { 4 | "profile": { 5 | "name": "cucky3112", 6 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s150x150/18382111_264943103978624_1801136965559517184_a.jpg" 7 | }, 8 | "type": 1, 9 | "content": "Người bạn trên Facebook của bạn Cuc Nguyen đang dùng Instagram với tên là ", 10 | "follow": true, 11 | "image": "" 12 | }, 13 | { 14 | "profile": { 15 | "name": "thanhbuiviet", 16 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s150x150/917424_1693840294188148_762530855_a.jpg" 17 | }, 18 | "type": 1, 19 | "content": "Người bạn trên Facebook của bạn Bùi Việt Thành đang dùng Instagram với tên là ", 20 | "follow": false, 21 | "image": "" 22 | }, 23 | { 24 | "profile": { 25 | "name": "phamhong.loan", 26 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s150x150/14714490_1593472264293100_4027345590273703936_a.jpg" 27 | }, 28 | "type": 2, 29 | "content": " đã nhắc đến bạn trong một bình luận: @luu_the_lam lâm cứ bình tĩnh. K quên lâm đâu mà lo :))", 30 | "follow": false, 31 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/19379307_748780065246995_8864738573966901248_n.jpg" 32 | }, 33 | { 34 | "profile": { 35 | "name": "duongthahha", 36 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s150x150/18253039_301141767000008_4461230754247999488_a.jpg" 37 | }, 38 | "type": 2, 39 | "content": "duongthahha đã nhắc đến bạn trong một bình luận: @luu_the_lam ơ chân e dài từ nhỏ mà. He he ", 40 | "follow": false, 41 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/c0.120.960.960/19379477_1985892691681155_1385847038586912768_n.jpg" 42 | }, 43 | { 44 | "profile": { 45 | "name": "phamhong.loan", 46 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s150x150/14714490_1593472264293100_4027345590273703936_a.jpg" 47 | }, 48 | "type": 1, 49 | "content": "đã nhắc đến bạn trong một bình luận: @luu_the_lam đợi thiệp hồng trao tay nhé :))", 50 | "follow": false, 51 | "image": "" 52 | }, 53 | { 54 | "profile": { 55 | "name": "haivh2111", 56 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s150x150/18161859_206036223240272_8789700586158161920_a.jpg" 57 | }, 58 | "type": 2, 59 | "content": "haivh2111 đã bình luận: #lamgiun", 60 | "follow": false, 61 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-15/e35/c236.0.608.608/18879777_236194843550393_6589419519368757248_n.jpg" 62 | }, 63 | { 64 | "profile": { 65 | "name": "haivh2111", 66 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s150x150/18161859_206036223240272_8789700586158161920_a.jpg" 67 | }, 68 | "type": 2, 69 | "content": "haivh2111 đã thích ảnh của bạn.", 70 | "follow": false, 71 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-15/e35/c236.0.608.608/18879777_236194843550393_6589419519368757248_n.jpg" 72 | }, 73 | { 74 | "profile": { 75 | "name": "phamhong.loan", 76 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s150x150/19428655_529034300553632_7491730549837398016_a.jpg" 77 | }, 78 | "type": 1, 79 | "content": "Người bạn trên Facebook của bạn Xuân Trường đang dùng Instagram với tên là ", 80 | "follow": true, 81 | "image": "" 82 | }, 83 | { 84 | "profile": { 85 | "name": "phamhong.loan", 86 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s150x150/14701132_208600552897457_3890490099518930944_a.jpg" 87 | }, 88 | "type": 1, 89 | "content": "Người bạn trên Facebook của bạn hoàng thị như quỳnh đang dùng Instagram với tên là qhoangthinhu", 90 | "follow": false, 91 | "image": "" 92 | }, 93 | { 94 | "profile": { 95 | "name": "phamhong.loan", 96 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s150x150/14714490_1593472264293100_4027345590273703936_a.jpg" 97 | }, 98 | "type": 2, 99 | "content": "huyeen_trangg đã nhắc đến bạn trong một bình luận: @luu_the_lam nó đẹp trai hơn mày chắc luôn", 100 | "follow": false, 101 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/18722524_135107640380905_7176352978192826368_n.jpg" 102 | }, 103 | { 104 | "profile": { 105 | "name": "phamhong.loan", 106 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s150x150/14714490_1593472264293100_4027345590273703936_a.jpg" 107 | }, 108 | "type": 2, 109 | "content": " đã nhắc đến bạn trong một bình luận: @luu_the_lam lâm cứ bình tĩnh. K quên lâm đâu mà lo :))", 110 | "follow": false, 111 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/19379307_748780065246995_8864738573966901248_n.jpg" 112 | }, 113 | { 114 | "profile": { 115 | "name": "duongthahha", 116 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s150x150/18253039_301141767000008_4461230754247999488_a.jpg" 117 | }, 118 | "type": 2, 119 | "content": "duongthahha đã nhắc đến bạn trong một bình luận: @luu_the_lam ơ chân e dài từ nhỏ mà. He he ", 120 | "follow": false, 121 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/c0.120.960.960/19379477_1985892691681155_1385847038586912768_n.jpg" 122 | }, 123 | { 124 | "profile": { 125 | "name": "phamhong.loan", 126 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s150x150/14714490_1593472264293100_4027345590273703936_a.jpg" 127 | }, 128 | "type": 1, 129 | "content": "đã nhắc đến bạn trong một bình luận: @luu_the_lam đợi thiệp hồng trao tay nhé :))", 130 | "follow": false, 131 | "image": "" 132 | } 133 | ] 134 | } -------------------------------------------------------------------------------- /src/commons/json/profile.json: -------------------------------------------------------------------------------- 1 | { 2 | "profile": { 3 | "avatar": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s150x150/15877193_1870112409891624_5358819450994819072_n.jpg", 4 | "index": { 5 | "post": 5, 6 | "followers": 53, 7 | "following": 39 8 | } 9 | }, 10 | "arrImage": [ 11 | "https://instagram.fhan3-1.fna.fbcdn.net/t51.2885-15/e35/19429240_328983444191740_1422015546597048320_n.jpg?se=7", 12 | "https://instagram.fhan3-1.fna.fbcdn.net/t51.2885-15/e35/19428886_243128002847908_1110663703633592320_n.jpg?se=7" 13 | ], 14 | "timeline": [ 15 | { 16 | "profile": { 17 | "name": "luu_the_lam", 18 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s150x150/15877193_1870112409891624_5358819450994819072_n.jpg" 19 | }, 20 | "post": { 21 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-15/e35/18879777_236194843550393_6589419519368757248_n.jpg?se=7", 22 | "ratio":1.7, 23 | "like": 17, 24 | "time": "", 25 | "comment": [ 26 | { 27 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s150x150/15877193_1870112409891624_5358819450994819072_n.jpg", 28 | "name": "luu_the_lam", 29 | "content": "#ócc #hihi", 30 | "time": "2017-06-28T23:57:10.000Z" 31 | }, 32 | { 33 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s320x320/15043445_1798028067117526_5139296401116626944_a.jpg", 34 | "name": "huyeen_trangg", 35 | "content": "Lâm occ", 36 | "time": "2017-06-28T23:57:10.000Z" 37 | }, 38 | { 39 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s150x150/15877193_1870112409891624_5358819450994819072_n.jpg", 40 | "name": "luu_the_lam", 41 | "content": "#trang mày làm đéo có óc mà nói chuyện", 42 | "time": "2017-06-28T23:57:10.000Z" 43 | }, 44 | { 45 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s320x320/18161859_206036223240272_8789700586158161920_a.jpg", 46 | "name": "haivh2111", 47 | "content": "#lamgiun", 48 | "time": "2017-06-28T23:57:10.000Z" 49 | }, 50 | { 51 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s150x150/15877193_1870112409891624_5358819450994819072_n.jpg", 52 | "name": "luu_the_lam", 53 | "content": "Ngập mồm nhà a #hai", 54 | "time": "2017-06-28T23:57:10.000Z" 55 | }, 56 | { 57 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s320x320/18645568_301261020322194_7435805260985139200_a.jpg", 58 | "name": "bibo150693", 59 | "content": "Đm nhìn m bt vcc", 60 | "time": "2017-06-28T23:57:10.000Z" 61 | }, 62 | { 63 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s150x150/15877193_1870112409891624_5358819450994819072_n.jpg", 64 | "name": "luu_the_lam", 65 | "content": "Mở mồm là đ @bibo150693", 66 | "time": "2017-06-28T23:57:10.000Z" 67 | } 68 | ] 69 | } 70 | }, 71 | { 72 | "profile": { 73 | "name": "luu_the_lam", 74 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s150x150/15877193_1870112409891624_5358819450994819072_n.jpg" 75 | }, 76 | "post": { 77 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-15/e35/18888402_1188623407933773_1313075049753739264_n.jpg?se=7", 78 | "ratio":1, 79 | "like": 4058, 80 | "time": "", 81 | "comment": [ 82 | { 83 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s150x150/15877193_1870112409891624_5358819450994819072_n.jpg", 84 | "name": "luu_the_lam", 85 | "content": "#butterfly", 86 | "time": "2017-06-28T23:57:10.000Z" 87 | }, 88 | { 89 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s320x320/17881179_1327020924051239_5237531429981650944_a.jpg", 90 | "name": "giangnamha", 91 | "content": "Bím", 92 | "time": "2017-06-28T23:57:10.000Z" 93 | }, 94 | { 95 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s320x320/18645568_301261020322194_7435805260985139200_a.jpg", 96 | "name": "bibo150693", 97 | "content": "Đm luu_lam mới sợ", 98 | "time": "2017-06-28T23:57:10.000Z" 99 | }, 100 | { 101 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s150x150/15877193_1870112409891624_5358819450994819072_n.jpg", 102 | "name": "luu_the_lam", 103 | "content": "@bibo150693 đm mới sợ", 104 | "time": "2017-06-28T23:57:10.000Z" 105 | }, 106 | { 107 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s320x320/18645568_301261020322194_7435805260985139200_a.jpg", 108 | "name": "bibo150693", 109 | "content": "@luu_the_lam haha", 110 | "time": "2017-06-28T23:57:10.000Z" 111 | } 112 | ] 113 | } 114 | }, 115 | { 116 | "profile": { 117 | "name": "luu_the_lam", 118 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s150x150/15877193_1870112409891624_5358819450994819072_n.jpg" 119 | }, 120 | "post": { 121 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-15/e35/16123160_1847679702174375_1118359739567177728_n.jpg?se=7", 122 | "ratio":1, 123 | "like": 1000, 124 | "time": "", 125 | "comment": [ 126 | { 127 | "image": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s150x150/15877193_1870112409891624_5358819450994819072_n.jpg", 128 | "name": "luu_the_lam", 129 | "content": "#chóhó", 130 | "time": "2017-06-28T23:57:10.000Z" 131 | } 132 | ] 133 | } 134 | } 135 | ] 136 | } -------------------------------------------------------------------------------- /src/commons/json/search.json: -------------------------------------------------------------------------------- 1 | { 2 | "search": [ 3 | "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-15/s320x320/e35/c202.0.675.675/19955380_1927086587565935_8798445581954449408_n.jpg", 4 | "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-15/s320x320/e35/c0.135.1080.1080/20065952_1471311322891780_785622721860993024_n.jpg", 5 | "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-15/s320x320/e35/19932375_1808882255793681_3420023835796176896_n.jpg", 6 | "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-15/s320x320/e35/c0.12.1080.1080/19984916_1046507992151279_488138847259983872_n.jpg", 7 | "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-15/s320x320/e35/c0.103.960.960/19985347_1402662129770784_397870596181983232_n.jpg", 8 | "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-15/s320x320/e35/c0.60.1080.1080/19984893_169502433593400_5922429235946848256_n.jpg", 9 | "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-15/s320x320/e15/c236.0.607.607/19933201_503496240001953_1128037859958194176_n.jpg", 10 | "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-15/s320x320/e35/19985403_320024318440869_6795405300481392640_n.jpg", 11 | "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-15/s320x320/e35/c0.104.1080.1080/19765128_557304487773309_4452269708711821312_n.jpg", 12 | "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-15/s320x320/e35/19932092_1392834074119734_4882064221279354880_n.jpg", 13 | "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-15/s320x320/e35/19955378_154176955130695_2045531956300480512_n.jpg", 14 | "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-15/s320x320/e35/c174.0.731.731/19955809_462057597486069_6471692064898678784_n.jpg", 15 | "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-15/s320x320/e35/19985377_1359252720794547_853592842767958016_n.jpg", 16 | "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-15/s320x320/e15/c0.90.720.720/19985098_123173398293908_3786251187410436096_n.jpg", 17 | "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-15/s320x320/e35/19932607_1887747664799492_1888269881921503232_n.jpg", 18 | "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-15/s320x320/e35/c120.0.720.720/19931542_271879776627826_7716965777370251264_n.jpg", 19 | "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-15/s320x320/e15/c120.0.480.480/20065328_451961241826505_4736320918475767808_n.jpg", 20 | "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-15/s320x320/e35/c0.135.1080.1080/19762022_431836660535820_2386850353023811584_n.jpg", 21 | "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-15/s320x320/e15/c0.90.720.720/19984274_1754073181277478_6057853106727682048_n.jpg" 22 | ], 23 | "stories": [ 24 | { 25 | "avatar": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/11850309_1674349799447611_206178162_a.jpg", 26 | "name": "therock", 27 | "imgPost": "", 28 | "see": false 29 | }, 30 | { 31 | "avatar": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s150x150/17494080_1418325768226925_1117931681651621888_a.jpg", 32 | "name": "_hghxm", 33 | "imgPost": "", 34 | "see": false 35 | }, 36 | { 37 | "avatar": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s150x150/17663810_1148490078593953_8056133950256447488_a.jpg", 38 | "name": "trinh.phamm", 39 | "imgPost": "", 40 | "see": true 41 | }, 42 | { 43 | "avatar": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s150x150/18380785_1288637687919465_6117053518596538368_a.jpg", 44 | "name": "ulzzangofficialll", 45 | "imgPost": "", 46 | "see": false 47 | }, 48 | { 49 | "avatar": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s150x150/19761481_288305194911630_7915016988655616000_a.jpg", 50 | "name": "im.bean.bean", 51 | "imgPost": "", 52 | "see": false 53 | }, 54 | { 55 | "avatar": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s150x150/17818031_1414803015208169_1579077312291274752_a.jpg", 56 | "name": "welax_official", 57 | "imgPost": "", 58 | "see": true 59 | }, 60 | { 61 | "avatar": "https://instagram.fhan5-1.fna.fbcdn.net/t51.2885-19/s150x150/19535481_327630924341562_4544139626108944384_a.jpg", 62 | "name": "_pemhs", 63 | "imgPost": "", 64 | "see": false 65 | } 66 | ] 67 | } -------------------------------------------------------------------------------- /src/components/Header.js: -------------------------------------------------------------------------------- 1 | import React, { Component, PropTypes } from 'react' 2 | import { View, Text } from 'react-native' 3 | import { configs, colors } from '../commons' 4 | import styles from './styles/Header' 5 | import { Icon } from '../components' 6 | 7 | /** 8 | * @type 'center','center-left','center-right','text-left' 9 | */ 10 | class Header extends Component { 11 | renderChilder() { 12 | if (!Array.isArray(this.props.children)) { 13 | return this.props.children; 14 | } 15 | 16 | let icon = this.props.children.filter((item) => { 17 | return item.type == Icon; 18 | }) 19 | 20 | let text = this.props.children.filter((item) => { 21 | return item.type == Text; 22 | }) 23 | let other = this.props.children.filter((item) => { 24 | return item.type != Text && item.type != Icon 25 | }) 26 | if (this.props.left) { 27 | return ( 28 | [ 29 | {text} 30 | , 31 | 32 | {icon} 33 | ] 34 | ) 35 | } 36 | if (this.props.right) { 37 | return ( 38 | [ 39 | 40 | {icon} 41 | , 42 | 43 | {text} 44 | 45 | ] 46 | ) 47 | } 48 | 49 | return ( 50 | [ 51 | 52 | {icon[0]} 53 | , 54 | 55 | {[...text, ...other]} 56 | , 57 | 58 | {icon.length == 1 && } 59 | {icon.length > 1 && icon.slice(1)} 60 | 61 | ] 62 | ) 63 | 64 | } 65 | 66 | render() { 67 | return ( 68 | 69 | {this.renderChilder()} 70 | 71 | ) 72 | } 73 | } 74 | 75 | export default Header -------------------------------------------------------------------------------- /src/components/Icon.js: -------------------------------------------------------------------------------- 1 | import React, { PropTypes } from 'react' 2 | import Icon from 'react-native-vector-icons/MaterialIcons' 3 | import { TouchableOpacity } from 'react-native' 4 | import Platform from 'Platform' 5 | import { configs, colors } from '../commons' 6 | 7 | const IconApp = ({ 8 | name, 9 | size, 10 | style, 11 | color, 12 | onPress, 13 | hide 14 | }) => { 15 | return ( 16 | 21 | ) 22 | } 23 | 24 | Icon.propTypes = { 25 | name: PropTypes.string, 26 | size: PropTypes.number, 27 | style: PropTypes.object, 28 | } 29 | 30 | Icon.defaultProps = { 31 | size: configs.icons.medium, 32 | color: 'black', 33 | name: 'help' 34 | } 35 | 36 | export default IconApp -------------------------------------------------------------------------------- /src/components/SnackBar.js: -------------------------------------------------------------------------------- 1 | import React, { PropTypes, Component } from 'react' 2 | import { connect } from 'react-redux'; 3 | import { View , Text } from 'react-native'; 4 | import { configs } from '../commons' 5 | import styles from './styles/SnackBar' 6 | 7 | class SnackBar extends Component { 8 | static propTypes = { 9 | snackBars: PropTypes.array, 10 | } 11 | 12 | static defaultProps = { 13 | snackBars: [] 14 | } 15 | 16 | render() { 17 | if (this.props.snackBars.length === 0) return null 18 | return ( 19 | 20 | { 21 | this.props.snackBars.map((value, index) => { 22 | return ( 23 | 24 | {value['title']} 25 | 26 | ) 27 | }) 28 | } 29 | {this.props.children} 30 | 31 | ) 32 | } 33 | } 34 | const mapStateToProps = (state, ownProps) => { 35 | return { 36 | snackBars: state.app.snaskBars, 37 | state: state 38 | } 39 | } 40 | export default connect(mapStateToProps)(SnackBar) 41 | -------------------------------------------------------------------------------- /src/components/Stories.js: -------------------------------------------------------------------------------- 1 | import React, { PropTypes, Component } from 'react' 2 | import { View, Text, FlatList, Image } from 'react-native'; 3 | import { configs, images } from '../commons' 4 | import styles from './styles/Stories' 5 | 6 | 7 | class Stories extends Component { 8 | renderStorie = ({ item }) => { 9 | return ( 10 | 11 | 12 | {item['see'] ? : } 13 | 14 | 15 | {item['name']} 16 | 17 | 18 | ) 19 | } 20 | render() { 21 | const { data } = this.props 22 | return ( 23 | 24 | index} 29 | data={data} 30 | renderItem={this.renderStorie} 31 | /> 32 | 33 | 34 | ) 35 | } 36 | } 37 | export default Stories 38 | -------------------------------------------------------------------------------- /src/components/Timeline.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import { connect } from 'react-redux'; 3 | import { View, Text, ScrollView, FlatList, Image, TouchableOpacity } from 'react-native' 4 | import { Header, Icon } from '../components' 5 | import { fetchApp, coveSize } from '../helper' 6 | import { configs, constants, arrays } from '../commons' 7 | import styles from './styles/Timeline' 8 | 9 | class Timeline extends Component { 10 | 11 | static navigationOptions = { 12 | tabBarIcon: ({ tintColor }) => ( 13 | 14 | ), 15 | } 16 | 17 | rendercomments = (args) => { 18 | if (args.length < 5) { 19 | return args.map((val, ind) => 20 | this.props.onPress(args)}> 23 | 24 | {val.name} {val.content} 25 | 26 | ) 27 | 28 | } 29 | return ( 30 | this.props.onPress(args)}> 32 | 33 | {args[0].name} {args[0].content} 34 | 35 | {`View all ${args.length} comments`} 36 | 37 | ) 38 | } 39 | 40 | renderPost = ({ item }) => { 41 | if (!item) return null 42 | return ( 43 | 44 | 45 | 46 | {item['profile']['name']} 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | {`${item['post']['like']} likes`} 59 | {this.rendercomments(item['post']['comment'])} 60 | 61 | 62 | ) 63 | } 64 | render() { 65 | let { data, viewOnlyImage } = this.props 66 | return ( 67 | index} 72 | data={data} 73 | renderItem={this.renderPost} 74 | /> 75 | ) 76 | } 77 | } 78 | 79 | export default Timeline -------------------------------------------------------------------------------- /src/components/Toast.js: -------------------------------------------------------------------------------- 1 | import React, { PropTypes, Component } from 'react' 2 | import { connect } from 'react-redux'; 3 | import { View, Text } from 'react-native'; 4 | import { configs } from '../commons' 5 | import styles from './styles/Toast' 6 | 7 | 8 | class Toast extends Component { 9 | static propTypes = { 10 | toasts: PropTypes.array, 11 | } 12 | 13 | static defaultProps = { 14 | toasts: [] 15 | } 16 | 17 | render() { 18 | if (this.props.toasts.length === 0) return null 19 | return ( 20 | 21 | { 22 | this.props.toasts.map((value, index) => { 23 | return ( 24 | 25 | {value['title']} 26 | 27 | ) 28 | }) 29 | } 30 | {this.props.children} 31 | 32 | ) 33 | } 34 | } 35 | const mapStateToProps = (state, ownProps) => { 36 | return { 37 | toasts: state.app.toasts, 38 | } 39 | } 40 | export default connect(mapStateToProps)(Toast) 41 | -------------------------------------------------------------------------------- /src/components/index.js: -------------------------------------------------------------------------------- 1 | 2 | import SnackBar from './SnackBar' 3 | import Toast from './Toast' 4 | import Header from './Header' 5 | import Icon from './Icon' 6 | import Timeline from './Timeline' 7 | import Stories from './Stories' 8 | 9 | export { 10 | SnackBar, 11 | Toast, 12 | Header, 13 | Icon, 14 | Timeline, 15 | Stories 16 | } 17 | export default { 18 | SnackBar, 19 | Toast, 20 | Header, 21 | Icon, 22 | Timeline, 23 | Stories 24 | } -------------------------------------------------------------------------------- /src/components/styles/Header.js: -------------------------------------------------------------------------------- 1 | import { configs, colors } from '../../commons' 2 | 3 | const styles = { 4 | constant: { 5 | alignItems: 'center', 6 | padding: 6, 7 | flexDirection: 'row', 8 | width: configs.screenWidth, 9 | height: configs.header.height, 10 | backgroundColor: 'white', 11 | shadowOpacity: 1, 12 | elevation: 1 13 | }, 14 | } 15 | export default styles -------------------------------------------------------------------------------- /src/components/styles/SnackBar.js: -------------------------------------------------------------------------------- 1 | import { configs, colors } from '../../commons' 2 | 3 | const styles = { 4 | constant: { 5 | bottom: 0, 6 | left: 0, 7 | height: configs.snackBar.height, 8 | width: configs.screenWidth, 9 | backgroundColor: 'black', 10 | position: 'absolute', 11 | zIndex: 1000, 12 | padding: 20, 13 | justifyContent: 'center', 14 | flexDirection: 'column' 15 | }, 16 | } 17 | export default styles -------------------------------------------------------------------------------- /src/components/styles/Stories.js: -------------------------------------------------------------------------------- 1 | import { configs, colors, styles } from '../../commons' 2 | 3 | export default style = { 4 | ...styles, 5 | const: { 6 | alignItems: 'center', 7 | paddingRight: 6 8 | }, 9 | bgAva: { 10 | width: 68, 11 | height: 68, 12 | borderRadius: 34, 13 | margin: 6 14 | }, 15 | see: { 16 | width: 66, 17 | height: 66, 18 | borderRadius: 34, 19 | backgroundColor: colors.cover, 20 | marginTop: 1, 21 | marginLeft: 1 22 | }, 23 | noSee: { 24 | width: 68, 25 | height: 68, 26 | borderRadius: 34 27 | }, 28 | ava: { 29 | borderWidth: 2, 30 | borderColor: 'white', 31 | width: 64, 32 | height: 64, 33 | borderRadius: 32, 34 | position: 'absolute', 35 | top: 2, 36 | left: 2 37 | }, 38 | } 39 | -------------------------------------------------------------------------------- /src/components/styles/Timeline.js: -------------------------------------------------------------------------------- 1 | import { configs, colors, styles } from '../../commons' 2 | 3 | export default style = { 4 | ...styles, 5 | constant: { 6 | backgroundColor: '#FAFAFA', 7 | width: configs.screenWidth, 8 | height: configs.screenHeight 9 | }, 10 | iconTabbg: { 11 | borderRadius: 8, 12 | padding: 4 13 | }, 14 | headerPost: { 15 | flexDirection: 'row', 16 | alignItems: 'center', 17 | height: 48, 18 | ...styles.appLine, 19 | paddingHorizontal: 14 20 | 21 | }, 22 | headerIcon: { 23 | width: 30, 24 | height: 30, 25 | borderRadius: 15 26 | }, 27 | comment: { 28 | flexDirection: 'row', 29 | alignItems: 'center', 30 | paddingHorizontal: 4 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/components/styles/Toast.js: -------------------------------------------------------------------------------- 1 | import { configs, colors } from '../../commons' 2 | 3 | const styles = { 4 | constant: { 5 | bottom: 0, 6 | left: 0, 7 | right: 0, 8 | justifyContent: 'center', 9 | position: 'absolute', 10 | }, 11 | border: { 12 | backgroundColor: 'white', 13 | padding: 10, 14 | marginBottom: 20, 15 | marginHorizontal: 40, 16 | borderRadius: 40, 17 | alignItems: 'center' 18 | }, 19 | text: { 20 | color: colors.toastText 21 | } 22 | } 23 | 24 | export default styles -------------------------------------------------------------------------------- /src/helper/AsyncStorage.js: -------------------------------------------------------------------------------- 1 | import { AsyncStorage } from 'react-native'; 2 | /** 3 | * 4 | * @param {*string} args 5 | * @return {promise} 6 | */ 7 | const get = function (...args) { 8 | return new Promise.all(args.map((v, i) => { 9 | return new Promise((resolve, reject) => { 10 | AsyncStorage.getItem(v, (err, result) => { 11 | if (err !== null) reject(err) 12 | resolve(result) 13 | }); 14 | }) 15 | })) 16 | } 17 | 18 | 19 | /** 20 | * -- save multi to asyncStorage 21 | * @param {object{[key:value]}} args 22 | * @return {promise} 23 | */ 24 | 25 | const set = function (args) { 26 | return new Promise.all(Object.keys(args).map((v, i) => { 27 | return new Promise((resolve, reject) => { 28 | AsyncStorage.setItem(v, args[v], (err) => { 29 | if (err !== null) reject('Appstorage set', err) 30 | resolve() 31 | }); 32 | }) 33 | })) 34 | } 35 | 36 | 37 | export default { 38 | get, set 39 | } -------------------------------------------------------------------------------- /src/helper/Fetch.js: -------------------------------------------------------------------------------- 1 | import { constants } from '../commons' 2 | 3 | const getTimeline = function (arg) { 4 | return new Promise((resolve, reject) => { 5 | fetch(`${constants.TIMELINE}`) 6 | .then((response) => response.json()) 7 | .then((response) => { 8 | resolve(response) 9 | }) 10 | .catch((error) => { 11 | console.log('getTimeline', error) 12 | reject(error) 13 | }) 14 | }) 15 | } 16 | 17 | const getArticles = function (arg) { 18 | return new Promise((resolve, reject) => { 19 | fetch(`${constants.URL_SOURCE}${arg.category ? 'source=' + arg.category : ''}${arg.language ? '&sortBy=' + arg.language : ''}`) 20 | .then((response) => response.json) 21 | .then((response) => { 22 | resolve(response) 23 | }) 24 | .catch((error) => { 25 | console.log('getArticles', error) 26 | reject(error) 27 | }) 28 | }) 29 | } 30 | export default { 31 | getTimeline, 32 | getArticles 33 | } -------------------------------------------------------------------------------- /src/helper/index.js: -------------------------------------------------------------------------------- 1 | import { Platform, AsyncStorage } from 'react-native'; 2 | import { configs } from '../commons' 3 | import fetchApp from './Fetch' 4 | import asyncSto from './AsyncStorage' 5 | const getPlatformValue = function (iosValue, androidValue) { 6 | if (Platform.OS === 'ios') return iosValue; 7 | return androidValue 8 | } 9 | 10 | const isNull = function (obj) { 11 | if (obj === undefined || obj === null || obj === '' || obj.length <= 0) return true 12 | return false 13 | } 14 | 15 | const getObj = function (obj, ...args) { 16 | for (let i = 0; i < args.length; i++) { 17 | if (!obj || obj[args[i]] === undefined) { 18 | return undefined; 19 | } 20 | obj = obj[args[i]]; 21 | } 22 | return obj; 23 | } 24 | const coveSize = (ratio) => { 25 | if (ratio < 1) return { 26 | height: configs.screenWidth, 27 | width: configs.screenWidth * (ratio) 28 | } 29 | return { 30 | width: configs.screenWidth, 31 | height: configs.screenWidth / (ratio) 32 | } 33 | } 34 | const promise = () => action => next => ( 35 | typeof action.then === 'function' 36 | ? Promise.resolve(action).then(next, (error) => { throw error }) 37 | : next(action) 38 | ) 39 | 40 | // check object exist array 41 | const checkObjectInArray = function (object, array) { 42 | if (array.indexOf(object) === -1) return false 43 | return true 44 | } 45 | 46 | export { 47 | getPlatformValue, 48 | isNull, 49 | getObj, 50 | promise, 51 | coveSize, 52 | checkObjectInArray, 53 | fetchApp, 54 | asyncSto, 55 | 56 | } -------------------------------------------------------------------------------- /src/redux/actions/app.js: -------------------------------------------------------------------------------- 1 | import { configs } from '../../commons' 2 | 3 | const uuidV4 = require('uuid/v4'); 4 | 5 | export const ADD_SNACKBAR = 'ADD_SNACKBAR' 6 | export const REMOVE_SNACKBAR = 'REMOVE_SNACKBAR' 7 | export const ADD_TOAST = 'ADD_TOAST' 8 | export const REMOVE_TOAST = 'REMOVE_TOAST' 9 | 10 | // action of TOAST 11 | function addSnackBar(id, title) { 12 | return { 13 | type: ADD_SNACKBAR, 14 | id: id, 15 | title: title, 16 | } 17 | } 18 | 19 | function hideSnackBar(id) { 20 | return { 21 | type: REMOVE_SNACKBAR, 22 | id: id, 23 | } 24 | } 25 | 26 | export function showSnackBar(title, timeout) { 27 | return dispatch => { 28 | let id = uuidV4() 29 | dispatch(addSnackBar(id, title)) 30 | setTimeout(function () { 31 | dispatch(hideSnackBar(id)) 32 | }, timeout === undefined ? configs.time.showSnackBar : timeout); 33 | } 34 | } 35 | 36 | // action of SNACKBAR 37 | function addToast(id, title) { 38 | return { 39 | type: ADD_TOAST, 40 | id: id, 41 | title: title, 42 | } 43 | } 44 | 45 | function hideToast(id) { 46 | return { 47 | type: REMOVE_TOAST, 48 | id: id, 49 | } 50 | } 51 | 52 | export function showToast(title, timeout) { 53 | return dispatch => { 54 | let id = uuidV4() 55 | dispatch(addToast(id, title)) 56 | setTimeout(function () { 57 | dispatch(hideToast(id)) 58 | }, timeout === undefined ? configs.time.showSnackBar : timeout); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/redux/actions/index.js: -------------------------------------------------------------------------------- 1 | import * as app from './App' 2 | 3 | export { 4 | app 5 | } 6 | export default { 7 | ...app 8 | } -------------------------------------------------------------------------------- /src/redux/reducers/app.js: -------------------------------------------------------------------------------- 1 | import { GET_APP, ADD_SNACKBAR, REMOVE_SNACKBAR, ADD_TOAST, REMOVE_TOAST } from '../actions/App' 2 | 3 | const INITIAL = { 4 | snaskBars: [], 5 | toasts: [] 6 | }; 7 | 8 | export default (state = INITIAL, action) => { 9 | switch (action.type) { 10 | case ADD_SNACKBAR: 11 | return Object.assign({}, state, { 12 | snaskBars: state.snaskBars.concat({ 13 | id: action['id'], 14 | title: action['title'] 15 | }) 16 | }) 17 | case REMOVE_SNACKBAR: 18 | let indexSnasckBar = state.snaskBars.findIndex(value => value['id'] === action['id']) 19 | return Object.assign({}, state, { 20 | snaskBars: [...state.snaskBars.slice(0, indexSnasckBar), ...state.snaskBars.slice(indexSnasckBar + 1)] 21 | }) 22 | case ADD_TOAST: 23 | return Object.assign({}, state, { 24 | toasts: state.toasts.concat({ 25 | id: action['id'], 26 | title: action['title'] 27 | }) 28 | }) 29 | case REMOVE_TOAST: 30 | let indexToast = state.toasts.findIndex(value => value['id'] === action['id']) 31 | return Object.assign({}, state, { 32 | toasts: [...state.toasts.slice(0, indexToast), ...state.toasts.slice(indexToast + 1)] 33 | }) 34 | default: 35 | return state; 36 | } 37 | }; -------------------------------------------------------------------------------- /src/redux/reducers/index.js: -------------------------------------------------------------------------------- 1 | import {combineReducers} from 'redux'; 2 | 3 | import app from './App'; 4 | 5 | export default combineReducers({ 6 | app 7 | }); 8 | -------------------------------------------------------------------------------- /src/scenes/Camera.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import { connect } from 'react-redux'; 3 | import { View, Text, TouchableOpacity, Platform } from 'react-native' 4 | import { configs, constants, arrays } from '../commons' 5 | import { Header, Icon } from '../components' 6 | import { showSnackBar, showToast } from '../redux/actions/App' 7 | import styles from './styles/Camera' 8 | import Camera from 'react-native-camera'; 9 | class TakePhoto extends Component { 10 | //oprion Header 11 | static navigationOptions = { 12 | tabBarVisible: false 13 | }; 14 | 15 | render() { 16 | const { navigate } = this.props.navigation; 17 | return ( 18 | 19 | {Platform.OS === 'android' ? { 21 | this.camera = cam; 22 | }} 23 | style={styles.cameraConst} 24 | aspect={Camera.constants.Aspect.fill}> 25 | 26 |
27 | 28 | this.props.navigation.navigate('Home')} color='white' /> 29 |
30 | 31 | this.takePicture()} 33 | style={styles.takeCamera} 34 | /> 35 |
: null} 36 | 37 |
38 | ) 39 | } 40 | takePicture = () => { 41 | const options = {}; 42 | this.camera.capture({ metadata: options }) 43 | .then((data) => console.log(data)) 44 | .catch(err => console.error(err)); 45 | } 46 | } 47 | export default TakePhoto -------------------------------------------------------------------------------- /src/scenes/Comments.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import { connect } from 'react-redux'; 3 | import { View, Text, FlatList, Image, TouchableOpacity, TextInput, Keyboard } from 'react-native' 4 | import { Header, Icon } from '../components' 5 | import { configs, constants, arrays } from '../commons' 6 | import { showSnackBar, showToast } from '../redux/actions/App' 7 | import styles from './styles/Comments' 8 | 9 | class Comments extends Component { 10 | //oprion Header 11 | static navigationOptions = { 12 | tabBarVisible: false 13 | }; 14 | 15 | state = { 16 | data: [], 17 | text: '', 18 | keyboardHeight: 0 19 | } 20 | renderComment = ({ item }) => { 21 | if (!item) return null 22 | return ( 23 | 24 | 25 | 26 | {item.name} {item.content} 27 | 28 | 29 | ) 30 | } 31 | componentWillMount() { 32 | this.keyboardDidShowListener = Keyboard.addListener('keyboardWillShow', this.keyboardDidShow) 33 | this.keyboardDidHideListener = Keyboard.addListener('keyboardWillHide', this.keyboardDidHide) 34 | } 35 | componentDidMount() { 36 | this.setState({ data: this.props.navigation.state.params.data }) 37 | } 38 | 39 | render() { 40 | const { navigate, state } = this.props.navigation 41 | return ( 42 | 43 |
44 | this.props.navigation.goBack()} /> 45 | Comments 46 |
47 | 48 | this.listRoot = compo} 50 | style={{ height: configs.screenHeight - 48 - 10 - 12 - 48 - this.state.keyboardHeight, width: configs.screenWidth }} 51 | removeClippedSubviews={false} 52 | showsVerticalScrollIndicator={false} 53 | keyExtractor={(item, index) => index} 54 | data={state.params.data} 55 | renderItem={this.renderComment} 56 | /> 57 | 58 | this.setState({ text })} 62 | value={this.state.text} 63 | /> 64 | this.setState({ text: '' })}> 65 | 66 | 67 | 68 | 69 |
70 | ) 71 | } 72 | componentWillUnmount() { 73 | this.keyboardDidShowListener.remove() 74 | this.keyboardDidHideListener.remove() 75 | } 76 | 77 | keyboardDidShow = (e) => { 78 | // setTimeout(() => { this.listRoot.scrollToEnd() }, 100) 79 | this.setState({ 80 | keyboardHeight: e.endCoordinates.height, 81 | }) 82 | } 83 | 84 | keyboardDidHide = (e) => { 85 | this.setState({ 86 | keyboardHeight: 0 87 | }) 88 | } 89 | } 90 | 91 | export default Comments -------------------------------------------------------------------------------- /src/scenes/Home.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import { connect } from 'react-redux'; 3 | import { View, Text, ScrollView, FlatList, Image, TouchableOpacity } from 'react-native' 4 | import { Header, Icon, Timeline, Stories } from '../components' 5 | import { fetchApp } from '../helper' 6 | import { configs, constants, arrays } from '../commons' 7 | import styles from './styles/Home' 8 | class Home extends Component { 9 | 10 | static navigationOptions = { 11 | tabBarIcon: ({ tintColor }) => ( 12 | 13 | ), 14 | } 15 | 16 | state = { 17 | sourceList: require('../commons/json/home.json') 18 | } 19 | renderHeader = () => { 20 | const { sourceList } = this.state 21 | return 22 | 23 | Stories 24 | Watch All 25 | 26 | 27 | 28 | } 29 | render() { 30 | const { navigate } = this.props.navigation; 31 | const { sourceList } = this.state 32 | return ( 33 | 34 |
35 | DEMO 36 | this.props.navigation.navigate('Camera')} /> 37 | this.props.navigation.navigate('Messages')} /> 38 |
39 | 40 | navigate('Comments', { data: args })} 42 | ListHeaderComponent={this.renderHeader} /> 43 |
44 | ) 45 | } 46 | } 47 | 48 | export default Home -------------------------------------------------------------------------------- /src/scenes/Main.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import { TabNavigator, TabBarBottom, StackNavigator } from 'react-navigation' 3 | import Home from './Home' 4 | import Camera from './Camera' 5 | import Messages from './Messages' 6 | import Comments from './Comments' 7 | const Navigation = TabNavigator({ 8 | Camera: { 9 | screen: Camera, 10 | }, 11 | Home: { 12 | screen: Home, 13 | }, 14 | Messages: { 15 | screen: Messages 16 | } 17 | }, 18 | { 19 | initialRouteName: 'Home', 20 | swipeEnabled: true, 21 | animationEnabled: false, 22 | lazy: true, 23 | tabBarComponent: TabBarBottom, 24 | tabBarOptions: { 25 | style: { 26 | width: 0, 27 | height: 0 28 | } 29 | }, 30 | 31 | } 32 | ) 33 | 34 | const ModalStack = StackNavigator({ 35 | Navigation: { 36 | screen: Navigation, 37 | }, 38 | Comments: { 39 | screen: Comments, 40 | } 41 | }, { 42 | headerMode: 'none', 43 | cardStyle: { 44 | backgroundColor: 'white' 45 | } 46 | }); 47 | 48 | 49 | 50 | export default ModalStack 51 | -------------------------------------------------------------------------------- /src/scenes/Messages.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import { connect } from 'react-redux'; 3 | import { View, Text } from 'react-native' 4 | import { Header, Icon } from '../components' 5 | import { configs, constants, arrays } from '../commons' 6 | import { showSnackBar, showToast } from '../redux/actions/App' 7 | import styles from './styles/Home' 8 | class Messages extends Component { 9 | //oprion Header 10 | static navigationOptions = { 11 | tabBarVisible: false 12 | }; 13 | 14 | static state = { 15 | test: '' 16 | } 17 | render() { 18 | const { navigate } = this.props.navigation; 19 | return ( 20 | 21 |
22 | Direct 23 | this.props.navigation.navigate('Home')} /> 24 | 25 |
26 |
27 | ) 28 | } 29 | } 30 | 31 | export default Messages -------------------------------------------------------------------------------- /src/scenes/NewCamera.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import { connect } from 'react-redux'; 3 | import { View, Text, TouchableOpacity } from 'react-native' 4 | import { configs, constants, arrays } from '../commons' 5 | import { Header, Icon } from '../components' 6 | import { showSnackBar, showToast } from '../redux/actions/App' 7 | import styles from './styles/NewCamera' 8 | import Camera from 'react-native-camera'; 9 | 10 | 11 | class NewCamera extends Component { 12 | //oprion Header 13 | static navigationOptions = { 14 | tabBarIcon: ({ tintColor }) => ( 15 | 16 | ), 17 | }; 18 | 19 | render() { 20 | const { navigate } = this.props.navigation; 21 | return ( 22 | 23 |
24 | this.props.navigation.goBack()} /> 25 | Camera 26 |
27 | { 29 | this.camera = cam; 30 | }} 31 | style={styles.camera} 32 | aspect={Camera.constants.Aspect.fill}> 33 | 34 | 35 | this.takePicture()} 37 | style={styles.takeCamera} 38 | /> 39 | 40 |
41 | ) 42 | } 43 | takePicture = () => { 44 | const options = {}; 45 | this.camera.capture({ metadata: options }) 46 | .then((data) => console.log(data)) 47 | .catch(err => console.error(err)); 48 | } 49 | } 50 | export default NewCamera -------------------------------------------------------------------------------- /src/scenes/NewGallery.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import { connect } from 'react-redux'; 3 | import { View, Text, TouchableOpacity, CameraRoll, FlatList, Image } from 'react-native' 4 | import { configs, constants, arrays } from '../commons' 5 | import { Header, Icon } from '../components' 6 | import { showSnackBar, showToast } from '../redux/actions/App' 7 | import { coveSize } from '../helper' 8 | import styles from './styles/NewGallery' 9 | import Camera from 'react-native-camera' 10 | 11 | class NewCamera extends Component { 12 | //oprion Header 13 | static navigationOptions = { 14 | tabBarIcon: ({ tintColor }) => ( 15 | 16 | ), 17 | // tabBarVisible: false 18 | }; 19 | state = { 20 | arrImages: [], 21 | imageSelect: 0, 22 | imageRe: true, 23 | infoLoadImageLast: undefined 24 | } 25 | componentWillMount() { 26 | this.loadImage() 27 | } 28 | renderImage = ({ item, index }) => { 29 | if (!item) return null 30 | return ( 31 | this.changeImage(index)}> 32 | 33 | 34 | 35 | ) 36 | } 37 | render() { 38 | const { navigate } = this.props.navigation; 39 | const { arrImages, imageRe, imageSelect } = this.state 40 | const dataImageSlect = arrImages.length != 0 ? arrImages[imageSelect]['node']['image'] : undefined 41 | return ( 42 | 43 |
44 | {/* this.props.navigation.goBack()} /> */} 45 | Gallery 46 |
47 | 48 | { 49 | dataImageSlect ? 51 | : null 52 | } 53 | 54 | this.changeViewImage()} /> 55 | 56 | 57 | 58 | this.loadImage()} 62 | numColumns={4} 63 | keyExtractor={(item, index) => index} 64 | data={arrImages} 65 | renderItem={this.renderImage} 66 | /> 67 |
68 | ) 69 | } 70 | 71 | loadImage = () => { 72 | const { infoLoadImageLast, arrImages } = this.state 73 | let param 74 | if (infoLoadImageLast) { 75 | if (infoLoadImageLast['has_next_page']) { 76 | param = { 77 | first: 10, 78 | after: infoLoadImageLast['end_cursor'], 79 | assetType: 'All' 80 | } 81 | } 82 | } else { 83 | param = { 84 | first: 10, 85 | assetType: 'All' 86 | } 87 | } 88 | CameraRoll.getPhotos(param) 89 | .then((data) => { 90 | this.setState({ 91 | infoLoadImageLast: data['page_info'], 92 | arrImages: arrImages.concat(data['edges']) 93 | }) 94 | }) 95 | } 96 | changeViewImage = () => { 97 | this.setState({ 98 | imageRe: !this.state.imageRe 99 | }) 100 | } 101 | changeImage = (index) => { 102 | 103 | this.setState({ imageSelect: index }) 104 | } 105 | } 106 | export default NewCamera -------------------------------------------------------------------------------- /src/scenes/NewPost.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import { connect } from 'react-redux'; 3 | import { View, Text, CameraRoll } from 'react-native' 4 | import { Icon } from '../components' 5 | import { configs, constants, arrays } from '../commons' 6 | import { TabNavigator, TabBarBottom, StackNavigator } from 'react-navigation' 7 | import NewGallery from '../scenes/NewGallery' 8 | import NewCamera from '../scenes/NewCamera' 9 | import NewVideo from '../scenes/NewVideo' 10 | 11 | const NewPostNavigation = StackNavigator({ 12 | NewGallery: { 13 | screen: NewGallery, 14 | }, 15 | NewCamera: { 16 | screen: NewCamera, 17 | }, 18 | NewVideo: { 19 | screen: NewVideo, 20 | } 21 | }, 22 | { 23 | initialRouteName: 'NewGallery', 24 | headerMode: 'none' 25 | } 26 | ) 27 | 28 | export default NewGallery -------------------------------------------------------------------------------- /src/scenes/NewVideo.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import { connect } from 'react-redux'; 3 | import { View, Text, TouchableOpacity } from 'react-native' 4 | import { configs, constants, arrays } from '../commons' 5 | import { Header, Icon } from '../components' 6 | import { showSnackBar, showToast } from '../redux/actions/App' 7 | import styles from './styles/NewCamera' 8 | import Camera from 'react-native-camera'; 9 | class NewCamera extends Component { 10 | //oprion Header 11 | static navigationOptions = { 12 | tabBarIcon: ({ tintColor }) => ( 13 | 14 | ), 15 | }; 16 | 17 | render() { 18 | const { navigate } = this.props.navigation; 19 | return ( 20 | 21 |
22 | this.props.navigation.goBack()} /> 23 | View 24 |
25 | { 27 | this.camera = cam; 28 | }} 29 | style={styles.camera} 30 | aspect={Camera.constants.Aspect.fill}> 31 | 32 | 33 | this.takePicture()} 35 | style={styles.takeCamera} 36 | /> 37 | 38 |
39 | ) 40 | } 41 | takePicture = () => { 42 | const options = {}; 43 | this.camera.capture({ metadata: options }) 44 | .then((data) => console.log(data)) 45 | .catch(err => console.error(err)); 46 | } 47 | } 48 | export default NewCamera -------------------------------------------------------------------------------- /src/scenes/Notification.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import { connect } from 'react-redux'; 3 | import { TabNavigator, TabBarBottom } from 'react-navigation' 4 | import { View, Text, Image, FlatList } from 'react-native' 5 | import { Icon, Header } from '../components' 6 | import { configs, constants, arrays, colors } from '../commons' 7 | import { showSnackBar, showToast } from '../redux/actions/App' 8 | import styles from './styles/Notification' 9 | 10 | // class Following extends Component { 11 | // //oprion Header 12 | // static navigationOptions = { 13 | // title: 'FOLLOWING', 14 | // tabBarIcon: ({ tintColor }) => ( 15 | // 16 | // ), 17 | // }; 18 | 19 | // static state = { 20 | // test: '' 21 | // } 22 | 23 | // render() { 24 | // const { navigate } = this.props.navigation; 25 | // return ( 26 | // 27 | // Notification 28 | // 29 | // ) 30 | // } 31 | // } 32 | class You extends Component { 33 | //oprion Header 34 | static navigationOptions = { 35 | title: 'YOU', 36 | tabBarIcon: ({ tintColor }) => ( 37 | 38 | ), 39 | }; 40 | 41 | state = { 42 | data: require('../commons/json/noti.json') 43 | } 44 | renderNoti = ({ item }) => { 45 | return 46 | 47 | {item['content']} 48 | {item['type'] == 1 ? 49 | 50 | {item['follow'] ? 'fowllowing' : 'follow'} 51 | 52 | : } 53 | 54 | } 55 | render() { 56 | const { navigate } = this.props.navigation; 57 | const { data } = this.state 58 | return ( 59 | 60 |
61 | Notification 62 |
63 | index} 68 | data={data['you']} 69 | renderItem={this.renderNoti} 70 | /> 71 |
72 | ) 73 | } 74 | } 75 | 76 | // const Notification = TabNavigator( 77 | // { 78 | // Following: { 79 | // screen: Following, 80 | // }, 81 | // You: { 82 | // screen: You, 83 | // } 84 | // }, 85 | // { 86 | // initialRouteName: 'You', 87 | // tabBarComponent: TabBarBottom, 88 | // tabBarPosition: 'top', 89 | // swipeEnabled: true, 90 | // tabBarOptions: { 91 | // labelStyle: { 92 | // fontWeight: '500', 93 | // fontSize: configs.font.medium, 94 | // }, 95 | // activeTintColor: 'black', 96 | // showLabel: true, 97 | // showIcon: false, 98 | // } 99 | // } 100 | // ) 101 | export default You -------------------------------------------------------------------------------- /src/scenes/Profile.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import { connect } from 'react-redux'; 3 | import { StackNavigator } from 'react-navigation' 4 | import { View, Text, Image, TouchableOpacity, FlatList, ScrollView } from 'react-native' 5 | import { Icon, Header, Timeline } from '../components' 6 | import { configs, constants, arrays, colors } from '../commons' 7 | import { showSnackBar, showToast } from '../redux/actions/App' 8 | import styles from './styles/Profile' 9 | import Comments from './Comments' 10 | 11 | class Home extends Component { 12 | //oprion Header 13 | static navigationOptions = { 14 | tabBarIcon: ({ tintColor }) => ( 15 | 16 | ), 17 | }; 18 | 19 | state = { 20 | dataProfile: require('../commons/json/profile.json'), 21 | viewOnlyImage: true 22 | } 23 | 24 | render() { 25 | const { navigate } = this.props.navigation; 26 | let { dataProfile, viewOnlyImage } = this.state 27 | return ( 28 | 29 |
30 | luu_the_lam 31 | 32 | 33 | 34 |
35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | {Object.keys(dataProfile['profile']['index']).map((item, index) => 47 | {dataProfile['profile']['index'][item]} 48 | {item} 49 | )} 50 | 51 | 52 | 53 | Edit your profile 54 | 55 | 56 | 57 | 58 | 59 | 60 | this.setState({ viewOnlyImage: true })} color={viewOnlyImage ? colors.accent : 'gray'} /> 61 | this.setState({ viewOnlyImage: false })} color={!viewOnlyImage ? colors.accent : 'gray'} /> 62 | 63 | 64 | 65 | { 66 | viewOnlyImage ? index} 72 | data={dataProfile['timeline']} 73 | renderItem={({ item }) => } 74 | /> : navigate('Comments', { data: args })} viewOnlyImage /> 75 | } 76 | 77 | 78 | 79 |
80 | ) 81 | } 82 | 83 | } 84 | 85 | const ModalStack = StackNavigator({ 86 | Navigation: { 87 | screen: Home, 88 | }, 89 | Comments: { 90 | screen: Comments, 91 | } 92 | }, { 93 | headerMode: 'none', 94 | cardStyle: { 95 | backgroundColor: 'white' 96 | } 97 | }); 98 | 99 | export default ModalStack -------------------------------------------------------------------------------- /src/scenes/Search.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import { connect } from 'react-redux'; 3 | import { View, Text, TextInput, FlatList, TouchableOpacity, Image, ActivityIndicator } from 'react-native' 4 | import { Header, Icon, Stories } from '../components' 5 | import { configs, constants, arrays } from '../commons' 6 | import styles from './styles/Search' 7 | class Home extends Component { 8 | //oprion Header 9 | static navigationOptions = { 10 | tabBarIcon: ({ tintColor }) => ( 11 | 12 | ), 13 | }; 14 | state = { 15 | textSearch: '', 16 | arrImages: require('../commons/json/search.json')['search'], 17 | arrStories: require('../commons/json/search.json')['stories'], 18 | loading: false, 19 | refreshing: false 20 | } 21 | 22 | renderImage = ({ item, index }) => { 23 | if (!item) return null 24 | return ( 25 | 26 | 27 | 28 | 29 | ) 30 | } 31 | renderFooter = () => { 32 | if (!this.state.loading) return null 33 | return ( 34 | 35 | ) 36 | } 37 | renderHeader = () => { 38 | const { arrStories } = this.state 39 | return 40 | 41 | 43 | 44 | } 45 | 46 | render() { 47 | const { navigate } = this.props.navigation; 48 | const { arrImages } = this.state 49 | return ( 50 | 51 |
52 | 53 | Search 54 |
55 | 56 | index} 60 | data={arrImages} 61 | renderItem={this.renderImage} 62 | onEndReached={this.onEndReached} 63 | onRefresh={this.onRefresh} 64 | refreshing={this.state.refreshing} 65 | ListFooterComponent={this.renderFooter} 66 | ListHeaderComponent={this.renderHeader} 67 | /> 68 |
69 | ) 70 | } 71 | 72 | onEndReached = () => { 73 | this.setState({ 74 | loading: true 75 | }, () => { 76 | setTimeout(() => { 77 | this.setState({ 78 | arrImages: this.state.arrImages.concat(require('../commons/json/search.json')['search']), 79 | loading: false 80 | }) 81 | }, 3000) 82 | }) 83 | } 84 | onRefresh = () => { 85 | this.setState({ 86 | refreshing: true 87 | }, () => { 88 | setTimeout(() => { 89 | this.setState({ 90 | refreshing: false, 91 | arrImages: require('../commons/json/search.json')['search'] 92 | }) 93 | }, 3000) 94 | }) 95 | } 96 | } 97 | 98 | export default Home -------------------------------------------------------------------------------- /src/scenes/styles/Camera.js: -------------------------------------------------------------------------------- 1 | import { configs, colors, styles } from '../../commons' 2 | 3 | export default style = { 4 | ...styles, 5 | constant: { 6 | backgroundColor: '#FAFAFA', 7 | width: configs.screenWidth, 8 | height: configs.screenHeight 9 | }, 10 | header: { 11 | backgroundColor: 'transparent', 12 | position: 'absolute', 13 | top: 0, 14 | width: configs.screenWidth, 15 | height: 56 16 | }, 17 | cameraConst: { 18 | flex: 1, 19 | justifyContent: 'flex-end', 20 | alignItems: 'center' 21 | }, 22 | takeCamera: { 23 | width: 70, 24 | height: 70, 25 | marginBottom: 10, 26 | alignItems: 'center', 27 | borderColor: 'rgba(255, 255, 255, 0.7)', 28 | backgroundColor: 'white', 29 | borderRadius: 30, 30 | borderWidth: 25 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/scenes/styles/Comments.js: -------------------------------------------------------------------------------- 1 | import { configs, colors, styles } from '../../commons' 2 | 3 | export default style = { 4 | ...styles, 5 | constant: { 6 | backgroundColor: '#FAFAFA', 7 | width: configs.screenWidth, 8 | height: configs.screenHeight 9 | }, 10 | inputBg: { 11 | backgroundColor:'white', 12 | width: configs.screenWidth, 13 | flexDirection: 'row', 14 | height: 48, 15 | alignItems: 'center', 16 | borderTopColor: '#c9c9c9', 17 | borderTopWidth: 1, 18 | }, 19 | sendbg: { 20 | backgroundColor: '#40C4FF', 21 | height: 48, 22 | width: 52, 23 | alignItems: 'center', 24 | justifyContent: 'center' 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/scenes/styles/Home.js: -------------------------------------------------------------------------------- 1 | import { configs, colors, styles } from '../../commons' 2 | 3 | export default style = { 4 | ...styles, 5 | constant: { 6 | backgroundColor: '#FAFAFA', 7 | width: configs.screenWidth, 8 | height: configs.screenHeight 9 | }, 10 | iconTabbg: { 11 | borderRadius: 8, 12 | padding: 4 13 | }, 14 | headerPost: { 15 | flexDirection: 'row', 16 | alignItems: 'center', 17 | height: 48, 18 | ...styles.appLine, 19 | paddingHorizontal: 14 20 | 21 | }, 22 | headerIcon: { 23 | width: 30, 24 | height: 30, 25 | borderRadius: 15 26 | }, 27 | comment: { 28 | flexDirection: 'row', 29 | alignItems: 'center', 30 | paddingHorizontal: 4 31 | }, 32 | constHeader: { 33 | flexDirection: 'row', 34 | marginTop: 1, 35 | paddingHorizontal: 12, 36 | paddingVertical: 6, 37 | justifyContent: 'space-between', 38 | borderBottomColor: colors.cover 39 | }, 40 | header: { 41 | paddingVertical: 6, 42 | borderBottomColor: colors.cover, 43 | borderBottomWidth: 0.3 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/scenes/styles/NewCamera.js: -------------------------------------------------------------------------------- 1 | import { configs, colors, styles } from '../../commons' 2 | 3 | export default style = { 4 | ...styles, 5 | constant: { 6 | backgroundColor: '#FAFAFA', 7 | width: configs.screenWidth, 8 | height: configs.screenHeight 9 | }, 10 | camera: { 11 | width: configs.screenWidth, 12 | height: configs.screenWidth 13 | }, 14 | takeCamera: { 15 | width: 60, 16 | height: 60, 17 | alignItems: 'center', 18 | borderColor: 'rgba(0, 0, 0, 0.2)', 19 | backgroundColor: 'white', 20 | borderRadius: 30, 21 | borderWidth: 12 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/scenes/styles/NewGallery.js: -------------------------------------------------------------------------------- 1 | import { configs, colors, styles } from '../../commons' 2 | 3 | export default style = { 4 | ...styles, 5 | imageSelect: { 6 | justifyContent: 'center', 7 | alignItems: 'center', 8 | width: configs.screenWidth, 9 | height: configs.screenWidth 10 | }, 11 | btnChangeViewImage: { 12 | borderRadius: 30, 13 | backgroundColor: colors.cover, 14 | position: 'absolute', 15 | bottom: 10, 16 | left: 10 17 | }, 18 | imgArr: { 19 | margin: 0.5, 20 | width: configs.screenWidth / 4 - 1, 21 | height: configs.screenWidth / 4 - 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/scenes/styles/Notification.js: -------------------------------------------------------------------------------- 1 | import { configs, colors, styles } from '../../commons' 2 | 3 | export default style = { 4 | ...styles, 5 | imgAvata: { 6 | width: 40, 7 | height: 40, 8 | borderRadius: 20, 9 | }, 10 | imgPost: { 11 | width: 40, 12 | height: 40 13 | }, 14 | btnFollowing: { 15 | ...styles.appPaddingButton, 16 | borderWidth: 1, 17 | borderColor: colors.cover 18 | }, 19 | btnFollow: { 20 | ...styles.appPaddingButton, 21 | backgroundColor: colors.accent 22 | } 23 | } 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/scenes/styles/Profile.js: -------------------------------------------------------------------------------- 1 | import { configs, colors, styles } from '../../commons' 2 | 3 | export default style = { 4 | ...styles, 5 | constHeader: { 6 | flexDirection: 'row', 7 | height: configs.screenWidth / 3.5 8 | }, 9 | imgProfile: { 10 | width: configs.screenWidth / 4.5, 11 | height: configs.screenWidth / 4.5, 12 | borderRadius: configs.screenWidth / 9 13 | }, 14 | constIndex: { 15 | flexDirection: 'row', 16 | alignItems: 'center', 17 | justifyContent: 'space-around', 18 | paddingHorizontal: 12 19 | }, 20 | ctType: { 21 | borderBottomColor: colors.cover, 22 | borderTopColor: colors.cover, 23 | borderTopWidth: 0.5, 24 | borderBottomWidth: 0.5, 25 | paddingVertical: 6, 26 | flexDirection: 'row', 27 | justifyContent: 'space-around' 28 | }, 29 | imgOnly: { 30 | margin: 0.5, 31 | width: configs.screenWidth / 3 - 1, 32 | height: configs.screenWidth / 3 - 1 33 | } 34 | } 35 | 36 | 37 | -------------------------------------------------------------------------------- /src/scenes/styles/Search.js: -------------------------------------------------------------------------------- 1 | import { configs, colors, styles } from '../../commons' 2 | 3 | export default style = { 4 | ...styles, 5 | imgArr: { 6 | margin: 0.5, 7 | width: configs.screenWidth / 3- 1, 8 | height: configs.screenWidth / 3 - 1 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/setup.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import { connect } from 'react-redux'; 3 | import { View, StatusBar, Platform } from 'react-native' 4 | import { configs, styles } from './commons' 5 | import { SnackBar, Toast } from './components' 6 | 7 | class Setup extends Component { 8 | render() { 9 | return ( 10 | 11 | {this.props.children} 12 | 13 | 14 | 17 | 18 | ) 19 | } 20 | } 21 | 22 | export default Setup --------------------------------------------------------------------------------