├── .babelrc ├── .buckconfig ├── .flowconfig ├── .gitattributes ├── .gitignore ├── .watchmanconfig ├── README.md ├── __tests__ ├── index.android.js └── index.ios.js ├── android ├── app │ ├── BUCK │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── com │ │ │ └── todo │ │ │ ├── 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 │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── keystores │ ├── BUCK │ └── debug.keystore.properties └── settings.gradle ├── demo.gif ├── index.android.js ├── index.ios.js ├── ios ├── todo.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ └── todo.xcscheme ├── todo │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ │ └── LaunchScreen.xib │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Info.plist │ └── main.m └── todoTests │ ├── Info.plist │ └── todoTests.m ├── package-lock.json ├── package.json └── src ├── actions ├── actionTypes.js └── todoActions.js ├── components ├── AddTodo │ └── index.js ├── Buttons │ ├── ButtonFilter.js │ └── ButtonIcon.js ├── Container │ └── index.js ├── ControlPanel │ └── index.js ├── EditTodo │ └── index.js ├── ListTodo │ ├── List.js │ └── index.js ├── LoginSignup │ ├── ButtonLogin.js │ ├── ButtonSignup.js │ ├── FormLogin.js │ ├── FormSignup.js │ ├── Login.js │ ├── Logo.js │ ├── Signup.js │ ├── ToLogin.js │ ├── ToSignup.js │ └── UserInput.js ├── Screens │ ├── Edit.js │ ├── Login.js │ ├── Main.js │ ├── Menu.js │ └── Signup.js ├── TopBar │ └── index.js ├── Visibility │ └── index.js └── index.js ├── icons ├── back.png ├── check.png ├── left-arrow.png ├── loading.gif ├── open_menu.png ├── password.png ├── plus.png ├── remove.png ├── star.png ├── uncheck.png ├── unstar.png └── username.png ├── images ├── bg.jpg └── logo.png ├── reducers ├── conditionReducer.js ├── formReducer.js ├── index.js ├── todoReducer.js ├── userDataReducer.js └── visibilityFilterReducer.js └── store └── configureStore.js /.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='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub' 32 | 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' 33 | 34 | suppress_type=$FlowIssue 35 | suppress_type=$FlowFixMe 36 | suppress_type=$FixMe 37 | 38 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-5]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) 39 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-5]\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ 40 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy 41 | 42 | unsafe.enable_getters_and_setters=true 43 | 44 | [version] 45 | ^0.35.0 46 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # key 2 | android/gradle.properties 3 | src/firebase/index.js 4 | 5 | # OSX 6 | # 7 | .DS_Store 8 | 9 | # Xcode 10 | # 11 | build/ 12 | *.pbxuser 13 | !default.pbxuser 14 | *.mode1v3 15 | !default.mode1v3 16 | *.mode2v3 17 | !default.mode2v3 18 | *.perspectivev3 19 | !default.perspectivev3 20 | xcuserdata 21 | *.xccheckout 22 | *.moved-aside 23 | DerivedData 24 | *.hmap 25 | *.ipa 26 | *.xcuserstate 27 | project.xcworkspace 28 | 29 | # Android/IntelliJ 30 | # 31 | build/ 32 | .idea 33 | .gradle 34 | local.properties 35 | *.iml 36 | 37 | # node.js 38 | # 39 | node_modules/ 40 | npm-debug.log 41 | 42 | # BUCK 43 | buck-out/ 44 | \.buckd/ 45 | android/app/libs 46 | *.keystore 47 | -------------------------------------------------------------------------------- /.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # React Native Redux Firebase Todo 2 | 3 | ![demo](https://raw.githubusercontent.com/dwicao/react-native-redux-firebase-todo/master/demo.gif) 4 | 5 | ## Download 6 | [MyTodo.apk](https://github.com/dwicao/react-native-redux-firebase-todo/releases/download/v1.0/myTodo.apk) 7 | 8 | ## Technology Stack 9 | * React Native 10 | * Redux 11 | * CodePush 12 | * Firebase 13 | * redux-thunk 14 | * redux-persist 15 | * react-native-drawer 16 | * react-native-router-flux 17 | 18 | ## Install at local 19 | Open Terminal, then type command: 20 | > git clone https://github.com/dwicao/react-native-redux-firebase-todo.git 21 | 22 | Go to project folder : 23 | > cd react-native-redux-firebase-todo 24 | 25 | Type following command : 26 | > npm install 27 | 28 | You must have ANDROID_HOME environtment variable, to check if you already have, type in your terminal : 29 | > echo $ANDROID_HOME 30 | 31 | If blank, you can read at [HERE](https://goo.gl/XSBmwE) 32 | 33 | Make sure you have already installed React Native globally by running this command : 34 | > sudo npm install -g react-native-cli 35 | 36 | In your terminal type this to make sure react-native know each addons modules in this app : 37 | > react-native link 38 | 39 | To get CODEPUSH_KEY you must create a CodePush account, read instruction [HERE](https://microsoft.github.io/code-push/) 40 | 41 | Create new file at `react-native-redux-firebase-todo/android/gradle.properties` and fill with this lines of code : 42 | 43 | ``` 44 | android.useDeprecatedNdk = true 45 | CODEPUSH_DEBUG_KEY = "INSERT_YOUR_KEY_HERE" 46 | CODEPUSH_RELEASE_KEY = "INSERT_YOUR_KEY_HERE" 47 | ``` 48 | Create a firebase account at [HERE](firebase.google.com) 49 | 50 | Create a new Project at Firebase and go to `Overview` tab, and click Firebase for `Web`, copy that key at `react-native-redux-firebase-todo/src/firebase/index.js` and fill with this line of codes: 51 | 52 | ``` 53 | import * as firebase from 'firebase'; 54 | 55 | firebase.initializeApp({ 56 | apiKey: "FILL_THIS_WITH_YOURS", 57 | authDomain: "FILL_THIS_WITH_YOURS", 58 | databaseURL: "FILL_THIS_WITH_YOURS", 59 | storageBucket: "FILL_THIS_WITH_YOURS", 60 | messagingSenderId: "FILL_THIS_WITH_YOURS" 61 | }); 62 | 63 | export const firebaseRef = firebase.database().ref(); 64 | export default firebase; 65 | 66 | ``` 67 | 68 | At this point, you should be able to run the project. 69 | To run your project on your device/emulator at Debug configuration, type : 70 | > npm run android-dev 71 | 72 | Or if you want to run at iOS simulator, run: 73 | > react-native run-ios 74 | 75 | If you have error message like `Execution failed for task ':app:dexDebug'.` run this on your terminal : 76 | > npm run android-clean 77 | 78 | To build .apk file just type : 79 | > npm run android-release 80 | 81 | You must sign .apk with keystore, to do this just type in your terminal : 82 | > npm run android-signer 83 | 84 | The .apk file is located at `react-native-redux-firebase-todo/android/app/build/outputs/apk/app-release-unsigned.apk` 85 | 86 | 87 | ## Available Command 88 | 89 | | npm run ... | Description | 90 | | --- | --- | 91 | | adb-reverse | Reset port ADB to tcp:8081 | 92 | | ios-bundle | Bundle with entry file index.ios.js | 93 | | ios-build | Run ios project with “Release” configuration | 94 | | ios-codepush-staging | Push changes your bundle to CodePush Staging environtment | 95 | | ios-codepush-production | Push changes your bundle to CodePush Production environtment | 96 | | android-clean | Fix building android if preDexDebug error | 97 | | android-build-debug | Build android .apk with “Debug” configuration | 98 | | android-release | Build android .apk with “Release” configuration | 99 | | android-signkey | Generate keystore android | 100 | | android-signer | To sign app-release-unsigned.apk with random keystore | 101 | | android-dev | Run android development-mode on simulator | 102 | | android-bundle | Bundle with entry file index.android.js | 103 | | codepush-key | View your staging and development key at CodePush | 104 | | android-codepush-staging | Push changes your bundle to CodePush Staging environtment | 105 | | android-codepush-production | Push changes your bundle to CodePush Production environtment | 106 | 107 | 108 | ## License 109 | **MIT** 110 | 111 | 112 | -------------------------------------------------------------------------------- /__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.todo', 50 | ) 51 | 52 | android_resource( 53 | name = 'res', 54 | res = 'src/main/res', 55 | package = 'com.todo', 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 | apply from: "../../node_modules/react-native-code-push/android/codepush.gradle" 70 | 71 | /** 72 | * Set this to true to create two separate APKs instead of one: 73 | * - An APK that only works on ARM devices 74 | * - An APK that only works on x86 devices 75 | * The advantage is the size of the APK is reduced by about 4MB. 76 | * Upload all the APKs to the Play Store and people will download 77 | * the correct one based on the CPU architecture of their device. 78 | */ 79 | def enableSeparateBuildPerCPUArchitecture = false 80 | 81 | /** 82 | * Run Proguard to shrink the Java bytecode in release builds. 83 | */ 84 | def enableProguardInReleaseBuilds = false 85 | 86 | android { 87 | compileSdkVersion 23 88 | buildToolsVersion "23.0.1" 89 | 90 | defaultConfig { 91 | applicationId "com.dwicao.mytodo" 92 | minSdkVersion 16 93 | targetSdkVersion 22 94 | versionCode 1 95 | versionName "1.0" 96 | ndk { 97 | abiFilters "armeabi-v7a", "x86" 98 | } 99 | } 100 | splits { 101 | abi { 102 | reset() 103 | enable enableSeparateBuildPerCPUArchitecture 104 | universalApk false // If true, also generate a universal APK 105 | include "armeabi-v7a", "x86" 106 | } 107 | } 108 | buildTypes { 109 | debug { 110 | applicationIdSuffix ".debug" 111 | buildConfigField "String", "CODEPUSH_KEY", CODEPUSH_DEBUG_KEY 112 | } 113 | 114 | release { 115 | minifyEnabled enableProguardInReleaseBuilds 116 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 117 | buildConfigField "String", "CODEPUSH_KEY", CODEPUSH_RELEASE_KEY 118 | } 119 | } 120 | // applicationVariants are e.g. debug, release 121 | applicationVariants.all { variant -> 122 | variant.outputs.each { output -> 123 | // For each separate APK per architecture, set a unique version code as described here: 124 | // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits 125 | def versionCodes = ["armeabi-v7a":1, "x86":2] 126 | def abi = output.getFilter(OutputFile.ABI) 127 | if (abi != null) { // null for the universal-debug, universal-release variants 128 | output.versionCodeOverride = 129 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode 130 | } 131 | } 132 | } 133 | } 134 | 135 | dependencies { 136 | compile project(':react-native-code-push') 137 | compile fileTree(dir: "libs", include: ["*.jar"]) 138 | compile "com.android.support:appcompat-v7:23.0.1" 139 | compile "com.facebook.react:react-native:+" // From node_modules 140 | compile "com.facebook.fresco:fresco:1.0.0" 141 | compile "com.facebook.fresco:animated-gif:1.0.0" 142 | // supports Android versions before Ice Cream Sandwich (API level 14) 143 | compile 'com.facebook.fresco:animated-base-support:1.0.0' 144 | } 145 | 146 | // Run this once to be able to run the application with BUCK 147 | // puts all compile dependencies into folder libs for BUCK to use 148 | task copyDownloadableDepsToLibs(type: Copy) { 149 | from configurations.compile 150 | into 'libs' 151 | } 152 | -------------------------------------------------------------------------------- /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 | 12 | 13 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/todo/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.dwicao.mytodo; 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 "todo"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/todo/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.dwicao.mytodo; 2 | 3 | import android.app.Application; 4 | import android.util.Log; 5 | 6 | import com.facebook.react.ReactApplication; 7 | import com.facebook.react.ReactInstanceManager; 8 | import com.facebook.react.ReactNativeHost; 9 | import com.facebook.react.ReactPackage; 10 | import com.facebook.react.shell.MainReactPackage; 11 | import com.facebook.soloader.SoLoader; 12 | 13 | import java.util.Arrays; 14 | import java.util.List; 15 | 16 | import com.microsoft.codepush.react.CodePush; 17 | 18 | public class MainApplication extends Application implements ReactApplication { 19 | 20 | private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { 21 | 22 | @Override 23 | protected String getJSBundleFile() { 24 | return CodePush.getJSBundleFile(); 25 | } 26 | 27 | @Override 28 | protected boolean getUseDeveloperSupport() { 29 | return BuildConfig.DEBUG; 30 | } 31 | 32 | @Override 33 | protected List getPackages() { 34 | return Arrays.asList( 35 | new MainReactPackage(), 36 | new CodePush(BuildConfig.CODEPUSH_KEY, MainApplication.this, BuildConfig.DEBUG) 37 | ); 38 | } 39 | }; 40 | 41 | @Override 42 | public ReactNativeHost getReactNativeHost() { 43 | return mReactNativeHost; 44 | } 45 | 46 | @Override 47 | public void onCreate() { 48 | super.onCreate(); 49 | SoLoader.init(this, /* native exopackage */ false); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dwicao/react-native-redux-firebase-todo/20224bd26105694cef8dc15bed62558fd9c1394a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dwicao/react-native-redux-firebase-todo/20224bd26105694cef8dc15bed62558fd9c1394a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dwicao/react-native-redux-firebase-todo/20224bd26105694cef8dc15bed62558fd9c1394a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dwicao/react-native-redux-firebase-todo/20224bd26105694cef8dc15bed62558fd9c1394a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | My Todo 4 | 5 | -------------------------------------------------------------------------------- /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/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dwicao/react-native-redux-firebase-todo/20224bd26105694cef8dc15bed62558fd9c1394a/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 = 'todo' 2 | include ':react-native-code-push' 3 | project(':react-native-code-push').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-code-push/android/app') 4 | 5 | include ':app' 6 | -------------------------------------------------------------------------------- /demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dwicao/react-native-redux-firebase-todo/20224bd26105694cef8dc15bed62558fd9c1394a/demo.gif -------------------------------------------------------------------------------- /index.android.js: -------------------------------------------------------------------------------- 1 | import codePush from "react-native-code-push"; 2 | import React, { Component } from 'react'; 3 | import { AppRegistry } from 'react-native'; 4 | import {Provider} from 'react-redux'; 5 | import configureStore from './src/store/configureStore'; 6 | import App from './src/components/'; 7 | import * as actions from './src/actions/todoActions'; 8 | 9 | const store = configureStore(); 10 | 11 | class todo extends Component { 12 | componentDidMount() { 13 | codePush.sync({installMode: codePush.InstallMode.IMMEDIATE}); 14 | } 15 | 16 | render() { 17 | return ( 18 | 19 | 20 | 21 | ); 22 | } 23 | } 24 | 25 | AppRegistry.registerComponent( 'todo', () => codePush(todo) ); 26 | -------------------------------------------------------------------------------- /index.ios.js: -------------------------------------------------------------------------------- 1 | import './index.android'; 2 | -------------------------------------------------------------------------------- /ios/todo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | /* Begin PBXBuildFile section */ 9 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; }; 10 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; }; 11 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; }; 12 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; }; 13 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; }; 14 | 00E356F31AD99517003FC87E /* todoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* todoTests.m */; }; 15 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; }; 16 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; }; 17 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */; }; 18 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 19 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 20 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 21 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 22 | 140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 23 | 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 24 | 5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */; }; 25 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; 26 | EA5437AF638347C6B51363AD /* libCodePush.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 34B7E19F62AD43B3A4B9C28B /* libCodePush.a */; }; 27 | DB6273E0C24D43B096BF79A7 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 7BB1900D73DA4BB3A3156FC4 /* libz.tbd */; }; 28 | /* End PBXBuildFile section */ 29 | 30 | /* Begin PBXContainerItemProxy section */ 31 | 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */ = { 32 | isa = PBXContainerItemProxy; 33 | containerPortal = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 34 | proxyType = 2; 35 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 36 | remoteInfo = RCTActionSheet; 37 | }; 38 | 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */ = { 39 | isa = PBXContainerItemProxy; 40 | containerPortal = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 41 | proxyType = 2; 42 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 43 | remoteInfo = RCTGeolocation; 44 | }; 45 | 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */ = { 46 | isa = PBXContainerItemProxy; 47 | containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 48 | proxyType = 2; 49 | remoteGlobalIDString = 58B5115D1A9E6B3D00147676; 50 | remoteInfo = RCTImage; 51 | }; 52 | 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */ = { 53 | isa = PBXContainerItemProxy; 54 | containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 55 | proxyType = 2; 56 | remoteGlobalIDString = 58B511DB1A9E6C8500147676; 57 | remoteInfo = RCTNetwork; 58 | }; 59 | 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */ = { 60 | isa = PBXContainerItemProxy; 61 | containerPortal = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 62 | proxyType = 2; 63 | remoteGlobalIDString = 832C81801AAF6DEF007FA2F7; 64 | remoteInfo = RCTVibration; 65 | }; 66 | 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = { 67 | isa = PBXContainerItemProxy; 68 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; 69 | proxyType = 1; 70 | remoteGlobalIDString = 13B07F861A680F5B00A75B9A; 71 | remoteInfo = todo; 72 | }; 73 | 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = { 74 | isa = PBXContainerItemProxy; 75 | containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 76 | proxyType = 2; 77 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 78 | remoteInfo = RCTSettings; 79 | }; 80 | 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */ = { 81 | isa = PBXContainerItemProxy; 82 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 83 | proxyType = 2; 84 | remoteGlobalIDString = 3C86DF461ADF2C930047B81A; 85 | remoteInfo = RCTWebSocket; 86 | }; 87 | 146834031AC3E56700842450 /* PBXContainerItemProxy */ = { 88 | isa = PBXContainerItemProxy; 89 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 90 | proxyType = 2; 91 | remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; 92 | remoteInfo = React; 93 | }; 94 | 5E9157321DD0AC6500FF2AA8 /* PBXContainerItemProxy */ = { 95 | isa = PBXContainerItemProxy; 96 | containerPortal = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */; 97 | proxyType = 2; 98 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 99 | remoteInfo = RCTAnimation; 100 | }; 101 | 5E9157341DD0AC6500FF2AA8 /* PBXContainerItemProxy */ = { 102 | isa = PBXContainerItemProxy; 103 | containerPortal = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */; 104 | proxyType = 2; 105 | remoteGlobalIDString = 2D2A28201D9B03D100D4039D; 106 | remoteInfo = "RCTAnimation-tvOS"; 107 | }; 108 | 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = { 109 | isa = PBXContainerItemProxy; 110 | containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 111 | proxyType = 2; 112 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 113 | remoteInfo = RCTLinking; 114 | }; 115 | 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */ = { 116 | isa = PBXContainerItemProxy; 117 | containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 118 | proxyType = 2; 119 | remoteGlobalIDString = 58B5119B1A9E6C1200147676; 120 | remoteInfo = RCTText; 121 | }; 122 | /* End PBXContainerItemProxy section */ 123 | 124 | /* Begin PBXFileReference section */ 125 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = ""; }; 126 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = "../node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj"; sourceTree = ""; }; 127 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = "../node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj"; sourceTree = ""; }; 128 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "../node_modules/react-native/Libraries/Image/RCTImage.xcodeproj"; sourceTree = ""; }; 129 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "../node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = ""; }; 130 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "../node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = ""; }; 131 | 00E356EE1AD99517003FC87E /* todoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = todoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 132 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 133 | 00E356F21AD99517003FC87E /* todoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = todoTests.m; sourceTree = ""; }; 134 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = ""; }; 135 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "../node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj"; sourceTree = ""; }; 136 | 13B07F961A680F5B00A75B9A /* todo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = todo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 137 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = todo/AppDelegate.h; sourceTree = ""; }; 138 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = todo/AppDelegate.m; sourceTree = ""; }; 139 | 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 140 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = todo/Images.xcassets; sourceTree = ""; }; 141 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = todo/Info.plist; sourceTree = ""; }; 142 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = todo/main.m; sourceTree = ""; }; 143 | 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; }; 144 | 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAnimation.xcodeproj; path = "../node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj"; sourceTree = ""; }; 145 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; }; 146 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; }; 147 | DD9C2B45724A4559B59128BE /* CodePush.xcodeproj */ = {isa = PBXFileReference; name = "CodePush.xcodeproj"; path = "../node_modules/react-native-code-push/ios/CodePush.xcodeproj"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; }; 148 | 34B7E19F62AD43B3A4B9C28B /* libCodePush.a */ = {isa = PBXFileReference; name = "libCodePush.a"; path = "libCodePush.a"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; }; 149 | 7BB1900D73DA4BB3A3156FC4 /* libz.tbd */ = {isa = PBXFileReference; name = "libz.tbd"; path = "usr/lib/libz.tbd"; sourceTree = SDKROOT; fileEncoding = undefined; lastKnownFileType = sourcecode.text-based-dylib-definition; explicitFileType = undefined; includeInIndex = 0; }; 150 | /* End PBXFileReference section */ 151 | 152 | /* Begin PBXFrameworksBuildPhase section */ 153 | 00E356EB1AD99517003FC87E /* Frameworks */ = { 154 | isa = PBXFrameworksBuildPhase; 155 | buildActionMask = 2147483647; 156 | files = ( 157 | 140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */, 158 | ); 159 | runOnlyForDeploymentPostprocessing = 0; 160 | }; 161 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { 162 | isa = PBXFrameworksBuildPhase; 163 | buildActionMask = 2147483647; 164 | files = ( 165 | 5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */, 166 | 146834051AC3E58100842450 /* libReact.a in Frameworks */, 167 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */, 168 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */, 169 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */, 170 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */, 171 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */, 172 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */, 173 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */, 174 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */, 175 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */, 176 | EA5437AF638347C6B51363AD /* libCodePush.a in Frameworks */, 177 | DB6273E0C24D43B096BF79A7 /* libz.tbd in Frameworks */, 178 | ); 179 | runOnlyForDeploymentPostprocessing = 0; 180 | }; 181 | /* End PBXFrameworksBuildPhase section */ 182 | 183 | /* Begin PBXGroup section */ 184 | 00C302A81ABCB8CE00DB3ED1 /* Products */ = { 185 | isa = PBXGroup; 186 | children = ( 187 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */, 188 | ); 189 | name = Products; 190 | sourceTree = ""; 191 | }; 192 | 00C302B61ABCB90400DB3ED1 /* Products */ = { 193 | isa = PBXGroup; 194 | children = ( 195 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */, 196 | ); 197 | name = Products; 198 | sourceTree = ""; 199 | }; 200 | 00C302BC1ABCB91800DB3ED1 /* Products */ = { 201 | isa = PBXGroup; 202 | children = ( 203 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */, 204 | ); 205 | name = Products; 206 | sourceTree = ""; 207 | }; 208 | 00C302D41ABCB9D200DB3ED1 /* Products */ = { 209 | isa = PBXGroup; 210 | children = ( 211 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */, 212 | ); 213 | name = Products; 214 | sourceTree = ""; 215 | }; 216 | 00C302E01ABCB9EE00DB3ED1 /* Products */ = { 217 | isa = PBXGroup; 218 | children = ( 219 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */, 220 | ); 221 | name = Products; 222 | sourceTree = ""; 223 | }; 224 | 00E356EF1AD99517003FC87E /* todoTests */ = { 225 | isa = PBXGroup; 226 | children = ( 227 | 00E356F21AD99517003FC87E /* todoTests.m */, 228 | 00E356F01AD99517003FC87E /* Supporting Files */, 229 | ); 230 | path = todoTests; 231 | sourceTree = ""; 232 | }; 233 | 00E356F01AD99517003FC87E /* Supporting Files */ = { 234 | isa = PBXGroup; 235 | children = ( 236 | 00E356F11AD99517003FC87E /* Info.plist */, 237 | ); 238 | name = "Supporting Files"; 239 | sourceTree = ""; 240 | }; 241 | 139105B71AF99BAD00B5F7CC /* Products */ = { 242 | isa = PBXGroup; 243 | children = ( 244 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */, 245 | ); 246 | name = Products; 247 | sourceTree = ""; 248 | }; 249 | 139FDEE71B06529A00C62182 /* Products */ = { 250 | isa = PBXGroup; 251 | children = ( 252 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */, 253 | ); 254 | name = Products; 255 | sourceTree = ""; 256 | }; 257 | 13B07FAE1A68108700A75B9A /* todo */ = { 258 | isa = PBXGroup; 259 | children = ( 260 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */, 261 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 262 | 13B07FB01A68108700A75B9A /* AppDelegate.m */, 263 | 13B07FB51A68108700A75B9A /* Images.xcassets */, 264 | 13B07FB61A68108700A75B9A /* Info.plist */, 265 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */, 266 | 13B07FB71A68108700A75B9A /* main.m */, 267 | ); 268 | name = todo; 269 | sourceTree = ""; 270 | }; 271 | 146834001AC3E56700842450 /* Products */ = { 272 | isa = PBXGroup; 273 | children = ( 274 | 146834041AC3E56700842450 /* libReact.a */, 275 | ); 276 | name = Products; 277 | sourceTree = ""; 278 | }; 279 | 5E91572E1DD0AC6500FF2AA8 /* Products */ = { 280 | isa = PBXGroup; 281 | children = ( 282 | 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */, 283 | 5E9157351DD0AC6500FF2AA8 /* libRCTAnimation-tvOS.a */, 284 | ); 285 | name = Products; 286 | sourceTree = ""; 287 | }; 288 | 78C398B11ACF4ADC00677621 /* Products */ = { 289 | isa = PBXGroup; 290 | children = ( 291 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */, 292 | ); 293 | name = Products; 294 | sourceTree = ""; 295 | }; 296 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = { 297 | isa = PBXGroup; 298 | children = ( 299 | 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */, 300 | 146833FF1AC3E56700842450 /* React.xcodeproj */, 301 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */, 302 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */, 303 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */, 304 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */, 305 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */, 306 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */, 307 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */, 308 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */, 309 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */, 310 | DD9C2B45724A4559B59128BE /* CodePush.xcodeproj */, 311 | ); 312 | name = Libraries; 313 | sourceTree = ""; 314 | }; 315 | 832341B11AAA6A8300B99B32 /* Products */ = { 316 | isa = PBXGroup; 317 | children = ( 318 | 832341B51AAA6A8300B99B32 /* libRCTText.a */, 319 | ); 320 | name = Products; 321 | sourceTree = ""; 322 | }; 323 | 83CBB9F61A601CBA00E9B192 = { 324 | isa = PBXGroup; 325 | children = ( 326 | 13B07FAE1A68108700A75B9A /* todo */, 327 | 832341AE1AAA6A7D00B99B32 /* Libraries */, 328 | 00E356EF1AD99517003FC87E /* todoTests */, 329 | 83CBBA001A601CBA00E9B192 /* Products */, 330 | 13B62171E2394EFB9D08B9EF /* Frameworks */, 331 | ); 332 | indentWidth = 2; 333 | sourceTree = ""; 334 | tabWidth = 2; 335 | }; 336 | 83CBBA001A601CBA00E9B192 /* Products */ = { 337 | isa = PBXGroup; 338 | children = ( 339 | 13B07F961A680F5B00A75B9A /* todo.app */, 340 | 00E356EE1AD99517003FC87E /* todoTests.xctest */, 341 | ); 342 | name = Products; 343 | sourceTree = ""; 344 | }; 345 | 13B62171E2394EFB9D08B9EF /* Frameworks */ = { 346 | isa = PBXGroup; 347 | children = ( 348 | 7BB1900D73DA4BB3A3156FC4 /* libz.tbd */, 349 | ); 350 | name = Frameworks; 351 | path = ""; 352 | sourceTree = ""; 353 | }; 354 | /* End PBXGroup section */ 355 | 356 | /* Begin PBXNativeTarget section */ 357 | 00E356ED1AD99517003FC87E /* todoTests */ = { 358 | isa = PBXNativeTarget; 359 | buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "todoTests" */; 360 | buildPhases = ( 361 | 00E356EA1AD99517003FC87E /* Sources */, 362 | 00E356EB1AD99517003FC87E /* Frameworks */, 363 | 00E356EC1AD99517003FC87E /* Resources */, 364 | ); 365 | buildRules = ( 366 | ); 367 | dependencies = ( 368 | 00E356F51AD99517003FC87E /* PBXTargetDependency */, 369 | ); 370 | name = todoTests; 371 | productName = todoTests; 372 | productReference = 00E356EE1AD99517003FC87E /* todoTests.xctest */; 373 | productType = "com.apple.product-type.bundle.unit-test"; 374 | }; 375 | 13B07F861A680F5B00A75B9A /* todo */ = { 376 | isa = PBXNativeTarget; 377 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "todo" */; 378 | buildPhases = ( 379 | 13B07F871A680F5B00A75B9A /* Sources */, 380 | 13B07F8C1A680F5B00A75B9A /* Frameworks */, 381 | 13B07F8E1A680F5B00A75B9A /* Resources */, 382 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 383 | ); 384 | buildRules = ( 385 | ); 386 | dependencies = ( 387 | ); 388 | name = todo; 389 | productName = "Hello World"; 390 | productReference = 13B07F961A680F5B00A75B9A /* todo.app */; 391 | productType = "com.apple.product-type.application"; 392 | }; 393 | /* End PBXNativeTarget section */ 394 | 395 | /* Begin PBXProject section */ 396 | 83CBB9F71A601CBA00E9B192 /* Project object */ = { 397 | isa = PBXProject; 398 | attributes = { 399 | LastUpgradeCheck = 610; 400 | ORGANIZATIONNAME = Facebook; 401 | TargetAttributes = { 402 | 00E356ED1AD99517003FC87E = { 403 | CreatedOnToolsVersion = 6.2; 404 | TestTargetID = 13B07F861A680F5B00A75B9A; 405 | }; 406 | }; 407 | }; 408 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "todo" */; 409 | compatibilityVersion = "Xcode 3.2"; 410 | developmentRegion = English; 411 | hasScannedForEncodings = 0; 412 | knownRegions = ( 413 | en, 414 | Base, 415 | ); 416 | mainGroup = 83CBB9F61A601CBA00E9B192; 417 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; 418 | projectDirPath = ""; 419 | projectReferences = ( 420 | { 421 | ProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */; 422 | ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 423 | }, 424 | { 425 | ProductGroup = 5E91572E1DD0AC6500FF2AA8 /* Products */; 426 | ProjectRef = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */; 427 | }, 428 | { 429 | ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */; 430 | ProjectRef = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 431 | }, 432 | { 433 | ProductGroup = 00C302BC1ABCB91800DB3ED1 /* Products */; 434 | ProjectRef = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 435 | }, 436 | { 437 | ProductGroup = 78C398B11ACF4ADC00677621 /* Products */; 438 | ProjectRef = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 439 | }, 440 | { 441 | ProductGroup = 00C302D41ABCB9D200DB3ED1 /* Products */; 442 | ProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 443 | }, 444 | { 445 | ProductGroup = 139105B71AF99BAD00B5F7CC /* Products */; 446 | ProjectRef = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 447 | }, 448 | { 449 | ProductGroup = 832341B11AAA6A8300B99B32 /* Products */; 450 | ProjectRef = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 451 | }, 452 | { 453 | ProductGroup = 00C302E01ABCB9EE00DB3ED1 /* Products */; 454 | ProjectRef = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 455 | }, 456 | { 457 | ProductGroup = 139FDEE71B06529A00C62182 /* Products */; 458 | ProjectRef = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 459 | }, 460 | { 461 | ProductGroup = 146834001AC3E56700842450 /* Products */; 462 | ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */; 463 | }, 464 | ); 465 | projectRoot = ""; 466 | targets = ( 467 | 13B07F861A680F5B00A75B9A /* todo */, 468 | 00E356ED1AD99517003FC87E /* todoTests */, 469 | ); 470 | }; 471 | /* End PBXProject section */ 472 | 473 | /* Begin PBXReferenceProxy section */ 474 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */ = { 475 | isa = PBXReferenceProxy; 476 | fileType = archive.ar; 477 | path = libRCTActionSheet.a; 478 | remoteRef = 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */; 479 | sourceTree = BUILT_PRODUCTS_DIR; 480 | }; 481 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */ = { 482 | isa = PBXReferenceProxy; 483 | fileType = archive.ar; 484 | path = libRCTGeolocation.a; 485 | remoteRef = 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */; 486 | sourceTree = BUILT_PRODUCTS_DIR; 487 | }; 488 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */ = { 489 | isa = PBXReferenceProxy; 490 | fileType = archive.ar; 491 | path = libRCTImage.a; 492 | remoteRef = 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */; 493 | sourceTree = BUILT_PRODUCTS_DIR; 494 | }; 495 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */ = { 496 | isa = PBXReferenceProxy; 497 | fileType = archive.ar; 498 | path = libRCTNetwork.a; 499 | remoteRef = 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */; 500 | sourceTree = BUILT_PRODUCTS_DIR; 501 | }; 502 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */ = { 503 | isa = PBXReferenceProxy; 504 | fileType = archive.ar; 505 | path = libRCTVibration.a; 506 | remoteRef = 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */; 507 | sourceTree = BUILT_PRODUCTS_DIR; 508 | }; 509 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */ = { 510 | isa = PBXReferenceProxy; 511 | fileType = archive.ar; 512 | path = libRCTSettings.a; 513 | remoteRef = 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */; 514 | sourceTree = BUILT_PRODUCTS_DIR; 515 | }; 516 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */ = { 517 | isa = PBXReferenceProxy; 518 | fileType = archive.ar; 519 | path = libRCTWebSocket.a; 520 | remoteRef = 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */; 521 | sourceTree = BUILT_PRODUCTS_DIR; 522 | }; 523 | 146834041AC3E56700842450 /* libReact.a */ = { 524 | isa = PBXReferenceProxy; 525 | fileType = archive.ar; 526 | path = libReact.a; 527 | remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */; 528 | sourceTree = BUILT_PRODUCTS_DIR; 529 | }; 530 | 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */ = { 531 | isa = PBXReferenceProxy; 532 | fileType = archive.ar; 533 | path = libRCTAnimation.a; 534 | remoteRef = 5E9157321DD0AC6500FF2AA8 /* PBXContainerItemProxy */; 535 | sourceTree = BUILT_PRODUCTS_DIR; 536 | }; 537 | 5E9157351DD0AC6500FF2AA8 /* libRCTAnimation-tvOS.a */ = { 538 | isa = PBXReferenceProxy; 539 | fileType = archive.ar; 540 | path = "libRCTAnimation-tvOS.a"; 541 | remoteRef = 5E9157341DD0AC6500FF2AA8 /* PBXContainerItemProxy */; 542 | sourceTree = BUILT_PRODUCTS_DIR; 543 | }; 544 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = { 545 | isa = PBXReferenceProxy; 546 | fileType = archive.ar; 547 | path = libRCTLinking.a; 548 | remoteRef = 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */; 549 | sourceTree = BUILT_PRODUCTS_DIR; 550 | }; 551 | 832341B51AAA6A8300B99B32 /* libRCTText.a */ = { 552 | isa = PBXReferenceProxy; 553 | fileType = archive.ar; 554 | path = libRCTText.a; 555 | remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */; 556 | sourceTree = BUILT_PRODUCTS_DIR; 557 | }; 558 | /* End PBXReferenceProxy section */ 559 | 560 | /* Begin PBXResourcesBuildPhase section */ 561 | 00E356EC1AD99517003FC87E /* Resources */ = { 562 | isa = PBXResourcesBuildPhase; 563 | buildActionMask = 2147483647; 564 | files = ( 565 | ); 566 | runOnlyForDeploymentPostprocessing = 0; 567 | }; 568 | 13B07F8E1A680F5B00A75B9A /* Resources */ = { 569 | isa = PBXResourcesBuildPhase; 570 | buildActionMask = 2147483647; 571 | files = ( 572 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 573 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */, 574 | ); 575 | runOnlyForDeploymentPostprocessing = 0; 576 | }; 577 | /* End PBXResourcesBuildPhase section */ 578 | 579 | /* Begin PBXShellScriptBuildPhase section */ 580 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { 581 | isa = PBXShellScriptBuildPhase; 582 | buildActionMask = 2147483647; 583 | files = ( 584 | ); 585 | inputPaths = ( 586 | ); 587 | name = "Bundle React Native code and images"; 588 | outputPaths = ( 589 | ); 590 | runOnlyForDeploymentPostprocessing = 0; 591 | shellPath = /bin/sh; 592 | shellScript = "export NODE_BINARY=node\n../node_modules/react-native/packager/react-native-xcode.sh"; 593 | }; 594 | /* End PBXShellScriptBuildPhase section */ 595 | 596 | /* Begin PBXSourcesBuildPhase section */ 597 | 00E356EA1AD99517003FC87E /* Sources */ = { 598 | isa = PBXSourcesBuildPhase; 599 | buildActionMask = 2147483647; 600 | files = ( 601 | 00E356F31AD99517003FC87E /* todoTests.m in Sources */, 602 | ); 603 | runOnlyForDeploymentPostprocessing = 0; 604 | }; 605 | 13B07F871A680F5B00A75B9A /* Sources */ = { 606 | isa = PBXSourcesBuildPhase; 607 | buildActionMask = 2147483647; 608 | files = ( 609 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, 610 | 13B07FC11A68108700A75B9A /* main.m in Sources */, 611 | ); 612 | runOnlyForDeploymentPostprocessing = 0; 613 | }; 614 | /* End PBXSourcesBuildPhase section */ 615 | 616 | /* Begin PBXTargetDependency section */ 617 | 00E356F51AD99517003FC87E /* PBXTargetDependency */ = { 618 | isa = PBXTargetDependency; 619 | target = 13B07F861A680F5B00A75B9A /* todo */; 620 | targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; 621 | }; 622 | /* End PBXTargetDependency section */ 623 | 624 | /* Begin PBXVariantGroup section */ 625 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = { 626 | isa = PBXVariantGroup; 627 | children = ( 628 | 13B07FB21A68108700A75B9A /* Base */, 629 | ); 630 | name = LaunchScreen.xib; 631 | path = todo; 632 | sourceTree = ""; 633 | }; 634 | /* End PBXVariantGroup section */ 635 | 636 | /* Begin XCBuildConfiguration section */ 637 | 00E356F61AD99517003FC87E /* Debug */ = { 638 | isa = XCBuildConfiguration; 639 | buildSettings = { 640 | BUNDLE_LOADER = "$(TEST_HOST)"; 641 | GCC_PREPROCESSOR_DEFINITIONS = ( 642 | "DEBUG=1", 643 | "$(inherited)", 644 | ); 645 | INFOPLIST_FILE = todoTests/Info.plist; 646 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 647 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 648 | PRODUCT_NAME = "$(TARGET_NAME)"; 649 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/todo.app/todo"; 650 | LIBRARY_SEARCH_PATHS = ( 651 | "$(inherited)", 652 | "\"$(SRCROOT)/$(TARGET_NAME)\"", 653 | ); 654 | }; 655 | name = Debug; 656 | }; 657 | 00E356F71AD99517003FC87E /* Release */ = { 658 | isa = XCBuildConfiguration; 659 | buildSettings = { 660 | BUNDLE_LOADER = "$(TEST_HOST)"; 661 | COPY_PHASE_STRIP = NO; 662 | INFOPLIST_FILE = todoTests/Info.plist; 663 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 664 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 665 | PRODUCT_NAME = "$(TARGET_NAME)"; 666 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/todo.app/todo"; 667 | LIBRARY_SEARCH_PATHS = ( 668 | "$(inherited)", 669 | "\"$(SRCROOT)/$(TARGET_NAME)\"", 670 | ); 671 | }; 672 | name = Release; 673 | }; 674 | 13B07F941A680F5B00A75B9A /* Debug */ = { 675 | isa = XCBuildConfiguration; 676 | buildSettings = { 677 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 678 | CURRENT_PROJECT_VERSION = 1; 679 | DEAD_CODE_STRIPPING = NO; 680 | INFOPLIST_FILE = todo/Info.plist; 681 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 682 | OTHER_LDFLAGS = ( 683 | "$(inherited)", 684 | "-ObjC", 685 | "-lc++", 686 | ); 687 | PRODUCT_NAME = todo; 688 | VERSIONING_SYSTEM = "apple-generic"; 689 | }; 690 | name = Debug; 691 | }; 692 | 13B07F951A680F5B00A75B9A /* Release */ = { 693 | isa = XCBuildConfiguration; 694 | buildSettings = { 695 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 696 | CURRENT_PROJECT_VERSION = 1; 697 | INFOPLIST_FILE = todo/Info.plist; 698 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 699 | OTHER_LDFLAGS = ( 700 | "$(inherited)", 701 | "-ObjC", 702 | "-lc++", 703 | ); 704 | PRODUCT_NAME = todo; 705 | VERSIONING_SYSTEM = "apple-generic"; 706 | }; 707 | name = Release; 708 | }; 709 | 83CBBA201A601CBA00E9B192 /* Debug */ = { 710 | isa = XCBuildConfiguration; 711 | buildSettings = { 712 | ALWAYS_SEARCH_USER_PATHS = NO; 713 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 714 | CLANG_CXX_LIBRARY = "libc++"; 715 | CLANG_ENABLE_MODULES = YES; 716 | CLANG_ENABLE_OBJC_ARC = YES; 717 | CLANG_WARN_BOOL_CONVERSION = YES; 718 | CLANG_WARN_CONSTANT_CONVERSION = YES; 719 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 720 | CLANG_WARN_EMPTY_BODY = YES; 721 | CLANG_WARN_ENUM_CONVERSION = YES; 722 | CLANG_WARN_INT_CONVERSION = YES; 723 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 724 | CLANG_WARN_UNREACHABLE_CODE = YES; 725 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 726 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 727 | COPY_PHASE_STRIP = NO; 728 | ENABLE_STRICT_OBJC_MSGSEND = YES; 729 | GCC_C_LANGUAGE_STANDARD = gnu99; 730 | GCC_DYNAMIC_NO_PIC = NO; 731 | GCC_OPTIMIZATION_LEVEL = 0; 732 | GCC_PREPROCESSOR_DEFINITIONS = ( 733 | "DEBUG=1", 734 | "$(inherited)", 735 | ); 736 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 737 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 738 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 739 | GCC_WARN_UNDECLARED_SELECTOR = YES; 740 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 741 | GCC_WARN_UNUSED_FUNCTION = YES; 742 | GCC_WARN_UNUSED_VARIABLE = YES; 743 | HEADER_SEARCH_PATHS = ( 744 | "$(inherited)", 745 | "$(SRCROOT)/../node_modules/react-native/React/**", 746 | "$(SRCROOT)/../node_modules/react-native/ReactCommon/**", 747 | "$(SRCROOT)/../node_modules/react-native-code-push/ios/CodePush/**", 748 | ); 749 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 750 | MTL_ENABLE_DEBUG_INFO = YES; 751 | ONLY_ACTIVE_ARCH = YES; 752 | SDKROOT = iphoneos; 753 | }; 754 | name = Debug; 755 | }; 756 | 83CBBA211A601CBA00E9B192 /* Release */ = { 757 | isa = XCBuildConfiguration; 758 | buildSettings = { 759 | ALWAYS_SEARCH_USER_PATHS = NO; 760 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 761 | CLANG_CXX_LIBRARY = "libc++"; 762 | CLANG_ENABLE_MODULES = YES; 763 | CLANG_ENABLE_OBJC_ARC = YES; 764 | CLANG_WARN_BOOL_CONVERSION = YES; 765 | CLANG_WARN_CONSTANT_CONVERSION = YES; 766 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 767 | CLANG_WARN_EMPTY_BODY = YES; 768 | CLANG_WARN_ENUM_CONVERSION = YES; 769 | CLANG_WARN_INT_CONVERSION = YES; 770 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 771 | CLANG_WARN_UNREACHABLE_CODE = YES; 772 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 773 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 774 | COPY_PHASE_STRIP = YES; 775 | ENABLE_NS_ASSERTIONS = NO; 776 | ENABLE_STRICT_OBJC_MSGSEND = YES; 777 | GCC_C_LANGUAGE_STANDARD = gnu99; 778 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 779 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 780 | GCC_WARN_UNDECLARED_SELECTOR = YES; 781 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 782 | GCC_WARN_UNUSED_FUNCTION = YES; 783 | GCC_WARN_UNUSED_VARIABLE = YES; 784 | HEADER_SEARCH_PATHS = ( 785 | "$(inherited)", 786 | "$(SRCROOT)/../node_modules/react-native/React/**", 787 | "$(SRCROOT)/../node_modules/react-native/ReactCommon/**", 788 | "$(SRCROOT)/../node_modules/react-native-code-push/ios/CodePush/**", 789 | ); 790 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 791 | MTL_ENABLE_DEBUG_INFO = NO; 792 | SDKROOT = iphoneos; 793 | VALIDATE_PRODUCT = YES; 794 | }; 795 | name = Release; 796 | }; 797 | /* End XCBuildConfiguration section */ 798 | 799 | /* Begin XCConfigurationList section */ 800 | 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "todoTests" */ = { 801 | isa = XCConfigurationList; 802 | buildConfigurations = ( 803 | 00E356F61AD99517003FC87E /* Debug */, 804 | 00E356F71AD99517003FC87E /* Release */, 805 | ); 806 | defaultConfigurationIsVisible = 0; 807 | defaultConfigurationName = Release; 808 | }; 809 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "todo" */ = { 810 | isa = XCConfigurationList; 811 | buildConfigurations = ( 812 | 13B07F941A680F5B00A75B9A /* Debug */, 813 | 13B07F951A680F5B00A75B9A /* Release */, 814 | ); 815 | defaultConfigurationIsVisible = 0; 816 | defaultConfigurationName = Release; 817 | }; 818 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "todo" */ = { 819 | isa = XCConfigurationList; 820 | buildConfigurations = ( 821 | 83CBBA201A601CBA00E9B192 /* Debug */, 822 | 83CBBA211A601CBA00E9B192 /* Release */, 823 | ); 824 | defaultConfigurationIsVisible = 0; 825 | defaultConfigurationName = Release; 826 | }; 827 | /* End XCConfigurationList section */ 828 | }; 829 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; 830 | } 831 | -------------------------------------------------------------------------------- /ios/todo.xcodeproj/xcshareddata/xcschemes/todo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 77 | 83 | 84 | 85 | 86 | 87 | 88 | 94 | 96 | 102 | 103 | 104 | 105 | 107 | 108 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /ios/todo/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/todo/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 | #import "CodePush.h" 12 | 13 | #import "RCTBundleURLProvider.h" 14 | #import "RCTRootView.h" 15 | 16 | @implementation AppDelegate 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 19 | { 20 | NSURL *jsCodeLocation; 21 | 22 | 23 | #ifdef DEBUG 24 | jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil]; 25 | #else 26 | jsCodeLocation = [CodePush bundleURL]; 27 | #endif 28 | 29 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation 30 | moduleName:@"todo" 31 | initialProperties:nil 32 | launchOptions:launchOptions]; 33 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; 34 | 35 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 36 | UIViewController *rootViewController = [UIViewController new]; 37 | rootViewController.view = rootView; 38 | self.window.rootViewController = rootViewController; 39 | [self.window makeKeyAndVisible]; 40 | return YES; 41 | } 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /ios/todo/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/todo/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /ios/todo/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 | NSExceptionDomains 44 | 45 | localhost 46 | 47 | NSExceptionAllowsInsecureHTTPLoads 48 | 49 | 50 | 51 | 52 | CodePushDeploymentKey 53 | deployment-key-here 54 | 55 | -------------------------------------------------------------------------------- /ios/todo/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/todoTests/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/todoTests/todoTests.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 "RCTLog.h" 14 | #import "RCTRootView.h" 15 | 16 | #define TIMEOUT_SECONDS 600 17 | #define TEXT_TO_LOOK_FOR @"Welcome to React Native!" 18 | 19 | @interface todoTests : XCTestCase 20 | 21 | @end 22 | 23 | @implementation todoTests 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 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mytodo", 3 | "version": "0.0.1", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "asap": { 8 | "version": "2.0.6", 9 | "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", 10 | "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=" 11 | }, 12 | "core-js": { 13 | "version": "1.2.7", 14 | "resolved": "https://registry.npmjs.org/core-js/-/core-js-1.2.7.tgz", 15 | "integrity": "sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY=" 16 | }, 17 | "encoding": { 18 | "version": "0.1.12", 19 | "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", 20 | "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", 21 | "requires": { 22 | "iconv-lite": "0.4.19" 23 | } 24 | }, 25 | "fbjs": { 26 | "version": "0.8.16", 27 | "resolved": "https://registry.npmjs.org/fbjs/-/fbjs-0.8.16.tgz", 28 | "integrity": "sha1-XmdDL1UNxBtXK/VYR7ispk5TN9s=", 29 | "requires": { 30 | "core-js": "1.2.7", 31 | "isomorphic-fetch": "2.2.1", 32 | "loose-envify": "1.3.1", 33 | "object-assign": "4.1.1", 34 | "promise": "7.3.1", 35 | "setimmediate": "1.0.5", 36 | "ua-parser-js": "0.7.17" 37 | } 38 | }, 39 | "iconv-lite": { 40 | "version": "0.4.19", 41 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", 42 | "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==" 43 | }, 44 | "is-stream": { 45 | "version": "1.1.0", 46 | "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", 47 | "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" 48 | }, 49 | "isomorphic-fetch": { 50 | "version": "2.2.1", 51 | "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz", 52 | "integrity": "sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk=", 53 | "requires": { 54 | "node-fetch": "1.7.3", 55 | "whatwg-fetch": "2.0.3" 56 | } 57 | }, 58 | "js-tokens": { 59 | "version": "3.0.2", 60 | "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", 61 | "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=" 62 | }, 63 | "loose-envify": { 64 | "version": "1.3.1", 65 | "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.3.1.tgz", 66 | "integrity": "sha1-0aitM/qc4OcT1l/dCsi3SNR4yEg=", 67 | "requires": { 68 | "js-tokens": "3.0.2" 69 | } 70 | }, 71 | "node-fetch": { 72 | "version": "1.7.3", 73 | "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz", 74 | "integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==", 75 | "requires": { 76 | "encoding": "0.1.12", 77 | "is-stream": "1.1.0" 78 | } 79 | }, 80 | "object-assign": { 81 | "version": "4.1.1", 82 | "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", 83 | "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" 84 | }, 85 | "promise": { 86 | "version": "7.3.1", 87 | "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", 88 | "integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==", 89 | "requires": { 90 | "asap": "2.0.6" 91 | } 92 | }, 93 | "prop-types": { 94 | "version": "15.6.1", 95 | "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.6.1.tgz", 96 | "integrity": "sha512-4ec7bY1Y66LymSUOH/zARVYObB23AT2h8cf6e/O6ZALB/N0sqZFEx7rq6EYPX2MkOdKORuooI/H5k9TlR4q7kQ==", 97 | "requires": { 98 | "fbjs": "0.8.16", 99 | "loose-envify": "1.3.1", 100 | "object-assign": "4.1.1" 101 | } 102 | }, 103 | "setimmediate": { 104 | "version": "1.0.5", 105 | "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", 106 | "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" 107 | }, 108 | "ua-parser-js": { 109 | "version": "0.7.17", 110 | "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.17.tgz", 111 | "integrity": "sha512-uRdSdu1oA1rncCQL7sCj8vSyZkgtL7faaw9Tc9rZ3mGgraQ7+Pdx7w5mnOSF3gw9ZNG6oc+KXfkon3bKuROm0g==" 112 | }, 113 | "whatwg-fetch": { 114 | "version": "2.0.3", 115 | "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz", 116 | "integrity": "sha1-nITsLc9oGH/wC8ZOEnS0QhduHIQ=" 117 | } 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mytodo", 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 | "fix-watchman": "watchman watch-del-all && rm -rf node_modules && npm install && rm -fr $TMPDIR/react-*", 9 | "codepush-key": "code-push deployment ls mytodofirebase -k", 10 | "adb-reverse": "adb reverse tcp:8081 tcp:8081", 11 | "ios-dev": "react-native run-ios --simulator='iPhone 5'", 12 | "ios-codepush-staging": "code-push release-react todofirebase ios", 13 | "ios-codepush-production": "code-push release-react todofirebase ios -d Production", 14 | "ios-bundle": "react-native bundle --dev false --entry-file index.ios.js --bundle-output ios/main.jsbundle --platform ios", 15 | "ios-build": "react-native run-ios --configuration Release", 16 | "android-codepush-staging": "code-push release-react todofirebase android", 17 | "android-codepush-production": "code-push release-react todofirebase android -d Production", 18 | "android-clean": "cd android && ./gradlew clean", 19 | "android-build-debug": "cd android/ && ./gradlew assembleDebug", 20 | "android-signkey": "keytool -genkey -v -keystore my-release-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000", 21 | "android-release": "cd android && ./gradlew assembleRelease", 22 | "android-signer": "cd android/app/build/outputs/apk/ && jarsigner -verbose -keystore ~/.android/debug.keystore -storepass android -keypass android app-release-unsigned.apk androiddebugkey", 23 | "android-dev": "source ~/.bashrc && adb uninstall com.dwicao.todo && react-native run-android && adb reverse tcp:8081 tcp:8081 && react-native start", 24 | "android-bundle": "react-native bundle --platform android --dev false --entry-file ./index.android.js --bundle-output ./android/app/src/main/assets/index.android.bundle --sourcemap-output ./android/app/src/main/assets/index.android.map --assets-dest ./android/app/src/main/res/" 25 | }, 26 | "dependencies": { 27 | "firebase": "3.6.5", 28 | "prop-types": "^15.6.1", 29 | "react": "15.4.1", 30 | "react-native": "0.39.2", 31 | "react-native-code-push": "^1.16.1-beta", 32 | "react-native-drawer": "2.3.0", 33 | "react-native-router-flux": "^3.37.0", 34 | "react-redux": "^5.0.1", 35 | "redux": "^3.6.0", 36 | "redux-persist": "^4.0.1", 37 | "redux-thunk": "2.1.0" 38 | }, 39 | "devDependencies": { 40 | "babel-jest": "18.0.0", 41 | "babel-preset-react-native": "1.9.1", 42 | "jest": "18.1.0", 43 | "react-test-renderer": "15.4.1" 44 | }, 45 | "jest": { 46 | "preset": "react-native" 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/actions/actionTypes.js: -------------------------------------------------------------------------------- 1 | export const ADD_TODO = 'ADD_TODO'; 2 | export const TOGGLE_TODO = 'TOGGLE_TODO'; 3 | export const REMOVE_TODO = 'REMOVE_TODO'; 4 | export const EDIT_TODO = 'EDIT_TODO'; 5 | export const TOGGLE_EDIT_TODO = 'TOGGLE_EDIT_TODO'; 6 | export const TOGGLE_STAR_TODO = 'TOGGLE_STAR_TODO'; 7 | export const SET_VISIBILITY_FILTER = 'SET_VISIBILITY_FILTER'; 8 | export const UPDATE_TODO = 'UPDATE_TODO'; 9 | export const CHANGE_EMAIL_LOGIN = 'CHANGE_EMAIL_LOGIN'; 10 | export const CHANGE_EMAIL_SIGNUP = 'CHANGE_EMAIL_SIGNUP'; 11 | export const CHANGE_PASSWORD_LOGIN = 'CHANGE_PASSWORD_LOGIN'; 12 | export const CHANGE_PASSWORD_SIGNUP = 'CHANGE_PASSWORD_SIGNUP'; 13 | export const DELETE_ALL_TODO = 'DELETE_ALL_TODO'; 14 | export const CHANGE_USER_DATA = 'CHANGE_USER_DATA'; 15 | export const CHANGE_CONDITION = 'CHANGE_CONDITION'; 16 | -------------------------------------------------------------------------------- /src/actions/todoActions.js: -------------------------------------------------------------------------------- 1 | import * as types from './actionTypes'; 2 | import { Alert } from 'react-native'; 3 | import firebase, {firebaseRef} from '../firebase'; 4 | 5 | 6 | export function fetchTodos(uid) { 7 | return (dispatch, getState) => { 8 | const todosRef = firebaseRef.child(`todos/${uid}`); 9 | 10 | return todosRef.once('value').then(snapshot => { 11 | const todos = snapshot.val() || {}; 12 | 13 | Object.keys(todos).map(todoId => { 14 | const parsedTodos = { 15 | id: todoId, 16 | ...todos[todoId] 17 | }; 18 | 19 | dispatch(addTodo(parsedTodos)); 20 | }); 21 | }); 22 | }; 23 | } 24 | 25 | export function startAddTodo(text) { 26 | return (dispatch, getState) => { 27 | const UID = firebase.auth().currentUser.uid; 28 | const todo = { 29 | text, 30 | isDone: false, 31 | isStarred: false 32 | }; 33 | const todoRef = firebaseRef.child(`todos/${UID}`).push(todo); 34 | 35 | dispatch(addTodo({ 36 | id: todoRef.key, 37 | ...todo 38 | })); 39 | 40 | todoRef.then(snapshot => { 41 | return; 42 | }, error => { 43 | Alert.alert(JSON.stringify(error.message)); 44 | }); 45 | }; 46 | } 47 | 48 | export function startUpdateTodo(id, key, value) { 49 | return (dispatch, getState) => { 50 | const UID = firebase.auth().currentUser.uid; 51 | const todoRef = firebaseRef.child(`todos/${UID}/${id}`); 52 | let updates = {}; 53 | updates[key] = value; 54 | 55 | dispatch(updateTodo(id, updates)); 56 | 57 | todoRef.update(updates).then(snapshot => { 58 | return; 59 | }, error => { 60 | Alert.alert(JSON.stringify(error.message)); 61 | }); 62 | }; 63 | } 64 | 65 | export function startRemoveTodo(id) { 66 | return (dispatch, getState) => { 67 | const UID = firebase.auth().currentUser.uid; 68 | const todoRef = firebaseRef.child(`todos/${UID}/${id}`); 69 | 70 | dispatch(removeTodo(id)); 71 | 72 | todoRef.remove().then(snapshot => { 73 | return; 74 | }, error => { 75 | Alert.alert(JSON.stringify(error.message)); 76 | }); 77 | }; 78 | } 79 | 80 | export function startSignup(email, password) { 81 | return (dispatch, getState) => { 82 | return firebase.auth().createUserWithEmailAndPassword(email, password); 83 | }; 84 | } 85 | 86 | export function startLogin(email, password) { 87 | return (dispatch, getState) => { 88 | return firebase.auth().signInWithEmailAndPassword(email, password); 89 | }; 90 | } 91 | 92 | export function startLogout() { 93 | return (dispatch, getState) => { 94 | return firebase.auth().signOut(); 95 | }; 96 | } 97 | 98 | export function changeEmailLogin(emailLogin) { 99 | return { 100 | type: types.CHANGE_EMAIL_LOGIN, 101 | emailLogin 102 | } 103 | } 104 | 105 | export function changeEmailSignup(emailSignup) { 106 | return { 107 | type: types.CHANGE_EMAIL_SIGNUP, 108 | emailSignup 109 | } 110 | } 111 | 112 | export function changePasswordLogin(passwordLogin) { 113 | return { 114 | type: types.CHANGE_PASSWORD_LOGIN, 115 | passwordLogin 116 | } 117 | } 118 | 119 | export function changePasswordSignup(passwordSignup) { 120 | return { 121 | type: types.CHANGE_PASSWORD_SIGNUP, 122 | passwordSignup 123 | } 124 | } 125 | 126 | export function changeUserData(payload) { 127 | return { 128 | type: types.CHANGE_USER_DATA, 129 | payload 130 | } 131 | } 132 | 133 | export function changeCondition(payload) { 134 | return { 135 | type: types.CHANGE_CONDITION, 136 | payload 137 | } 138 | } 139 | 140 | export function addTodo(payload) { 141 | return { 142 | type: types.ADD_TODO, 143 | payload 144 | }; 145 | } 146 | 147 | export function updateTodo(id, payload) { 148 | return { 149 | type: types.UPDATE_TODO, 150 | id, 151 | payload 152 | }; 153 | } 154 | 155 | export function deleteAllTodo() { 156 | return { 157 | type: types.DELETE_ALL_TODO 158 | } 159 | } 160 | 161 | export function toggleStarTodo(id) { 162 | return { 163 | type: types.TOGGLE_STAR_TODO, 164 | id 165 | }; 166 | } 167 | 168 | export function toggleEditTodo(id) { 169 | return { 170 | type: types.TOGGLE_EDIT_TODO, 171 | id 172 | } 173 | } 174 | 175 | export function editTodo(id, text) { 176 | return { 177 | type: types.EDIT_TODO, 178 | id, 179 | text 180 | }; 181 | } 182 | 183 | export function removeTodo(id) { 184 | return { 185 | type: types.REMOVE_TODO, 186 | id 187 | }; 188 | } 189 | 190 | export function setVisibilityFilter(filter) { 191 | return { 192 | type: types.SET_VISIBILITY_FILTER, 193 | filter 194 | }; 195 | } 196 | -------------------------------------------------------------------------------- /src/components/AddTodo/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Dimensions from 'Dimensions'; 3 | import { 4 | View, 5 | TextInput, 6 | StyleSheet, 7 | } from 'react-native'; 8 | 9 | import plusIcon from '../../icons/plus.png'; 10 | import ButtonIcon from '../Buttons/ButtonIcon'; 11 | 12 | const DEVICE_WIDTH = Dimensions.get('window').width; 13 | 14 | const AddTodo = props => { 15 | const { 16 | todos, 17 | actions, 18 | style, 19 | } = props; 20 | 21 | let textInput; 22 | let textValue = ''; 23 | 24 | const _onSubmitEditing = () => { 25 | if (textValue.length > 0) { 26 | actions.startAddTodo(textValue); 27 | } 28 | textInput.clear(); 29 | } 30 | 31 | const _onChangeText = text => textValue = text; 32 | 33 | return ( 34 | 35 | textInput = el} /> 45 | 49 | 50 | ); 51 | }; 52 | 53 | const styles = StyleSheet.create({ 54 | container: { 55 | flex: 0, 56 | }, 57 | plusButton: { 58 | marginRight: 15, 59 | marginTop: -35, 60 | alignItems: 'flex-end', 61 | }, 62 | textInput: { 63 | alignSelf: 'center', 64 | height: 40, 65 | width: DEVICE_WIDTH - 20, 66 | marginTop: 15, 67 | paddingLeft: 10, 68 | paddingRight: 35, 69 | color: 'white', 70 | borderRadius: 2, 71 | backgroundColor: 'rgba(0, 0, 0, 0.3)', 72 | }, 73 | }); 74 | 75 | export default AddTodo; 76 | -------------------------------------------------------------------------------- /src/components/Buttons/ButtonFilter.js: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types'; 2 | import React from 'react'; 3 | import { 4 | TouchableOpacity, 5 | Text, 6 | } from 'react-native'; 7 | 8 | const ButtonFilter = props => { 9 | const { 10 | children, 11 | todos, 12 | actions, 13 | visibilityFilter, 14 | filter, 15 | txtStyle, 16 | activeOpacity, 17 | activeStyle, 18 | UnactiveStyle, 19 | } = props; 20 | 21 | const _onPress = () => actions.setVisibilityFilter(filter); 22 | const activeOrNot = (filter === visibilityFilter) ? activeStyle : UnactiveStyle; 23 | 24 | return ( 25 | 27 | 28 | {children} 29 | 30 | 31 | ); 32 | }; 33 | 34 | ButtonFilter.propTypes = { 35 | todos: PropTypes.array, 36 | actions: PropTypes.object.isRequired, 37 | visibilityFilter: PropTypes.string.isRequired, 38 | filter: PropTypes.string.isRequired, 39 | txtStyle: PropTypes.number, 40 | activeOpacity: PropTypes.number, 41 | activeStyle: PropTypes.number.isRequired, 42 | UnactiveStyle: PropTypes.number.isRequired, 43 | }; 44 | 45 | export default ButtonFilter; -------------------------------------------------------------------------------- /src/components/Buttons/ButtonIcon.js: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types'; 2 | import React from 'react'; 3 | import { 4 | View, 5 | Image, 6 | TouchableWithoutFeedback, 7 | } from 'react-native'; 8 | 9 | const ButtonIcon = props => { 10 | const { 11 | style, 12 | onPress, 13 | source, 14 | width, 15 | height, 16 | } = props; 17 | 18 | const _onPress = () => onPress(); 19 | 20 | return ( 21 | 22 | 24 | 25 | 26 | 27 | ); 28 | }; 29 | 30 | ButtonIcon.propTypes = { 31 | style: PropTypes.number, 32 | onPress: PropTypes.func.isRequired, 33 | source: PropTypes.number.isRequired, 34 | width: PropTypes.number.isRequired, 35 | height: PropTypes.number.isRequired, 36 | }; 37 | 38 | export default ButtonIcon; -------------------------------------------------------------------------------- /src/components/Container/index.js: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types'; 2 | import React, { Component } from 'react'; 3 | import {connect} from 'react-redux'; 4 | import {bindActionCreators} from 'redux'; 5 | import * as todoActions from '../../actions/todoActions'; 6 | import { 7 | StyleSheet, 8 | Image, 9 | View, 10 | Platform 11 | } from 'react-native'; 12 | 13 | import bgSrc from '../../images/bg.jpg'; 14 | 15 | class Container extends Component { 16 | render() { 17 | const { 18 | children, 19 | todos, 20 | actions, 21 | formData, 22 | visibilityFilter, 23 | userData, 24 | condition, 25 | } = this.props; 26 | 27 | const renderChildren = Array.isArray(children) ? 28 | children.map((child, key) => React.cloneElement(child, { 29 | key, 30 | todos, 31 | actions, 32 | formData, 33 | visibilityFilter, 34 | userData, 35 | condition, 36 | })) 37 | : 38 | React.cloneElement(children, { 39 | todos, 40 | actions, 41 | formData, 42 | visibilityFilter, 43 | userData, 44 | condition, 45 | }); 46 | 47 | if (this.props.wallpaper) { 48 | return ( 49 | 52 | {renderChildren} 53 | 54 | ); 55 | } 56 | 57 | return ( 58 | 59 | {renderChildren} 60 | 61 | ); 62 | } 63 | } 64 | 65 | const statusbarTop = (Platform.OS === 'ios') ? 20 : 0; 66 | 67 | const styles = StyleSheet.create({ 68 | picture: { 69 | flex: 1, 70 | width: null, 71 | height: null, 72 | resizeMode: 'cover', 73 | top: statusbarTop, 74 | }, 75 | view: { 76 | top: statusbarTop, 77 | } 78 | }); 79 | 80 | Container.defaultProps = { 81 | source: bgSrc, 82 | wallpaper: true, 83 | }; 84 | 85 | Container.propTypes = { 86 | style: PropTypes.number, 87 | source: PropTypes.number, 88 | wallpaper: PropTypes.bool, 89 | todos: PropTypes.array.isRequired, 90 | actions: PropTypes.object.isRequired, 91 | formData: PropTypes.object.isRequired, 92 | visibilityFilter: PropTypes.string.isRequired, 93 | userData: PropTypes.object.isRequired, 94 | condition: PropTypes.object.isRequired, 95 | }; 96 | 97 | function mapStateToProps(state) { 98 | return { 99 | todos: state.todos, 100 | formData: state.formData, 101 | visibilityFilter: state.visibilityFilter, 102 | userData: state.userData, 103 | condition: state.condition, 104 | }; 105 | } 106 | 107 | function mapDispatchToProps(dispatch) { 108 | return { 109 | actions: bindActionCreators(todoActions, dispatch) 110 | }; 111 | } 112 | 113 | export default connect(mapStateToProps, mapDispatchToProps)(Container); 114 | -------------------------------------------------------------------------------- /src/components/ControlPanel/index.js: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types'; 2 | import React from 'react'; 3 | import Dimensions from 'Dimensions'; 4 | import { Actions, ActionConst } from 'react-native-router-flux'; 5 | import { 6 | View, 7 | Text, 8 | TouchableOpacity, 9 | StyleSheet, 10 | Alert, 11 | Image, 12 | Platform, 13 | } from 'react-native'; 14 | import logoSrc from '../../images/logo.png'; 15 | 16 | const ControlPanel = props => { 17 | const { 18 | todos, 19 | actions, 20 | formData, 21 | userData, 22 | } = props; 23 | 24 | const _onPress = () => { 25 | actions.startLogout().then(() => { 26 | actions.changeUserData({ email: null }); 27 | Actions.loginScreen({ type: ActionConst.RESET }); 28 | }, error => { 29 | Alert.alert(JSON.stringify(error.message)); 30 | }); 31 | }; 32 | 33 | const _getActiveTodo = () => { 34 | let totalActiveTodo = 0; 35 | 36 | todos.map(todo => { 37 | if (!todo.isDone) { 38 | totalActiveTodo++; 39 | } 40 | }); 41 | 42 | return totalActiveTodo; 43 | } 44 | 45 | const _getCompletedTodo = () => { 46 | let totalCompletedTodo = 0; 47 | 48 | todos.map(todo => { 49 | if (!!todo.isDone) { 50 | totalCompletedTodo++; 51 | } 52 | }); 53 | 54 | return totalCompletedTodo; 55 | } 56 | 57 | const _getFavoritedTodo = () => { 58 | let totalFavoritedTodo = 0; 59 | 60 | todos.map(todo => { 61 | if (!!todo.isStarred) { 62 | totalFavoritedTodo++; 63 | } 64 | }); 65 | 66 | return totalFavoritedTodo; 67 | } 68 | 69 | const _getTotalTodos = () => { 70 | return todos.length; 71 | } 72 | 73 | return ( 74 | 75 | 76 | 77 | My Todo 78 | 79 | 80 | 81 | Have a nice day,{'\n'} 82 | {props.userData.email} 83 | 84 | 85 | 86 | 87 | Statistics 88 | 89 | 90 | {`${_getActiveTodo()} Active\n`} 91 | 92 | 93 | {`${_getCompletedTodo()} Completed\n`} 94 | 95 | 96 | {`${_getFavoritedTodo()} Favorited\n`} 97 | 98 | 99 | {`${_getTotalTodos()} Total Todos\n`} 100 | 101 | 102 | 103 | 106 | LOGOUT 107 | 108 | 109 | 110 | ); 111 | } 112 | 113 | const bottomSpace = (Platform.OS === 'ios') ? 20 : 0; 114 | const DEVICE_WIDTH = Dimensions.get('window').width; 115 | 116 | const styles = StyleSheet.create({ 117 | container: { 118 | flex: 1, 119 | alignItems: 'center', 120 | }, 121 | logo: { 122 | marginTop: 30, 123 | width: 80, 124 | height: 80, 125 | }, 126 | logoDescription: { 127 | marginTop: 10, 128 | fontSize: 20, 129 | fontWeight: 'bold', 130 | letterSpacing: 1, 131 | color: 'white', 132 | }, 133 | headerWrapper: { 134 | marginTop: 20, 135 | borderTopWidth: 0.5, 136 | borderColor: 'white', 137 | width: DEVICE_WIDTH * 0.6, 138 | }, 139 | header: { 140 | marginTop: 20, 141 | color: 'white', 142 | fontSize: 14, 143 | textAlign: 'center', 144 | }, 145 | statsWrapper: { 146 | marginTop: 20, 147 | marginBottom: 50, 148 | borderTopWidth: 0.5, 149 | borderBottomWidth: 0.5, 150 | borderColor: 'white', 151 | width: DEVICE_WIDTH * 0.6, 152 | alignItems: 'center', 153 | }, 154 | statsHeader: { 155 | marginVertical: 10, 156 | fontSize: 22, 157 | color: 'white', 158 | }, 159 | stats: { 160 | alignSelf: 'flex-start', 161 | color: 'white', 162 | textAlign: 'left', 163 | }, 164 | statsLastChild: { 165 | marginBottom: 10, 166 | }, 167 | buttonWrapper: { 168 | flex: 1, 169 | marginBottom: bottomSpace, 170 | justifyContent: 'flex-end', 171 | }, 172 | buttonLogout: { 173 | alignItems: 'center', 174 | justifyContent: 'center', 175 | width: DEVICE_WIDTH * 0.7, 176 | height: 40, 177 | borderLeftWidth: 3, 178 | borderColor: '#D25740', 179 | backgroundColor: '#cccccc', 180 | }, 181 | logoutText: { 182 | textAlign: 'center', 183 | fontWeight: 'bold', 184 | color: 'gray', 185 | letterSpacing: 1, 186 | } 187 | }); 188 | 189 | export default ControlPanel; 190 | -------------------------------------------------------------------------------- /src/components/EditTodo/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Actions, ActionConst } from 'react-native-router-flux'; 3 | import { 4 | StyleSheet, 5 | View, 6 | Text, 7 | TextInput, 8 | Image, 9 | TouchableOpacity, 10 | } from 'react-native'; 11 | 12 | import backIcon from '../../icons/back.png'; 13 | 14 | const EditTodo = props => { 15 | const { 16 | todos, 17 | actions, 18 | id, 19 | text 20 | } = props; 21 | 22 | let textValue = text; 23 | 24 | const _onPress = () => { 25 | actions.editTodo(id, textValue); 26 | actions.startUpdateTodo(id, 'text', textValue); 27 | Actions.mainScreen({type: ActionConst.RESET}); 28 | } 29 | 30 | const _onChangeText = value => textValue = value; 31 | 32 | return ( 33 | 34 | 35 | 41 | {text} 42 | 43 | 44 | 45 | 48 | 49 | 50 | 51 | 52 | ); 53 | } 54 | 55 | const styles = StyleSheet.create({ 56 | container: { 57 | flex: 1, 58 | }, 59 | textInputWrapper: { 60 | marginTop: 20, 61 | marginHorizontal: 15, 62 | }, 63 | textInput: { 64 | height: 100, 65 | paddingHorizontal: 10, 66 | backgroundColor: 'rgba(0, 0, 0, 0.5)', 67 | }, 68 | text: { 69 | color: 'white', 70 | backgroundColor: 'transparent', 71 | }, 72 | btnWrapper: { 73 | alignItems: 'flex-end', 74 | justifyContent: 'flex-end', 75 | }, 76 | btn: { 77 | margin: 20, 78 | width: 40, 79 | height: 40, 80 | borderRadius: 100, 81 | backgroundColor: 'rgba(255, 255, 255, 0.3)', 82 | }, 83 | image: { 84 | width: 40, 85 | height: 40, 86 | }, 87 | }); 88 | 89 | export default EditTodo; 90 | -------------------------------------------------------------------------------- /src/components/ListTodo/List.js: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types'; 2 | import React from 'react'; 3 | import { 4 | StyleSheet, 5 | ScrollView, 6 | TouchableOpacity, 7 | Text, 8 | View, 9 | Platform, 10 | } from 'react-native'; 11 | 12 | import ButtonIcon from '../Buttons/ButtonIcon'; 13 | 14 | const List = props => { 15 | const { 16 | todos, 17 | actions, 18 | visibleTodos, 19 | leftOnPress, 20 | leftUnactiveIcon, 21 | leftActiveIcon, 22 | rightOnPress, 23 | rightUnactiveIcon, 24 | rightActiveIcon, 25 | iconDelete, 26 | onDelete, 27 | textOnPress, 28 | } = props; 29 | 30 | const _renderList = (todo, index) => { 31 | const doneOrNot = todo.isDone ? leftActiveIcon : leftUnactiveIcon; 32 | const starredOrNot = todo.isStarred ? rightActiveIcon : rightUnactiveIcon; 33 | const textDoneOrNot = todo.isDone ? styles.textDone : styles.textNotDone; 34 | 35 | const deleteOrStar = () => { 36 | if (todo.isDone) { 37 | return 41 | } else { 42 | return 46 | } 47 | } 48 | 49 | return ( 50 | 51 | 55 | 58 | 60 | { todo.text } 61 | 62 | 63 | { deleteOrStar() } 64 | 65 | ); 66 | } 67 | 68 | return ( 69 | 71 | { visibleTodos.map(_renderList) } 72 | 73 | ); 74 | }; 75 | 76 | const marginBottom = (Platform.OS === 'ios') ? 20 : 0; 77 | 78 | const styles = StyleSheet.create({ 79 | scroll: { 80 | flex: 1, 81 | marginBottom: marginBottom, 82 | }, 83 | textButton: { 84 | flex: 1, 85 | }, 86 | textNotDone: { 87 | color: 'white', 88 | }, 89 | textDone: { 90 | color: 'white', 91 | textDecorationLine: 'line-through', 92 | }, 93 | leftButton: { 94 | marginHorizontal: 10, 95 | }, 96 | rightButton: { 97 | marginLeft: 5, 98 | marginRight: 10, 99 | }, 100 | row: { 101 | alignItems: 'center', 102 | justifyContent: 'space-between', 103 | flexDirection: 'row', 104 | height: 40, 105 | marginHorizontal: 10, 106 | marginVertical: 1, 107 | borderRadius: 2, 108 | backgroundColor: 'rgba(255, 255, 255, 0.3)', 109 | }, 110 | }); 111 | 112 | List.propTypes = { 113 | style: PropTypes.number, 114 | todos: PropTypes.array.isRequired, 115 | actions: PropTypes.object.isRequired, 116 | visibleTodos: PropTypes.array.isRequired, 117 | leftOnPress: PropTypes.func.isRequired, 118 | leftUnactiveIcon: PropTypes.number.isRequired, 119 | leftActiveIcon: PropTypes.number.isRequired, 120 | rightOnPress: PropTypes.func.isRequired, 121 | rightUnactiveIcon: PropTypes.number.isRequired, 122 | rightActiveIcon: PropTypes.number.isRequired, 123 | onDelete: PropTypes.func.isRequired, 124 | iconDelete: PropTypes.number.isRequired, 125 | textOnPress: PropTypes.func.isRequired, 126 | }; 127 | 128 | export default List; 129 | -------------------------------------------------------------------------------- /src/components/ListTodo/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Actions, ActionConst } from 'react-native-router-flux'; 3 | import { 4 | ScrollView, 5 | StyleSheet, 6 | Text, 7 | View, 8 | } from 'react-native'; 9 | 10 | import List from './List'; 11 | import iconCheck from '../../icons/check.png'; 12 | import iconUncheck from '../../icons/uncheck.png'; 13 | import iconStar from '../../icons/star.png'; 14 | import iconUnStar from '../../icons/unstar.png'; 15 | import iconDelete from '../../icons/remove.png'; 16 | 17 | const TodoList = props => { 18 | const { 19 | todos, 20 | actions, 21 | visibilityFilter, 22 | } = props; 23 | 24 | const getVisibleTodos = (allTodos, whatFilter) => { 25 | switch(whatFilter) { 26 | case 'SHOW_ALL': 27 | return allTodos; 28 | case 'SHOW_COMPLETED': 29 | return allTodos.filter( 30 | t => t.isDone 31 | ); 32 | case 'SHOW_ACTIVE': 33 | return allTodos.filter( 34 | t => !t.isDone 35 | ); 36 | case 'SHOW_FAVORITE': 37 | return allTodos.filter( 38 | t => t.isStarred 39 | ); 40 | } 41 | }; 42 | 43 | const visibleTodos = getVisibleTodos( 44 | todos, 45 | visibilityFilter 46 | ); 47 | 48 | const _leftOnPress = (id, isDone) => event => actions.startUpdateTodo(id, 'isDone', !isDone); 49 | const _rightOnPress = (id, isStarred) => event => actions.startUpdateTodo(id, 'isStarred', !isStarred); 50 | const _onDelete = id => event => actions.startRemoveTodo(id); 51 | const _textOnPress = (id, text) => event => { 52 | Actions.editScreen({ 53 | type: ActionConst.PUSH, 54 | id, 55 | text, 56 | }); 57 | } 58 | 59 | return ( 60 | 61 | 73 | 74 | ); 75 | }; 76 | 77 | const styles = StyleSheet.create({ 78 | container: { 79 | flex: 1, 80 | marginBottom: 10, 81 | }, 82 | }); 83 | 84 | export default TodoList; 85 | -------------------------------------------------------------------------------- /src/components/LoginSignup/ButtonLogin.js: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types'; 2 | import React, { Component } from 'react'; 3 | import Dimensions from 'Dimensions'; 4 | import { 5 | StyleSheet, 6 | TouchableOpacity, 7 | Text, 8 | Animated, 9 | Easing, 10 | Image, 11 | Alert, 12 | View, 13 | } from 'react-native'; 14 | import { Actions, ActionConst } from 'react-native-router-flux'; 15 | import ToSignup from './ToSignup'; 16 | import spinner from '../../icons/loading.gif'; 17 | 18 | const DEVICE_WIDTH = Dimensions.get('window').width; 19 | const DEVICE_HEIGHT = Dimensions.get('window').height; 20 | const MARGIN = 40; 21 | 22 | export default class ButtonLogin extends Component { 23 | constructor() { 24 | super(); 25 | 26 | this.buttonAnimated = new Animated.Value(0); 27 | this._onPress = this._onPress.bind(this); 28 | } 29 | 30 | componentDidMount() { 31 | const { todos, actions, formData, condition } = this.props; 32 | actions.changeCondition({ isLoading: false }); 33 | } 34 | 35 | componentWillUnmount() { 36 | const { todos, actions, formData, condition } = this.props; 37 | actions.changeCondition({ isLoading: false }); 38 | this.buttonAnimated.setValue(0); 39 | actions.changeEmailLogin(''); 40 | actions.changePasswordLogin(''); 41 | } 42 | 43 | _onPress() { 44 | const { todos, actions, formData, condition } = this.props; 45 | const userLogin = actions.startLogin(formData.emailLogin, formData.passwordLogin); 46 | 47 | if (condition.isLoading) return; 48 | 49 | actions.changeCondition({ isLoading: true }); 50 | Animated.timing( 51 | this.buttonAnimated, 52 | { 53 | toValue: 1, 54 | duration: 200, 55 | easing: Easing.linear 56 | } 57 | ).start(); 58 | 59 | userLogin 60 | .then(snapshot => { 61 | actions.changeUserData({ email: snapshot.email }); 62 | actions.deleteAllTodo(); 63 | actions.fetchTodos(snapshot.uid); 64 | Actions.mainScreen(); 65 | }, error => { 66 | Alert.alert(JSON.stringify(error.message)); 67 | actions.changeCondition({ isLoading: false }); 68 | this.buttonAnimated.setValue(0); 69 | }); 70 | } 71 | 72 | render() { 73 | const { todos, actions, formData, condition } = this.props; 74 | 75 | const changeWidth = this.buttonAnimated.interpolate({ 76 | inputRange: [0, 1], 77 | outputRange: [DEVICE_WIDTH - MARGIN, MARGIN] 78 | }); 79 | 80 | return ( 81 | 82 | 83 | 86 | {condition.isLoading ? 87 | 88 | : 89 | LOGIN 90 | } 91 | 92 | 93 | 94 | 95 | ); 96 | } 97 | } 98 | 99 | const styles = StyleSheet.create({ 100 | container: { 101 | flex: 1, 102 | marginTop: -10, 103 | alignItems: 'center', 104 | justifyContent: 'flex-start', 105 | }, 106 | button: { 107 | alignItems: 'center', 108 | justifyContent: 'center', 109 | backgroundColor: '#E7BCAA', 110 | height: MARGIN, 111 | borderRadius: 20, 112 | zIndex: 100, 113 | }, 114 | text: { 115 | color: 'white', 116 | fontWeight: 'bold', 117 | letterSpacing: 1, 118 | backgroundColor: 'transparent', 119 | }, 120 | image: { 121 | width: 24, 122 | height: 24, 123 | }, 124 | }); 125 | -------------------------------------------------------------------------------- /src/components/LoginSignup/ButtonSignup.js: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types'; 2 | import React, { Component } from 'react'; 3 | import firebase, {firebaseRef} from '../../firebase'; 4 | import Dimensions from 'Dimensions'; 5 | import { 6 | StyleSheet, 7 | TouchableOpacity, 8 | Text, 9 | Animated, 10 | Easing, 11 | Image, 12 | Alert, 13 | View, 14 | } from 'react-native'; 15 | import { Actions, ActionConst } from 'react-native-router-flux'; 16 | import ToLogin from './ToLogin'; 17 | import spinner from '../../icons/loading.gif'; 18 | 19 | const DEVICE_WIDTH = Dimensions.get('window').width; 20 | const DEVICE_HEIGHT = Dimensions.get('window').height; 21 | const MARGIN = 40; 22 | 23 | export default class ButtonSignup extends Component { 24 | constructor() { 25 | super(); 26 | 27 | this.buttonAnimated = new Animated.Value(0); 28 | this._onPress = this._onPress.bind(this); 29 | } 30 | 31 | componentDidMount() { 32 | const { todos, actions, formData, condition } = this.props; 33 | actions.changeCondition({ isLoading: false }); 34 | } 35 | 36 | componentWillUnmount() { 37 | const { todos, actions, formData, condition } = this.props; 38 | actions.changeCondition({ isLoading: false }); 39 | this.buttonAnimated.setValue(0); 40 | actions.changeEmailLogin(''); 41 | actions.changePasswordLogin(''); 42 | } 43 | 44 | _onPress() { 45 | const { todos, actions, formData, condition } = this.props; 46 | const userSignup = actions.startSignup(formData.emailSignup, formData.passwordSignup); 47 | 48 | if (condition.isLoading) return; 49 | 50 | actions.changeCondition({ isLoading: true }); 51 | Animated.timing( 52 | this.buttonAnimated, 53 | { 54 | toValue: 1, 55 | duration: 200, 56 | easing: Easing.linear 57 | } 58 | ).start(); 59 | 60 | userSignup 61 | .then(snapshot => { 62 | const usersRef = firebaseRef.child('users'); 63 | const todosRef = firebaseRef.child('todos'); 64 | const todo = { 65 | isDone: false, 66 | isStarred: false, 67 | text: `Welcome ${snapshot.email}` 68 | } 69 | 70 | todosRef.child(snapshot.uid).push(todo); 71 | 72 | usersRef.child(snapshot.uid).set({ 73 | email: formData.emailSignup, 74 | }); 75 | 76 | actions.changeUserData({ email: snapshot.email }); 77 | actions.deleteAllTodo(); 78 | actions.fetchTodos(snapshot.uid); 79 | Actions.mainScreen(); 80 | }, error => { 81 | Alert.alert(JSON.stringify(error.message)); 82 | actions.changeCondition({ isLoading: false }); 83 | this.buttonAnimated.setValue(0); 84 | }); 85 | } 86 | 87 | render() { 88 | const { todos, actions, formData, condition } = this.props; 89 | 90 | const changeWidth = this.buttonAnimated.interpolate({ 91 | inputRange: [0, 1], 92 | outputRange: [DEVICE_WIDTH - MARGIN, MARGIN] 93 | }); 94 | 95 | return ( 96 | 97 | 98 | 101 | {condition.isLoading ? 102 | 103 | : 104 | REGISTER 105 | } 106 | 107 | 108 | 109 | 110 | ); 111 | } 112 | } 113 | 114 | const styles = StyleSheet.create({ 115 | container: { 116 | flex: 1, 117 | marginTop: -10, 118 | alignItems: 'center', 119 | justifyContent: 'flex-start', 120 | }, 121 | button: { 122 | alignItems: 'center', 123 | justifyContent: 'center', 124 | backgroundColor: '#E7BCAA', 125 | height: MARGIN, 126 | borderRadius: 20, 127 | zIndex: 100, 128 | }, 129 | text: { 130 | color: 'white', 131 | fontWeight: 'bold', 132 | letterSpacing: 1, 133 | backgroundColor: 'transparent', 134 | }, 135 | image: { 136 | width: 24, 137 | height: 24, 138 | }, 139 | }); 140 | -------------------------------------------------------------------------------- /src/components/LoginSignup/FormLogin.js: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types'; 2 | import React, { Component } from 'react'; 3 | import { 4 | StyleSheet, 5 | KeyboardAvoidingView, 6 | View, 7 | Platform, 8 | } from 'react-native'; 9 | 10 | import UserInput from './UserInput'; 11 | 12 | import usernameImg from '../../icons/username.png'; 13 | import passwordImg from '../../icons/password.png'; 14 | 15 | const behavior = (Platform.OS === 'ios') ? 'position' : 'padding'; 16 | 17 | const FormLogin = props => { 18 | const { 19 | todos, 20 | actions, 21 | formData, 22 | } = props; 23 | 24 | const _onChangeEmailLogin = value => { 25 | actions.changeEmailLogin(value); 26 | }; 27 | 28 | const _onChangePasswordLogin = value => { 29 | actions.changePasswordLogin(value); 30 | }; 31 | 32 | return ( 33 | 35 | 42 | 50 | 51 | ); 52 | } 53 | 54 | const styles = StyleSheet.create({ 55 | container: { 56 | flex: 1, 57 | alignItems: 'center', 58 | } 59 | }); 60 | 61 | export default FormLogin; 62 | -------------------------------------------------------------------------------- /src/components/LoginSignup/FormSignup.js: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types'; 2 | import React, { Component } from 'react'; 3 | import { 4 | StyleSheet, 5 | KeyboardAvoidingView, 6 | View, 7 | Platform, 8 | } from 'react-native'; 9 | 10 | import UserInput from './UserInput'; 11 | 12 | import usernameImg from '../../icons/username.png'; 13 | import passwordImg from '../../icons/password.png'; 14 | 15 | const behavior = (Platform.OS === 'ios') ? 'position' : 'padding'; 16 | 17 | const FormSignup = props => { 18 | const { 19 | todos, 20 | actions, 21 | formData, 22 | } = props; 23 | 24 | const _onChangeEmailSignup = value => { 25 | actions.changeEmailSignup(value); 26 | }; 27 | 28 | const _onChangePasswordSignup = value => { 29 | actions.changePasswordSignup(value); 30 | }; 31 | 32 | return ( 33 | 35 | 42 | 50 | 51 | ); 52 | } 53 | 54 | const styles = StyleSheet.create({ 55 | container: { 56 | flex: 1, 57 | alignItems: 'center', 58 | } 59 | }); 60 | 61 | export default FormSignup; 62 | -------------------------------------------------------------------------------- /src/components/LoginSignup/Login.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ButtonLogin from './ButtonLogin'; 3 | import FormLogin from './FormLogin'; 4 | import Logo from './Logo'; 5 | import Container from '../Container'; 6 | 7 | const Login = props => { 8 | return ( 9 | 10 | 11 | 12 | 13 | 14 | ); 15 | } 16 | 17 | export default Login; 18 | -------------------------------------------------------------------------------- /src/components/LoginSignup/Logo.js: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types'; 2 | import React, { Component } from 'react'; 3 | import { 4 | StyleSheet, 5 | View, 6 | Text, 7 | Image, 8 | } from 'react-native'; 9 | 10 | import logoImg from '../../images/logo.png'; 11 | 12 | const Logo = props => { 13 | return ( 14 | 15 | 16 | MY TODO 17 | 18 | ); 19 | } 20 | 21 | const styles = StyleSheet.create({ 22 | container: { 23 | flex: 3, 24 | alignItems: 'center', 25 | justifyContent: 'center', 26 | }, 27 | image: { 28 | width: 80, 29 | height: 80, 30 | }, 31 | text: { 32 | color: 'white', 33 | fontWeight: 'bold', 34 | backgroundColor: 'transparent', 35 | marginTop: 20, 36 | } 37 | }); 38 | 39 | export default Logo; 40 | -------------------------------------------------------------------------------- /src/components/LoginSignup/Signup.js: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types'; 2 | import React, { Component } from 'react'; 3 | import ButtonSignup from './ButtonSignup'; 4 | import FormSignup from './FormSignup'; 5 | import Logo from './Logo'; 6 | import Container from '../Container'; 7 | 8 | const Signup = props => { 9 | return ( 10 | 11 | 12 | 13 | 14 | 15 | ); 16 | } 17 | 18 | export default Signup; 19 | -------------------------------------------------------------------------------- /src/components/LoginSignup/ToLogin.js: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types'; 2 | import React, { Component } from 'react'; 3 | import Dimensions from 'Dimensions'; 4 | import { 5 | StyleSheet, 6 | View, 7 | Text, 8 | TouchableOpacity, 9 | } from 'react-native'; 10 | import { Actions, ActionConst } from 'react-native-router-flux'; 11 | 12 | 13 | const ToLogin = props => { 14 | const { 15 | todos, 16 | actions, 17 | } = props; 18 | 19 | const _onPress = () => { 20 | Actions.loginScreen({ type: ActionConst.BACK }); 21 | } 22 | 23 | return ( 24 | 25 | 26 | I have an account 27 | 28 | 29 | ); 30 | } 31 | 32 | const DEVICE_WIDTH = Dimensions.get('window').width; 33 | const DEVICE_HEIGHT = Dimensions.get('window').height; 34 | 35 | const styles = StyleSheet.create({ 36 | container: { 37 | flex: 1, 38 | marginTop: 15, 39 | alignItems: 'center', 40 | }, 41 | button: { 42 | alignItems: 'center', 43 | }, 44 | text: { 45 | color: 'white', 46 | backgroundColor: 'transparent', 47 | }, 48 | }); 49 | 50 | export default ToLogin; 51 | -------------------------------------------------------------------------------- /src/components/LoginSignup/ToSignup.js: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types'; 2 | import React, { Component } from 'react'; 3 | import Dimensions from 'Dimensions'; 4 | import { 5 | StyleSheet, 6 | View, 7 | Text, 8 | TouchableOpacity, 9 | } from 'react-native'; 10 | import { Actions, ActionConst } from 'react-native-router-flux'; 11 | 12 | 13 | const ToSignup = props => { 14 | const { 15 | todos, 16 | actions, 17 | } = props; 18 | 19 | const _onPress = () => { 20 | Actions.signupScreen(); 21 | } 22 | 23 | return ( 24 | 25 | 26 | Create an account 27 | 28 | 29 | ); 30 | } 31 | 32 | const DEVICE_WIDTH = Dimensions.get('window').width; 33 | const DEVICE_HEIGHT = Dimensions.get('window').height; 34 | 35 | const styles = StyleSheet.create({ 36 | container: { 37 | flex: 1, 38 | marginTop: 15, 39 | alignItems: 'center', 40 | }, 41 | button: { 42 | alignItems: 'center', 43 | }, 44 | text: { 45 | color: 'white', 46 | backgroundColor: 'transparent', 47 | }, 48 | }); 49 | 50 | export default ToSignup; 51 | -------------------------------------------------------------------------------- /src/components/LoginSignup/UserInput.js: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types'; 2 | import React, { Component } from 'react'; 3 | import Dimensions from 'Dimensions'; 4 | import { 5 | StyleSheet, 6 | View, 7 | TextInput, 8 | Image, 9 | } from 'react-native'; 10 | 11 | const UserInput = props => { 12 | const { 13 | source, 14 | placeholder, 15 | secureTextEntry, 16 | autoCorrect, 17 | autoCapitalize, 18 | returnKeyType, 19 | onChangeText, 20 | value, 21 | } = props; 22 | 23 | return ( 24 | 25 | 27 | 37 | 38 | ); 39 | } 40 | 41 | UserInput.propTypes = { 42 | source: PropTypes.number.isRequired, 43 | placeholder: PropTypes.string.isRequired, 44 | secureTextEntry: PropTypes.bool, 45 | autoCorrect: PropTypes.bool, 46 | autoCapitalize: PropTypes.string, 47 | returnKeyType: PropTypes.string, 48 | onChangeText: PropTypes.func, 49 | }; 50 | 51 | const DEVICE_WIDTH = Dimensions.get('window').width; 52 | const DEVICE_HEIGHT = Dimensions.get('window').height; 53 | 54 | const styles = StyleSheet.create({ 55 | input: { 56 | backgroundColor: 'rgba(255, 255, 255, 0.4)', 57 | width: DEVICE_WIDTH - 40, 58 | height: 40, 59 | marginHorizontal: 20, 60 | paddingLeft: 45, 61 | borderRadius: 20, 62 | color: '#ffffff', 63 | }, 64 | inputWrapper: { 65 | flex: 0, 66 | marginBottom: 10, 67 | }, 68 | inlineImg: { 69 | position: 'absolute', 70 | zIndex: 99, 71 | width: 22, 72 | height: 22, 73 | left: 35, 74 | top: 9, 75 | }, 76 | }); 77 | 78 | export default UserInput; 79 | -------------------------------------------------------------------------------- /src/components/Screens/Edit.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import Container from '../Container'; 4 | import EditTodo from '../EditTodo'; 5 | 6 | const EditScreen = props => { 7 | return ( 8 | 9 | 10 | 11 | ); 12 | } 13 | 14 | export default EditScreen; 15 | -------------------------------------------------------------------------------- /src/components/Screens/Login.js: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types'; 2 | import React, { Component } from 'react'; 3 | import {connect} from 'react-redux'; 4 | import {bindActionCreators} from 'redux'; 5 | import * as todoActions from '../../actions/todoActions'; 6 | import Login from '../LoginSignup/Login'; 7 | import Main from '../Screens/Main'; 8 | 9 | class LoginScreen extends Component { 10 | render() { 11 | if (this.props.userData.email) { 12 | return
; 13 | } 14 | 15 | return ; 16 | } 17 | } 18 | 19 | LoginScreen.propTypes = { 20 | userData: PropTypes.object.isRequired, 21 | }; 22 | 23 | function mapStateToProps(state) { 24 | return { 25 | userData: state.userData, 26 | }; 27 | } 28 | 29 | export default connect(mapStateToProps)(LoginScreen); 30 | -------------------------------------------------------------------------------- /src/components/Screens/Main.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Drawer from 'react-native-drawer' 3 | import Container from '../Container'; 4 | import AddTodo from '../AddTodo'; 5 | import Visibility from '../Visibility'; 6 | import ListTodo from '../ListTodo'; 7 | import MenuScreen from './Menu'; 8 | import TopBar from '../TopBar'; 9 | 10 | const Main = props => { 11 | let _drawer; 12 | 13 | const _onPress = () => _drawer.open(); 14 | 15 | return ( 16 | } 19 | side='right' 20 | tapToClose={true} 21 | openDrawerOffset={0.3} // 20% gap on the right side of drawer 22 | panCloseMask={0.3} 23 | panOpenMask={0.1} 24 | closedDrawerOffset={-3} 25 | styles={drawerStyles} 26 | ref={el => _drawer = el} 27 | tweenHandler={(ratio) => ({ 28 | main: { opacity:(2-ratio)/2 } 29 | })} 30 | > 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | ); 39 | } 40 | 41 | const drawerStyles = { 42 | drawer: {}, 43 | main: { 44 | paddingRight: 3 45 | }, 46 | } 47 | 48 | export default Main; 49 | -------------------------------------------------------------------------------- /src/components/Screens/Menu.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { StyleSheet } from 'react-native'; 3 | import Container from '../Container'; 4 | import ControlPanel from '../ControlPanel'; 5 | 6 | const MenuScreen = props => { 7 | return ( 8 | 9 | 10 | 11 | ); 12 | } 13 | 14 | const styles = StyleSheet.create({ 15 | container: { 16 | flex: 1, 17 | backgroundColor: 'gray', 18 | }, 19 | }); 20 | 21 | export default MenuScreen; 22 | -------------------------------------------------------------------------------- /src/components/Screens/Signup.js: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types'; 2 | import React, { Component } from 'react'; 3 | import {connect} from 'react-redux'; 4 | import {bindActionCreators} from 'redux'; 5 | import * as todoActions from '../../actions/todoActions'; 6 | import Signup from '../LoginSignup/Signup'; 7 | import Main from '../Screens/Main'; 8 | 9 | class SignupScreen extends Component { 10 | render() { 11 | if (this.props.userData.email) { 12 | return
; 13 | } 14 | 15 | return ; 16 | } 17 | } 18 | 19 | SignupScreen.propTypes = { 20 | userData: PropTypes.object.isRequired, 21 | }; 22 | 23 | function mapStateToProps(state) { 24 | return { 25 | userData: state.userData, 26 | }; 27 | } 28 | 29 | export default connect(mapStateToProps)(SignupScreen); 30 | -------------------------------------------------------------------------------- /src/components/TopBar/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { 3 | View, 4 | Text, 5 | TouchableOpacity, 6 | StyleSheet, 7 | Image, 8 | } from 'react-native'; 9 | import iconSrc from '../../icons/open_menu.png'; 10 | 11 | const TopBar = props => { 12 | const { 13 | onPress, 14 | } = props; 15 | 16 | return ( 17 | 18 | 19 | My Todo 20 | 21 | 26 | 27 | 28 | 29 | ); 30 | } 31 | 32 | const styles = StyleSheet.create({ 33 | container: { 34 | alignItems: 'center', 35 | justifyContent: 'space-between', 36 | paddingVertical: 10, 37 | flexDirection: 'row', 38 | backgroundColor: 'rgba(0,0,0,0.5)' 39 | }, 40 | title: { 41 | color: 'white', 42 | marginLeft: 10, 43 | fontSize: 20, 44 | fontWeight: 'bold', 45 | }, 46 | button: { 47 | marginRight: 10, 48 | }, 49 | icon: { 50 | width: 30, 51 | height: 30, 52 | } 53 | }); 54 | 55 | export default TopBar; 56 | -------------------------------------------------------------------------------- /src/components/Visibility/index.js: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types'; 2 | import React, { Component } from 'react'; 3 | import { 4 | StyleSheet, 5 | TouchableOpacity, 6 | Text, 7 | View, 8 | } from 'react-native'; 9 | 10 | import ButtonFilter from '../Buttons/ButtonFilter'; 11 | 12 | const Visibility = props => { 13 | const { 14 | todos, 15 | actions, 16 | visibilityFilter, 17 | } = props; 18 | 19 | return ( 20 | 21 | 27 | View All 28 | 29 | 35 | Active 36 | 37 | 43 | Completed 44 | 45 | 51 | Favorite 52 | 53 | 54 | ); 55 | } 56 | 57 | const styles = StyleSheet.create({ 58 | container: { 59 | flex: 0, 60 | flexDirection: 'row', 61 | justifyContent: 'space-around', 62 | marginTop: 15, 63 | marginBottom: 10, 64 | }, 65 | text: { 66 | margin: 5, 67 | color: 'white', 68 | backgroundColor: 'transparent', 69 | }, 70 | btnClicked: { 71 | borderRadius: 5, 72 | backgroundColor: 'rgba(0, 0, 0, 0.4)', 73 | }, 74 | btnUnclicked: { 75 | borderRadius: 5, 76 | backgroundColor: 'rgba(255, 255, 255, 0.3)', 77 | } 78 | }); 79 | 80 | export default Visibility; 81 | -------------------------------------------------------------------------------- /src/components/index.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import {Scene, Router} from 'react-native-router-flux'; 3 | import LoginScreen from './Screens/Login'; 4 | import SignupScreen from './Screens/Signup'; 5 | import MainScreen from './Screens/Main'; 6 | import EditScreen from './Screens/Edit'; 7 | 8 | export default class App extends Component { 9 | render() { 10 | return ( 11 | 12 | 13 | 18 | 23 | 28 | 33 | 34 | 35 | ); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/icons/back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dwicao/react-native-redux-firebase-todo/20224bd26105694cef8dc15bed62558fd9c1394a/src/icons/back.png -------------------------------------------------------------------------------- /src/icons/check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dwicao/react-native-redux-firebase-todo/20224bd26105694cef8dc15bed62558fd9c1394a/src/icons/check.png -------------------------------------------------------------------------------- /src/icons/left-arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dwicao/react-native-redux-firebase-todo/20224bd26105694cef8dc15bed62558fd9c1394a/src/icons/left-arrow.png -------------------------------------------------------------------------------- /src/icons/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dwicao/react-native-redux-firebase-todo/20224bd26105694cef8dc15bed62558fd9c1394a/src/icons/loading.gif -------------------------------------------------------------------------------- /src/icons/open_menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dwicao/react-native-redux-firebase-todo/20224bd26105694cef8dc15bed62558fd9c1394a/src/icons/open_menu.png -------------------------------------------------------------------------------- /src/icons/password.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dwicao/react-native-redux-firebase-todo/20224bd26105694cef8dc15bed62558fd9c1394a/src/icons/password.png -------------------------------------------------------------------------------- /src/icons/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dwicao/react-native-redux-firebase-todo/20224bd26105694cef8dc15bed62558fd9c1394a/src/icons/plus.png -------------------------------------------------------------------------------- /src/icons/remove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dwicao/react-native-redux-firebase-todo/20224bd26105694cef8dc15bed62558fd9c1394a/src/icons/remove.png -------------------------------------------------------------------------------- /src/icons/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dwicao/react-native-redux-firebase-todo/20224bd26105694cef8dc15bed62558fd9c1394a/src/icons/star.png -------------------------------------------------------------------------------- /src/icons/uncheck.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dwicao/react-native-redux-firebase-todo/20224bd26105694cef8dc15bed62558fd9c1394a/src/icons/uncheck.png -------------------------------------------------------------------------------- /src/icons/unstar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dwicao/react-native-redux-firebase-todo/20224bd26105694cef8dc15bed62558fd9c1394a/src/icons/unstar.png -------------------------------------------------------------------------------- /src/icons/username.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dwicao/react-native-redux-firebase-todo/20224bd26105694cef8dc15bed62558fd9c1394a/src/icons/username.png -------------------------------------------------------------------------------- /src/images/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dwicao/react-native-redux-firebase-todo/20224bd26105694cef8dc15bed62558fd9c1394a/src/images/bg.jpg -------------------------------------------------------------------------------- /src/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dwicao/react-native-redux-firebase-todo/20224bd26105694cef8dc15bed62558fd9c1394a/src/images/logo.png -------------------------------------------------------------------------------- /src/reducers/conditionReducer.js: -------------------------------------------------------------------------------- 1 | import * as types from '../actions/actionTypes'; 2 | 3 | const initialState = { 4 | isLoading: false, 5 | } 6 | 7 | export default function conditionReducer(state = initialState, action) { 8 | switch(action.type) { 9 | 10 | case types.CHANGE_CONDITION: 11 | return Object.assign({}, state, action.payload); 12 | 13 | default: 14 | return state; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/reducers/formReducer.js: -------------------------------------------------------------------------------- 1 | import * as types from '../actions/actionTypes'; 2 | 3 | const initialState = { 4 | emailLogin: '', 5 | emailSignup: '', 6 | passwordLogin: '', 7 | passwordSignup: '', 8 | }; 9 | 10 | export default function formReducer(state = initialState, action) { 11 | switch(action.type) { 12 | 13 | case types.CHANGE_EMAIL_LOGIN: 14 | return Object.assign({}, state, { emailLogin: action.emailLogin }); 15 | 16 | case types.CHANGE_EMAIL_SIGNUP: 17 | return Object.assign({}, state, { emailSignup: action.emailSignup }); 18 | 19 | case types.CHANGE_PASSWORD_LOGIN: 20 | return Object.assign({}, state, { passwordLogin: action.passwordLogin }); 21 | 22 | case types.CHANGE_PASSWORD_SIGNUP: 23 | return Object.assign({}, state, { passwordSignup: action.passwordSignup }); 24 | 25 | default: 26 | return state; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/reducers/index.js: -------------------------------------------------------------------------------- 1 | import {combineReducers} from 'redux'; 2 | import todos from './todoReducer'; 3 | import visibilityFilter from './visibilityFilterReducer'; 4 | import formData from './formReducer'; 5 | import userData from './userDataReducer'; 6 | import condition from './conditionReducer'; 7 | 8 | const rootReducer = combineReducers({ 9 | todos, 10 | visibilityFilter, 11 | formData, 12 | userData, 13 | condition, 14 | }); 15 | 16 | export default rootReducer; 17 | -------------------------------------------------------------------------------- /src/reducers/todoReducer.js: -------------------------------------------------------------------------------- 1 | import * as types from '../actions/actionTypes'; 2 | 3 | const todoReducer = (state = [], action) => { 4 | switch(action.type) { 5 | 6 | case types.ADD_TODO: 7 | return [ 8 | action.payload, 9 | ...state 10 | ]; 11 | 12 | case types.UPDATE_TODO: 13 | return state.map(todo => { 14 | if(todo.id !== action.id) { 15 | return todo; 16 | } 17 | 18 | return Object.assign({}, todo, action.payload); 19 | }); 20 | 21 | case types.EDIT_TODO: 22 | return state.map(todo => { 23 | if(todo.id !== action.id) { 24 | return todo; 25 | } 26 | 27 | return Object.assign({}, todo, { text: action.text }); 28 | }); 29 | 30 | case types.TOGGLE_STAR_TODO: 31 | return state.map(todo => { 32 | if(todo.id !== action.id) { 33 | return todo; 34 | } 35 | 36 | return Object.assign({}, todo, { isStarred: !todo.isStarred }); 37 | }); 38 | 39 | case types.TOGGLE_EDIT_TODO: 40 | return state.map(todo => { 41 | if(todo.id !== action.id) { 42 | return todo; 43 | } 44 | 45 | return Object.assign({}, todo, { isEditing: !todo.isEditing }); 46 | }); 47 | 48 | case types.REMOVE_TODO: 49 | return state.filter(todo => { 50 | return todo.id !== action.id; 51 | }); 52 | 53 | case types.DELETE_ALL_TODO: 54 | return state.filter(todo => { 55 | return false; 56 | }); 57 | 58 | case types.FILTER_TODO: 59 | return state.filter(todo => { 60 | return todo.visibilityFilter === action.filter; 61 | }); 62 | 63 | default: 64 | return state; 65 | } 66 | 67 | } 68 | 69 | export default todoReducer; 70 | -------------------------------------------------------------------------------- /src/reducers/userDataReducer.js: -------------------------------------------------------------------------------- 1 | import * as types from '../actions/actionTypes'; 2 | 3 | const initialState = { 4 | email: '', 5 | }; 6 | 7 | export default function userDataReducer(state = initialState, action) { 8 | switch(action.type) { 9 | 10 | case types.CHANGE_USER_DATA: 11 | return Object.assign({}, state, action.payload); 12 | 13 | default: 14 | return state; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/reducers/visibilityFilterReducer.js: -------------------------------------------------------------------------------- 1 | import * as types from '../actions/actionTypes'; 2 | 3 | export default function visibilityFilterReducer(state = 'SHOW_ALL', action) { 4 | switch(action.type) { 5 | 6 | case types.SET_VISIBILITY_FILTER: 7 | return action.filter; 8 | 9 | default: 10 | return state; 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/store/configureStore.js: -------------------------------------------------------------------------------- 1 | import { AsyncStorage } from 'react-native'; 2 | import { applyMiddleware, createStore } from 'redux'; 3 | import { autoRehydrate, persistStore } from 'redux-persist' 4 | import thunk from 'redux-thunk'; 5 | import reducers from '../reducers'; 6 | 7 | const middleWare = [thunk]; 8 | 9 | const createStoreWithMiddleware = applyMiddleware(...middleWare)(createStore); 10 | 11 | export default configureStore = (onComplete) => { 12 | const store = autoRehydrate()(createStoreWithMiddleware)(reducers); 13 | persistStore(store, { storage: AsyncStorage }, onComplete); 14 | 15 | return store; 16 | }; 17 | --------------------------------------------------------------------------------