├── mobile ├── .watchmanconfig ├── .gitattributes ├── app.json ├── images │ └── Entria.png ├── android │ ├── app │ │ ├── src │ │ │ └── main │ │ │ │ ├── res │ │ │ │ ├── values │ │ │ │ │ ├── strings.xml │ │ │ │ │ └── styles.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ └── mipmap-xxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── assets │ │ │ │ └── fonts │ │ │ │ │ ├── Entypo.ttf │ │ │ │ │ ├── Zocial.ttf │ │ │ │ │ ├── Feather.ttf │ │ │ │ │ ├── Ionicons.ttf │ │ │ │ │ ├── Octicons.ttf │ │ │ │ │ ├── EvilIcons.ttf │ │ │ │ │ ├── FontAwesome.ttf │ │ │ │ │ ├── Foundation.ttf │ │ │ │ │ ├── MaterialIcons.ttf │ │ │ │ │ ├── SimpleLineIcons.ttf │ │ │ │ │ └── MaterialCommunityIcons.ttf │ │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── mobile │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ └── MainApplication.java │ │ │ │ └── AndroidManifest.xml │ │ ├── BUCK │ │ ├── proguard-rules.pro │ │ └── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── keystores │ │ ├── debug.keystore.properties │ │ └── BUCK │ ├── settings.gradle │ ├── build.gradle │ ├── gradle.properties │ ├── gradlew.bat │ └── gradlew ├── ios │ ├── mobile │ │ ├── Images.xcassets │ │ │ ├── Contents.json │ │ │ └── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ ├── AppDelegate.h │ │ ├── main.m │ │ ├── AppDelegate.m │ │ ├── Info.plist │ │ └── Base.lproj │ │ │ └── LaunchScreen.xib │ ├── mobileTests │ │ ├── Info.plist │ │ └── mobileTests.m │ ├── mobile-tvOSTests │ │ └── Info.plist │ ├── mobile-tvOS │ │ └── Info.plist │ └── mobile.xcodeproj │ │ ├── xcshareddata │ │ └── xcschemes │ │ │ ├── mobile.xcscheme │ │ │ └── mobile-tvOS.xcscheme │ │ └── project.pbxproj ├── .buckconfig ├── index.js ├── .babelrc ├── __tests__ │ └── App.js ├── src │ ├── App.js │ ├── Environment.js │ ├── mutations │ │ ├── CreateTodoMutation.js │ │ ├── UpdateTodoMutation.js │ │ └── __generated__ │ │ │ ├── CreateTodoMutation.graphql.js │ │ │ └── UpdateTodoMutation.graphql.js │ └── components │ │ ├── __generated__ │ │ ├── Todo_todo.graphql.js │ │ ├── TodoAddViewerQuery.graphql.js │ │ ├── TodoList_viewer.graphql.js │ │ └── TodoListLoadingAllTodoQuery.graphql.js │ │ ├── Todo.js │ │ ├── Splash.js │ │ ├── TodoAdd.js │ │ └── TodoList.js ├── .gitignore ├── package.json ├── .flowconfig └── data │ └── schema.graphql ├── README.md ├── design ├── layout.png └── interface.xd ├── server ├── .graphcoolrc ├── package.json ├── types.graphql └── graphcool.yml └── .gitignore /mobile/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![](design/layout.png) 2 | -------------------------------------------------------------------------------- /mobile/.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | -------------------------------------------------------------------------------- /mobile/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mobile", 3 | "displayName": "mobile" 4 | } -------------------------------------------------------------------------------- /design/layout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thicodes/entria-todo/HEAD/design/layout.png -------------------------------------------------------------------------------- /design/interface.xd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thicodes/entria-todo/HEAD/design/interface.xd -------------------------------------------------------------------------------- /mobile/images/Entria.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thicodes/entria-todo/HEAD/mobile/images/Entria.png -------------------------------------------------------------------------------- /server/.graphcoolrc: -------------------------------------------------------------------------------- 1 | targets: 2 | prod: shared-eu-west-1/cjdhywzgk0s5t0129y4jpjkga 3 | default: prod 4 | -------------------------------------------------------------------------------- /server/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "entria-todo", 3 | "version": "1.0.0", 4 | "description": "My Graphcool Service" 5 | } -------------------------------------------------------------------------------- /mobile/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | mobile 3 | 4 | -------------------------------------------------------------------------------- /mobile/ios/mobile/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /mobile/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thicodes/entria-todo/HEAD/mobile/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /mobile/.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /mobile/android/app/src/main/assets/fonts/Entypo.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thicodes/entria-todo/HEAD/mobile/android/app/src/main/assets/fonts/Entypo.ttf -------------------------------------------------------------------------------- /mobile/android/app/src/main/assets/fonts/Zocial.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thicodes/entria-todo/HEAD/mobile/android/app/src/main/assets/fonts/Zocial.ttf -------------------------------------------------------------------------------- /mobile/index.js: -------------------------------------------------------------------------------- 1 | import { AppRegistry } from 'react-native'; 2 | import App from './src/App'; 3 | 4 | AppRegistry.registerComponent('mobile', () => App); 5 | -------------------------------------------------------------------------------- /mobile/android/app/src/main/assets/fonts/Feather.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thicodes/entria-todo/HEAD/mobile/android/app/src/main/assets/fonts/Feather.ttf -------------------------------------------------------------------------------- /mobile/android/app/src/main/assets/fonts/Ionicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thicodes/entria-todo/HEAD/mobile/android/app/src/main/assets/fonts/Ionicons.ttf -------------------------------------------------------------------------------- /mobile/android/app/src/main/assets/fonts/Octicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thicodes/entria-todo/HEAD/mobile/android/app/src/main/assets/fonts/Octicons.ttf -------------------------------------------------------------------------------- /mobile/android/app/src/main/assets/fonts/EvilIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thicodes/entria-todo/HEAD/mobile/android/app/src/main/assets/fonts/EvilIcons.ttf -------------------------------------------------------------------------------- /mobile/android/app/src/main/assets/fonts/FontAwesome.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thicodes/entria-todo/HEAD/mobile/android/app/src/main/assets/fonts/FontAwesome.ttf -------------------------------------------------------------------------------- /mobile/android/app/src/main/assets/fonts/Foundation.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thicodes/entria-todo/HEAD/mobile/android/app/src/main/assets/fonts/Foundation.ttf -------------------------------------------------------------------------------- /mobile/android/app/src/main/assets/fonts/MaterialIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thicodes/entria-todo/HEAD/mobile/android/app/src/main/assets/fonts/MaterialIcons.ttf -------------------------------------------------------------------------------- /mobile/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 | -------------------------------------------------------------------------------- /mobile/android/app/src/main/assets/fonts/SimpleLineIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thicodes/entria-todo/HEAD/mobile/android/app/src/main/assets/fonts/SimpleLineIcons.ttf -------------------------------------------------------------------------------- /mobile/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thicodes/entria-todo/HEAD/mobile/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /mobile/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thicodes/entria-todo/HEAD/mobile/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /mobile/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thicodes/entria-todo/HEAD/mobile/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /mobile/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thicodes/entria-todo/HEAD/mobile/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /mobile/android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thicodes/entria-todo/HEAD/mobile/android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf -------------------------------------------------------------------------------- /server/types.graphql: -------------------------------------------------------------------------------- 1 | type Todo @model { 2 | id: ID! @isUnique 3 | createdAt: DateTime! 4 | updatedAt: DateTime! 5 | task: String! 6 | isCompleted: Boolean! @defaultValue(value: "false") 7 | } -------------------------------------------------------------------------------- /mobile/android/keystores/BUCK: -------------------------------------------------------------------------------- 1 | keystore( 2 | name = "debug", 3 | properties = "debug.keystore.properties", 4 | store = "debug.keystore", 5 | visibility = [ 6 | "PUBLIC", 7 | ], 8 | ) 9 | -------------------------------------------------------------------------------- /mobile/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "react-native", 4 | "react-native-stage-0/decorator-support" 5 | ], 6 | "plugins": [ 7 | ["relay", {"schema": "data/schema.graphql"}] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /mobile/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /mobile/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.14.1-all.zip 6 | -------------------------------------------------------------------------------- /mobile/__tests__/App.js: -------------------------------------------------------------------------------- 1 | import 'react-native'; 2 | import React from 'react'; 3 | import App from '../App'; 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 | -------------------------------------------------------------------------------- /mobile/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'mobile' 2 | include ':react-native-linear-gradient' 3 | project(':react-native-linear-gradient').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-linear-gradient/android') 4 | include ':react-native-vector-icons' 5 | project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android') 6 | 7 | include ':app' 8 | -------------------------------------------------------------------------------- /mobile/android/app/src/main/java/com/mobile/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.mobile; 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 "mobile"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /mobile/ios/mobile/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 | -------------------------------------------------------------------------------- /mobile/ios/mobile/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 | -------------------------------------------------------------------------------- /mobile/src/App.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Sample React Native App 3 | * https://github.com/facebook/react-native 4 | * @flow 5 | */ 6 | 7 | import React, { Component } from 'react'; 8 | import { StackNavigator } from 'react-navigation' 9 | import Splash from './components/Splash' 10 | import TodoAdd from './components/TodoAdd' 11 | import TodoList from './components/TodoList' 12 | 13 | const App = StackNavigator( 14 | { 15 | Splash: { screen: Splash }, 16 | TodoList: { screen: TodoList }, 17 | TodoAdd: { screen: TodoAdd }, 18 | }, 19 | { 20 | initialRouteName: 'Splash', 21 | mode: 'modal' 22 | } 23 | ) 24 | 25 | export default () => -------------------------------------------------------------------------------- /mobile/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:2.2.3' 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 | -------------------------------------------------------------------------------- /mobile/ios/mobile/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 | } -------------------------------------------------------------------------------- /mobile/src/Environment.js: -------------------------------------------------------------------------------- 1 | 2 | import { 3 | Environment, 4 | Network, 5 | RecordSource, 6 | Store, 7 | } from 'relay-runtime' 8 | 9 | const network = Network.create((operation, variables) => { 10 | return fetch('https://api.graph.cool/relay/v1/cjdhywzgk0s5t0129y4jpjkga', { 11 | method: 'POST', 12 | headers: { 13 | 'Accept': 'application/json', 14 | 'Content-Type': 'application/json' 15 | }, 16 | body: JSON.stringify({ 17 | query: operation.text, 18 | variables, 19 | }), 20 | }).then(response => { 21 | return response.json() 22 | }) 23 | }) 24 | 25 | const store = new Store(new RecordSource()) 26 | 27 | const environment = new Environment({ 28 | network, 29 | store, 30 | }) 31 | 32 | export default environment -------------------------------------------------------------------------------- /mobile/ios/mobileTests/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 | -------------------------------------------------------------------------------- /mobile/ios/mobile-tvOSTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /mobile/android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | android.useDeprecatedNdk=true 21 | -------------------------------------------------------------------------------- /mobile/src/mutations/CreateTodoMutation.js: -------------------------------------------------------------------------------- 1 | import { 2 | commitMutation, 3 | graphql, 4 | } from 'react-relay' 5 | import environment from '../Environment' 6 | 7 | const mutation = graphql` 8 | mutation CreateTodoMutation($input: CreateTodoInput!) { 9 | createTodo(input: $input) { 10 | todo { 11 | id 12 | task 13 | } 14 | } 15 | } 16 | ` 17 | 18 | const commit = (task) => { 19 | const variables = { 20 | input: { 21 | task, 22 | clientMutationId: "" 23 | } 24 | }; 25 | return new Promise((resolve, reject) => { 26 | commitMutation(environment, { 27 | mutation, 28 | variables, 29 | onCompleted: (response, error) => { 30 | console.log(response, environment) 31 | resolve(response) 32 | }, 33 | onError: err => reject(err) 34 | }) 35 | }) 36 | } 37 | 38 | export default commit; -------------------------------------------------------------------------------- /mobile/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | 25 | # Android/IntelliJ 26 | # 27 | build/ 28 | .idea 29 | .gradle 30 | local.properties 31 | *.iml 32 | 33 | # node.js 34 | # 35 | node_modules/ 36 | npm-debug.log 37 | yarn-error.log 38 | 39 | # BUCK 40 | buck-out/ 41 | \.buckd/ 42 | *.keystore 43 | 44 | # fastlane 45 | # 46 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 47 | # screenshots whenever they are needed. 48 | # For more information about the recommended setup visit: 49 | # https://docs.fastlane.tools/best-practices/source-control/ 50 | 51 | */fastlane/report.xml 52 | */fastlane/Preview.html 53 | */fastlane/screenshots 54 | -------------------------------------------------------------------------------- /mobile/src/mutations/UpdateTodoMutation.js: -------------------------------------------------------------------------------- 1 | import { 2 | commitMutation, 3 | graphql, 4 | } from 'react-relay' 5 | import environment from '../Environment' 6 | 7 | const mutation = graphql` 8 | mutation UpdateTodoMutation($input: UpdateTodoInput!) { 9 | updateTodo(input: $input) { 10 | todo { 11 | id 12 | isCompleted 13 | } 14 | } 15 | } 16 | ` 17 | 18 | const commit = (todoId, isCheck) => { 19 | const variables = { 20 | input: { 21 | id: todoId, 22 | isCompleted: isCheck, 23 | clientMutationId: "" 24 | } 25 | }; 26 | return new Promise((resolve, reject) => { 27 | commitMutation(environment, { 28 | mutation, 29 | variables, 30 | onCompleted: (response, error) => { 31 | console.log(response, environment) 32 | resolve(response) 33 | }, 34 | onError: err => reject(err) 35 | }) 36 | }) 37 | } 38 | 39 | export default commit; -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # Runtime data 9 | pids 10 | *.pid 11 | *.seed 12 | *.pid.lock 13 | 14 | # Directory for instrumented libs generated by jscoverage/JSCover 15 | lib-cov 16 | 17 | # Coverage directory used by tools like istanbul 18 | coverage 19 | 20 | # nyc test coverage 21 | .nyc_output 22 | 23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 24 | .grunt 25 | 26 | # Bower dependency directory (https://bower.io/) 27 | bower_components 28 | 29 | # node-waf configuration 30 | .lock-wscript 31 | 32 | # Compiled binary addons (http://nodejs.org/api/addons.html) 33 | build/Release 34 | 35 | # Dependency directories 36 | node_modules/ 37 | jspm_packages/ 38 | 39 | # Typescript v1 declaration files 40 | typings/ 41 | 42 | # Optional npm cache directory 43 | .npm 44 | 45 | # Optional eslint cache 46 | .eslintcache 47 | 48 | # Optional REPL history 49 | .node_repl_history 50 | 51 | # Output of 'npm pack' 52 | *.tgz 53 | 54 | # Yarn Integrity file 55 | .yarn-integrity 56 | 57 | # dotenv environment variables file 58 | .env 59 | 60 | -------------------------------------------------------------------------------- /mobile/src/components/__generated__/Todo_todo.graphql.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @flow 3 | */ 4 | 5 | /* eslint-disable */ 6 | 7 | 'use strict'; 8 | 9 | /*:: 10 | import type {ConcreteFragment} from 'relay-runtime'; 11 | export type Todo_todo = {| 12 | +id: string; 13 | +task: string; 14 | +createdAt: any; 15 | +isCompleted: boolean; 16 | |}; 17 | */ 18 | 19 | 20 | const fragment /*: ConcreteFragment*/ = { 21 | "argumentDefinitions": [], 22 | "kind": "Fragment", 23 | "metadata": null, 24 | "name": "Todo_todo", 25 | "selections": [ 26 | { 27 | "kind": "ScalarField", 28 | "alias": null, 29 | "args": null, 30 | "name": "id", 31 | "storageKey": null 32 | }, 33 | { 34 | "kind": "ScalarField", 35 | "alias": null, 36 | "args": null, 37 | "name": "task", 38 | "storageKey": null 39 | }, 40 | { 41 | "kind": "ScalarField", 42 | "alias": null, 43 | "args": null, 44 | "name": "createdAt", 45 | "storageKey": null 46 | }, 47 | { 48 | "kind": "ScalarField", 49 | "alias": null, 50 | "args": null, 51 | "name": "isCompleted", 52 | "storageKey": null 53 | } 54 | ], 55 | "type": "Todo" 56 | }; 57 | 58 | module.exports = fragment; 59 | -------------------------------------------------------------------------------- /server/graphcool.yml: -------------------------------------------------------------------------------- 1 | # Welcome to Graphcool! 2 | # 3 | # This file is the main config file for your Graphcool Service. 4 | # It's very minimal at this point and uses default values. 5 | # We've included a hello world function here. 6 | # Just run `graphcool deploy` to have the first running Graphcool Service. 7 | # 8 | # Check out some examples: 9 | # https://github.com/graphcool/framework/tree/master/examples 10 | # 11 | # Here are the reference docs of this definition format: 12 | # https://www.graph.cool/docs/reference/service-definition/graphcool.yml-foatho8aip 13 | # 14 | # Happy Coding! 15 | 16 | 17 | # In the types.graphql you define your data schema 18 | types: ./types.graphql 19 | 20 | # Model/Relation permissions are used to limit the API access 21 | # To take the burden of thinking about those while development, we 22 | # preconfigured the wildcard ("*") permission that allows everything 23 | # Read more here: 24 | # https://www.graph.cool/docs/reference/auth/authorization/overview-iegoo0heez 25 | permissions: 26 | - operation: "*" 27 | 28 | 29 | # Your root tokens used for functions to get full access to the API 30 | # Read more here: 31 | # https://www.graph.cool/docs/reference/auth/authentication/authentication-tokens-eip7ahqu5o 32 | # rootTokens: 33 | # - mytoken 34 | 35 | -------------------------------------------------------------------------------- /mobile/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 12 | 13 | 19 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /mobile/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mobile", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "start": "node node_modules/react-native/local-cli/cli.js start", 7 | "relay": "relay-compiler --src ./src --schema data/schema.graphql", 8 | "relay:watch": "yarn relay -- --watch", 9 | "test": "jest" 10 | }, 11 | "dependencies": { 12 | "babel-preset-react-native-stage-0": "^1.0.1", 13 | "hoist-non-react-statics": "^2.3.1", 14 | "moment": "^2.20.1", 15 | "react": "16.2.0", 16 | "react-native": "0.53.0", 17 | "react-native-action-button": "^2.8.4", 18 | "react-native-elements": "^0.19.0", 19 | "react-native-linear-gradient": "^2.4.0", 20 | "react-native-vector-icons": "^4.5.0", 21 | "react-navigation": "^1.0.3", 22 | "react-relay": "^1.4.1" 23 | }, 24 | "devDependencies": { 25 | "babel-eslint": "^8.2.1", 26 | "babel-jest": "22.2.2", 27 | "babel-plugin-relay": "^1.4.1", 28 | "babel-preset-react-native": "4.0.0", 29 | "eslint": "^4.17.0", 30 | "eslint-plugin-import": "^2.8.0", 31 | "eslint-plugin-react-native": "^3.2.1", 32 | "jest": "22.2.2", 33 | "react-devtools": "^3.1.0", 34 | "react-test-renderer": "16.2.0", 35 | "relay-compiler": "^1.4.1" 36 | }, 37 | "jest": { 38 | "preset": "react-native" 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /mobile/android/app/src/main/java/com/mobile/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.mobile; 2 | 3 | import android.app.Application; 4 | 5 | import com.facebook.react.ReactApplication; 6 | import com.BV.LinearGradient.LinearGradientPackage; 7 | import com.oblador.vectoricons.VectorIconsPackage; 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 | public class MainApplication extends Application implements ReactApplication { 17 | 18 | private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { 19 | @Override 20 | public boolean getUseDeveloperSupport() { 21 | return BuildConfig.DEBUG; 22 | } 23 | 24 | @Override 25 | protected List getPackages() { 26 | return Arrays.asList( 27 | new MainReactPackage(), 28 | new LinearGradientPackage(), 29 | new VectorIconsPackage() 30 | ); 31 | } 32 | 33 | @Override 34 | protected String getJSMainModuleName() { 35 | return "index"; 36 | } 37 | }; 38 | 39 | @Override 40 | public ReactNativeHost getReactNativeHost() { 41 | return mReactNativeHost; 42 | } 43 | 44 | @Override 45 | public void onCreate() { 46 | super.onCreate(); 47 | SoLoader.init(this, /* native exopackage */ false); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /mobile/ios/mobile/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "AppDelegate.h" 11 | 12 | #import 13 | #import 14 | 15 | @implementation AppDelegate 16 | 17 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 18 | { 19 | NSURL *jsCodeLocation; 20 | 21 | jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; 22 | 23 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation 24 | moduleName:@"mobile" 25 | initialProperties:nil 26 | launchOptions:launchOptions]; 27 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; 28 | 29 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 30 | UIViewController *rootViewController = [UIViewController new]; 31 | rootViewController.view = rootView; 32 | self.window.rootViewController = rootViewController; 33 | [self.window makeKeyAndVisible]; 34 | return YES; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /mobile/.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 | 16 | ; Ignore polyfills 17 | .*/Libraries/polyfills/.* 18 | 19 | ; Ignore metro 20 | .*/node_modules/metro/.* 21 | 22 | [include] 23 | 24 | [libs] 25 | node_modules/react-native/Libraries/react-native/react-native-interface.js 26 | node_modules/react-native/flow/ 27 | node_modules/react-native/flow-github/ 28 | 29 | [options] 30 | emoji=true 31 | 32 | module.system=haste 33 | 34 | munge_underscores=true 35 | 36 | 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' 37 | 38 | module.file_ext=.js 39 | module.file_ext=.jsx 40 | module.file_ext=.json 41 | module.file_ext=.native.js 42 | 43 | suppress_type=$FlowIssue 44 | suppress_type=$FlowFixMe 45 | suppress_type=$FlowFixMeProps 46 | suppress_type=$FlowFixMeState 47 | 48 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) 49 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ 50 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy 51 | suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError 52 | 53 | [version] 54 | ^0.63.0 55 | -------------------------------------------------------------------------------- /mobile/src/components/Todo.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import { 3 | createFragmentContainer, 4 | graphql 5 | } from 'react-relay' 6 | import { 7 | Text, 8 | View, 9 | } from 'react-native' 10 | import { CheckBox } from 'react-native-elements' 11 | import moment from 'moment' 12 | import UpdateTodoMutation from '../mutations/UpdateTodoMutation' 13 | 14 | class Todo extends Component { 15 | state = { 16 | checked: false 17 | } 18 | 19 | componentDidMount() { 20 | this.setState({ checked: this.props.todo.isCompleted }) 21 | } 22 | 23 | handleCheck = () => { 24 | this.setState({ checked: !this.state.checked }, () => { 25 | UpdateTodoMutation(this.props.todo.id, this.state.checked) 26 | }) 27 | } 28 | render() { 29 | let { 30 | todo, 31 | createdAt 32 | } = this.props 33 | 34 | return ( 35 | 41 | {todo.task} 42 | {moment(todo.createdAt, 'YYYYMMDD').fromNow()} 43 | 44 | } 45 | checked={this.state.checked} 46 | /> 47 | ) 48 | } 49 | } 50 | 51 | export default createFragmentContainer(Todo, graphql` 52 | fragment Todo_todo on Todo { 53 | id 54 | task 55 | createdAt 56 | isCompleted 57 | } 58 | `) -------------------------------------------------------------------------------- /mobile/ios/mobile-tvOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UIViewControllerBasedStatusBarAppearance 38 | 39 | NSLocationWhenInUseUsageDescription 40 | 41 | NSAppTransportSecurity 42 | 43 | 44 | NSExceptionDomains 45 | 46 | localhost 47 | 48 | NSExceptionAllowsInsecureHTTPLoads 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /mobile/android/app/BUCK: -------------------------------------------------------------------------------- 1 | # To learn about Buck see [Docs](https://buckbuild.com/). 2 | # To run your application with Buck: 3 | # - install Buck 4 | # - `npm start` - to start the packager 5 | # - `cd android` 6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 8 | # - `buck install -r android/app` - compile, install and run application 9 | # 10 | 11 | lib_deps = [] 12 | 13 | for jarfile in glob(['libs/*.jar']): 14 | name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')] 15 | lib_deps.append(':' + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | 21 | for aarfile in glob(['libs/*.aar']): 22 | name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')] 23 | lib_deps.append(':' + name) 24 | android_prebuilt_aar( 25 | name = name, 26 | aar = aarfile, 27 | ) 28 | 29 | android_library( 30 | name = "all-libs", 31 | exported_deps = lib_deps, 32 | ) 33 | 34 | android_library( 35 | name = "app-code", 36 | srcs = glob([ 37 | "src/main/java/**/*.java", 38 | ]), 39 | deps = [ 40 | ":all-libs", 41 | ":build_config", 42 | ":res", 43 | ], 44 | ) 45 | 46 | android_build_config( 47 | name = "build_config", 48 | package = "com.mobile", 49 | ) 50 | 51 | android_resource( 52 | name = "res", 53 | package = "com.mobile", 54 | res = "src/main/res", 55 | ) 56 | 57 | android_binary( 58 | name = "app", 59 | keystore = "//android/keystores:debug", 60 | manifest = "src/main/AndroidManifest.xml", 61 | package_type = "debug", 62 | deps = [ 63 | ":app-code", 64 | ], 65 | ) 66 | -------------------------------------------------------------------------------- /mobile/src/components/__generated__/TodoAddViewerQuery.graphql.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @flow 3 | * @relayHash 543b7e25ae4c7438e645cc7656753f7c 4 | */ 5 | 6 | /* eslint-disable */ 7 | 8 | 'use strict'; 9 | 10 | /*:: 11 | import type {ConcreteBatch} from 'relay-runtime'; 12 | export type TodoAddViewerQueryResponse = {| 13 | +viewer: {| 14 | +id: string; 15 | |}; 16 | |}; 17 | */ 18 | 19 | 20 | /* 21 | query TodoAddViewerQuery { 22 | viewer { 23 | id 24 | } 25 | } 26 | */ 27 | 28 | const batch /*: ConcreteBatch*/ = { 29 | "fragment": { 30 | "argumentDefinitions": [], 31 | "kind": "Fragment", 32 | "metadata": null, 33 | "name": "TodoAddViewerQuery", 34 | "selections": [ 35 | { 36 | "kind": "LinkedField", 37 | "alias": null, 38 | "args": null, 39 | "concreteType": "Viewer", 40 | "name": "viewer", 41 | "plural": false, 42 | "selections": [ 43 | { 44 | "kind": "ScalarField", 45 | "alias": null, 46 | "args": null, 47 | "name": "id", 48 | "storageKey": null 49 | } 50 | ], 51 | "storageKey": null 52 | } 53 | ], 54 | "type": "Query" 55 | }, 56 | "id": null, 57 | "kind": "Batch", 58 | "metadata": {}, 59 | "name": "TodoAddViewerQuery", 60 | "query": { 61 | "argumentDefinitions": [], 62 | "kind": "Root", 63 | "name": "TodoAddViewerQuery", 64 | "operation": "query", 65 | "selections": [ 66 | { 67 | "kind": "LinkedField", 68 | "alias": null, 69 | "args": null, 70 | "concreteType": "Viewer", 71 | "name": "viewer", 72 | "plural": false, 73 | "selections": [ 74 | { 75 | "kind": "ScalarField", 76 | "alias": null, 77 | "args": null, 78 | "name": "id", 79 | "storageKey": null 80 | } 81 | ], 82 | "storageKey": null 83 | } 84 | ] 85 | }, 86 | "text": "query TodoAddViewerQuery {\n viewer {\n id\n }\n}\n" 87 | }; 88 | 89 | module.exports = batch; 90 | -------------------------------------------------------------------------------- /mobile/ios/mobile/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | mobile 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UIViewControllerBasedStatusBarAppearance 40 | 41 | NSLocationWhenInUseUsageDescription 42 | 43 | NSAppTransportSecurity 44 | 45 | NSExceptionDomains 46 | 47 | localhost 48 | 49 | NSExceptionAllowsInsecureHTTPLoads 50 | 51 | 52 | 53 | 54 | UIAppFonts 55 | 56 | Entypo.ttf 57 | EvilIcons.ttf 58 | Feather.ttf 59 | FontAwesome.ttf 60 | Foundation.ttf 61 | Ionicons.ttf 62 | MaterialCommunityIcons.ttf 63 | MaterialIcons.ttf 64 | Octicons.ttf 65 | SimpleLineIcons.ttf 66 | Zocial.ttf 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /mobile/ios/mobileTests/mobileTests.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | #import 12 | 13 | #import 14 | #import 15 | 16 | #define TIMEOUT_SECONDS 600 17 | #define TEXT_TO_LOOK_FOR @"Welcome to React Native!" 18 | 19 | @interface mobileTests : XCTestCase 20 | 21 | @end 22 | 23 | @implementation mobileTests 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 = [[[RCTSharedApplication() 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 | -------------------------------------------------------------------------------- /mobile/src/components/Splash.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import { 3 | Animated, 4 | StyleSheet, 5 | Text, 6 | Image, 7 | View 8 | } from 'react-native' 9 | import LinearGradient from 'react-native-linear-gradient' 10 | import Dimensions from 'Dimensions'; 11 | const {width, height} = Dimensions.get('window'); 12 | 13 | class Splash extends Component { 14 | static navigationOptions = { 15 | header: null, 16 | } 17 | 18 | state = { 19 | scaleAnimated: new Animated.Value(2), 20 | } 21 | 22 | componentDidMount() { 23 | this.startViewAnimated() 24 | } 25 | 26 | startViewAnimated = value => { 27 | const { scaleAnimated } = this.state; 28 | Animated.sequence([ 29 | Animated.timing(scaleAnimated, { 30 | duration: 2000, 31 | toValue: 0.1, 32 | }), 33 | Animated.timing(scaleAnimated, { 34 | duration: 500, 35 | toValue: 500, 36 | }), 37 | ]).start(() => { 38 | 39 | this.props.navigation.navigate('TodoList'); 40 | }); 41 | }; 42 | 43 | render() { 44 | return ( 45 | 46 | 50 | 51 | 55 | 56 | 57 | 58 | ) 59 | } 60 | } 61 | 62 | const styles = StyleSheet.create({ 63 | container: { 64 | flex: 1, 65 | }, 66 | containerImage: { 67 | width: width, 68 | height: height, 69 | flexDirection:'row', 70 | alignItems:'center', 71 | justifyContent:'center' 72 | }, 73 | linearGradient: { 74 | flex: 1 75 | }, 76 | buttonText: { 77 | fontSize: 18, 78 | fontFamily: 'Gill Sans', 79 | textAlign: 'center', 80 | margin: 10, 81 | color: '#ffffff', 82 | backgroundColor: 'transparent', 83 | }, 84 | }) 85 | 86 | export default Splash -------------------------------------------------------------------------------- /mobile/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 | -------------------------------------------------------------------------------- /mobile/src/components/TodoAdd.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import { 3 | View, 4 | StyleSheet, 5 | Text, 6 | } from 'react-native' 7 | import { 8 | FormLabel, 9 | FormInput, 10 | FormValidationMessage, 11 | Button 12 | } from 'react-native-elements' 13 | import { 14 | QueryRenderer, 15 | graphql 16 | } from 'react-relay' 17 | import environment from '../Environment' 18 | import CreatePostMutation from '../mutations/CreateTodoMutation' 19 | 20 | const TodoAddViewerQuery = graphql` 21 | query TodoAddViewerQuery { 22 | viewer { 23 | id 24 | } 25 | } 26 | ` 27 | 28 | class TodoAdd extends Component { 29 | static navigationOptions = { 30 | title: 'Todo Add', 31 | headerTintColor: '#fff', 32 | headerStyle: { 33 | backgroundColor: '#832655' 34 | } 35 | } 36 | 37 | state = { 38 | task: '' 39 | } 40 | 41 | handleSubmit = async(viewerId) => { 42 | const { task } = this.state 43 | await CreatePostMutation(task) 44 | this.props.navigation.navigate('TodoList') 45 | //CreatePostMutation(task, viewerId, () => this.props.navigation.navigate('TodoListLoading') ) 46 | } 47 | 48 | render() { 49 | return ( 50 | { 54 | if (error) { 55 | return {error.message} 56 | } else if (props) { 57 | return ( 58 | 59 | 60 | this.setState({task})} 63 | /> 64 | 65 | 66 | 67 |