├── .watchmanconfig ├── .gitattributes ├── src ├── img │ ├── c3po.png │ ├── logo.png │ ├── r2d2.png │ ├── camera.png │ ├── check.png │ ├── heart.png │ ├── compose.png │ ├── heartFilled.png │ └── profileEgg.png ├── redux │ ├── reducers │ │ ├── index.js │ │ └── appReducers.js │ ├── actions │ │ └── appActions.js │ └── Store.js ├── config │ ├── consts.js │ ├── Router.js │ └── Enviroment.js ├── App.js └── components │ ├── common │ ├── LoadingView.js │ ├── Gallery.js │ └── PostCard.js │ ├── tweetsCreate │ ├── mutation │ │ └── TweetAddMutation.js │ └── Create.js │ ├── user │ ├── mutation │ │ ├── LoginEmailMutation.js │ │ └── RegisterEmailMutation.js │ ├── UserMenu.js │ ├── Login.js │ └── SignUp.js │ ├── icons │ ├── CloseIcon.js │ ├── TwitterIcon.js │ └── BackArrow.js │ ├── splash │ └── Splash.js │ └── tweetsFeed │ └── Feed.js ├── app.json ├── ios ├── ReactNativeRelayModern │ ├── Images.xcassets │ │ ├── Contents.json │ │ ├── Image.imageset │ │ │ ├── logo.png │ │ │ ├── logo-1.png │ │ │ ├── logo-2.png │ │ │ └── Contents.json │ │ └── AppIcon.appiconset │ │ │ ├── Icon-20.png │ │ │ ├── Icon-21.png │ │ │ ├── Icon-29.png │ │ │ ├── Icon-30.png │ │ │ ├── Icon-40.png │ │ │ ├── Icon-41.png │ │ │ ├── Icon-60.png │ │ │ ├── Icon-61.png │ │ │ ├── Icon-1024.png │ │ │ ├── icon-20@1x.png │ │ │ ├── icon-20@2x.png │ │ │ ├── icon-20@3x.png │ │ │ ├── icon-29@1x.png │ │ │ ├── icon-29@2x.png │ │ │ ├── icon-29@3x.png │ │ │ ├── icon-40@1x.png │ │ │ ├── icon-40@2x.png │ │ │ ├── icon-40@3x.png │ │ │ ├── icon-50@1x.png │ │ │ ├── icon-50@2x.png │ │ │ ├── icon-57@1x.png │ │ │ ├── icon-57@2x.png │ │ │ ├── icon-60@2x.png │ │ │ ├── icon-60@3x.png │ │ │ ├── icon-72@1x.png │ │ │ ├── icon-72@2x.png │ │ │ ├── icon-76@1x.png │ │ │ ├── icon-76@2x.png │ │ │ ├── icon-1024@1x.png │ │ │ ├── icon-83.5@2x.png │ │ │ └── Contents.json │ ├── AppDelegate.h │ ├── main.m │ ├── AppDelegate.m │ ├── Base.lproj │ │ └── LaunchScreen.xib │ └── Info.plist ├── ReactNativeRelayModernTests │ ├── Info.plist │ └── ReactNativeRelayModernTests.m ├── ReactNativeRelayModern-tvOSTests │ └── Info.plist ├── ReactNativeRelayModern-tvOS │ └── Info.plist └── ReactNativeRelayModern.xcodeproj │ ├── xcshareddata │ └── xcschemes │ │ ├── ReactNativeRelayModern.xcscheme │ │ └── ReactNativeRelayModern-tvOS.xcscheme │ └── project.pbxproj ├── android ├── app │ ├── src │ │ └── main │ │ │ ├── res │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ └── styles.xml │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-ldpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ └── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── java │ │ │ └── com │ │ │ │ └── reactnativerelaymodern │ │ │ │ ├── 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 ├── .buckconfig ├── .babelrc ├── index.ios.js ├── index.android.js ├── __tests__ ├── index.ios.js └── index.android.js ├── .eslintrc ├── .gitignore ├── .flowconfig ├── package.json └── data └── schema.graphql /.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | -------------------------------------------------------------------------------- /src/img/c3po.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/src/img/c3po.png -------------------------------------------------------------------------------- /src/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/src/img/logo.png -------------------------------------------------------------------------------- /src/img/r2d2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/src/img/r2d2.png -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ReactNativeRelayModern", 3 | "displayName": "ReactNativeRelayModern" 4 | } 5 | -------------------------------------------------------------------------------- /src/img/camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/src/img/camera.png -------------------------------------------------------------------------------- /src/img/check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/src/img/check.png -------------------------------------------------------------------------------- /src/img/heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/src/img/heart.png -------------------------------------------------------------------------------- /src/img/compose.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/src/img/compose.png -------------------------------------------------------------------------------- /src/img/heartFilled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/src/img/heartFilled.png -------------------------------------------------------------------------------- /src/img/profileEgg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/src/img/profileEgg.png -------------------------------------------------------------------------------- /ios/ReactNativeRelayModern/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | ReactNativeRelayModern 3 | 4 | -------------------------------------------------------------------------------- /.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /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/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-ldpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/android/app/src/main/res/mipmap-ldpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /src/redux/reducers/index.js: -------------------------------------------------------------------------------- 1 | import appReducers from './appReducers'; 2 | import { combineReducers } from 'redux'; 3 | 4 | export default combineReducers({ 5 | appReducers, 6 | }); 7 | -------------------------------------------------------------------------------- /ios/ReactNativeRelayModern/Images.xcassets/Image.imageset/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/ios/ReactNativeRelayModern/Images.xcassets/Image.imageset/logo.png -------------------------------------------------------------------------------- /android/keystores/BUCK: -------------------------------------------------------------------------------- 1 | keystore( 2 | name = "debug", 3 | properties = "debug.keystore.properties", 4 | store = "debug.keystore", 5 | visibility = [ 6 | "PUBLIC", 7 | ], 8 | ) 9 | -------------------------------------------------------------------------------- /ios/ReactNativeRelayModern/Images.xcassets/Image.imageset/logo-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/ios/ReactNativeRelayModern/Images.xcassets/Image.imageset/logo-1.png -------------------------------------------------------------------------------- /ios/ReactNativeRelayModern/Images.xcassets/Image.imageset/logo-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/ios/ReactNativeRelayModern/Images.xcassets/Image.imageset/logo-2.png -------------------------------------------------------------------------------- /src/redux/actions/appActions.js: -------------------------------------------------------------------------------- 1 | export const imageAdd = image => ({ 2 | type: 'IMAGE_ADD', 3 | image, 4 | }); 5 | 6 | export const imageRemoveAll = () => ({ 7 | type: 'IMAGE_REMOVE_ALL', 8 | }); 9 | -------------------------------------------------------------------------------- /ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/Icon-20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/Icon-20.png -------------------------------------------------------------------------------- /ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/Icon-21.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/Icon-21.png -------------------------------------------------------------------------------- /ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/Icon-29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/Icon-29.png -------------------------------------------------------------------------------- /ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/Icon-30.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/Icon-30.png -------------------------------------------------------------------------------- /ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/Icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/Icon-40.png -------------------------------------------------------------------------------- /ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/Icon-41.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/Icon-41.png -------------------------------------------------------------------------------- /ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/Icon-60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/Icon-60.png -------------------------------------------------------------------------------- /ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/Icon-61.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/Icon-61.png -------------------------------------------------------------------------------- /ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/Icon-1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/Icon-1024.png -------------------------------------------------------------------------------- /ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/icon-20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/icon-20@1x.png -------------------------------------------------------------------------------- /ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/icon-20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/icon-20@2x.png -------------------------------------------------------------------------------- /ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/icon-20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/icon-20@3x.png -------------------------------------------------------------------------------- /ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/icon-29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/icon-29@1x.png -------------------------------------------------------------------------------- /ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/icon-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/icon-29@2x.png -------------------------------------------------------------------------------- /ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/icon-29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/icon-29@3x.png -------------------------------------------------------------------------------- /ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/icon-40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/icon-40@1x.png -------------------------------------------------------------------------------- /ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/icon-40@2x.png -------------------------------------------------------------------------------- /ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/icon-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/icon-40@3x.png -------------------------------------------------------------------------------- /ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/icon-50@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/icon-50@1x.png -------------------------------------------------------------------------------- /ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/icon-50@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/icon-50@2x.png -------------------------------------------------------------------------------- /ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/icon-57@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/icon-57@1x.png -------------------------------------------------------------------------------- /ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/icon-57@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/icon-57@2x.png -------------------------------------------------------------------------------- /ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/icon-60@2x.png -------------------------------------------------------------------------------- /ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/icon-60@3x.png -------------------------------------------------------------------------------- /ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/icon-72@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/icon-72@1x.png -------------------------------------------------------------------------------- /ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/icon-72@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/icon-72@2x.png -------------------------------------------------------------------------------- /ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/icon-76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/icon-76@1x.png -------------------------------------------------------------------------------- /ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/icon-76@2x.png -------------------------------------------------------------------------------- /ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/icon-1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/icon-1024@1x.png -------------------------------------------------------------------------------- /ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/icon-83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lXSPandora/TwitterClone-RelayModern/HEAD/ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/icon-83.5@2x.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/redux/Store.js: -------------------------------------------------------------------------------- 1 | import { createStore, applyMiddleware } from 'redux'; 2 | import logger from 'redux-logger'; 3 | 4 | import reducers from './reducers/index'; 5 | 6 | const Store = createStore(reducers, applyMiddleware(logger)); 7 | 8 | export default Store; 9 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "retainLines": true, 3 | "compact": true, 4 | "comments": false, 5 | "presets": ["react-native", "react-native-stage-0/decorator-support"], 6 | "plugins": [["relay", { "schema": "data/schema.json" }]], 7 | "sourceMaps": false 8 | } 9 | 10 | -------------------------------------------------------------------------------- /index.ios.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 { AppRegistry } from 'react-native'; 9 | import App from './src/App'; 10 | 11 | AppRegistry.registerComponent('ReactNativeRelayModern', () => App); 12 | -------------------------------------------------------------------------------- /index.android.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 { AppRegistry } from 'react-native'; 9 | import App from './src/App'; 10 | 11 | AppRegistry.registerComponent('ReactNativeRelayModern', () => App); 12 | -------------------------------------------------------------------------------- /__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 | -------------------------------------------------------------------------------- /__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 | -------------------------------------------------------------------------------- /src/config/consts.js: -------------------------------------------------------------------------------- 1 | export const firebaseConfig = { 2 | apiKey: 'AIzaSyB2HW2rGVy7pBCRQcIbOGJnlU-9ClmXUUs', 3 | authDomain: 'twitterclone-55b51.firebaseapp.com', 4 | databaseURL: 'https://twitterclone-55b51.firebaseio.com', 5 | projectId: 'twitterclone-55b51', 6 | storageBucket: 'twitterclone-55b51.appspot.com', 7 | messagingSenderId: '190303150985', 8 | }; 9 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'ReactNativeRelayModern' 2 | include ':react-native-snackbar' 3 | project(':react-native-snackbar').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-snackbar/android') 4 | include ':react-native-svg' 5 | project(':react-native-svg').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-svg/android') 6 | 7 | include ':app' 8 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/reactnativerelaymodern/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.reactnativerelaymodern; 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 "ReactNativeRelayModern"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/App.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | import React, { Component } from 'react'; 3 | // import { AsyncStorage } from 'react-native'; 4 | import { Router } from './config/Router'; 5 | import Store from './redux/Store'; 6 | import { Provider } from 'react-redux'; 7 | 8 | class App extends Component { 9 | componentWillMount() { 10 | // AsyncStorage.clear(); 11 | } 12 | render() { 13 | return ( 14 | 15 | 16 | 17 | ); 18 | } 19 | } 20 | export default App; 21 | -------------------------------------------------------------------------------- /ios/ReactNativeRelayModern/Images.xcassets/Image.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "logo-2.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "logo-1.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "logo.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /ios/ReactNativeRelayModern/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 | -------------------------------------------------------------------------------- /src/redux/reducers/appReducers.js: -------------------------------------------------------------------------------- 1 | const initialState = { 2 | image: '', 3 | }; 4 | 5 | const appReducers = (state = initialState, action) => { 6 | switch (action.type) { 7 | case 'IMAGE_ADD': { 8 | const { image } = action; 9 | return { 10 | ...state, 11 | image, 12 | }; 13 | } 14 | case 'IMAGE_REMOVE_ALL': { 15 | return { 16 | ...state, 17 | image: '', 18 | }; 19 | } 20 | default: 21 | return { 22 | ...initialState, 23 | }; 24 | } 25 | }; 26 | 27 | export default appReducers; 28 | -------------------------------------------------------------------------------- /ios/ReactNativeRelayModern/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 | -------------------------------------------------------------------------------- /src/components/common/LoadingView.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import React, { Component } from 'react'; 4 | import { View, Text, StyleSheet } from 'react-native'; 5 | import styled from 'styled-components/native'; 6 | import * as Progress from 'react-native-progress'; 7 | 8 | const Wrapper = styled.View` 9 | flex: 1; 10 | background-color: #fff; 11 | align-items: center; 12 | justify-content: center; 13 | `; 14 | 15 | class LoadingView extends Component { 16 | render() { 17 | return ( 18 | 19 | 20 | 21 | ); 22 | } 23 | } 24 | 25 | export default LoadingView; 26 | -------------------------------------------------------------------------------- /src/components/tweetsCreate/mutation/TweetAddMutation.js: -------------------------------------------------------------------------------- 1 | import { graphql, commitMutation } from 'react-relay'; 2 | import env from '../../../config/Enviroment'; 3 | 4 | const mutation = graphql` 5 | mutation TweetAddMutation($input: TweetAddInput!) { 6 | TweetAdd(input: $input) { 7 | error 8 | } 9 | } 10 | `; 11 | 12 | // Adds a new Tweet 13 | const commit = (username, userImage, text, likes, onFinish, onError) => { 14 | return commitMutation(env, { 15 | mutation, 16 | variables: { 17 | input: { 18 | username, 19 | userImage, 20 | text, 21 | likes, 22 | }, 23 | }, 24 | onFinish, 25 | onError, 26 | }); 27 | }; 28 | 29 | export default commit; 30 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /src/components/user/mutation/LoginEmailMutation.js: -------------------------------------------------------------------------------- 1 | import { graphql, commitMutation } from 'react-relay'; 2 | import env from '../../../config/Enviroment'; 3 | 4 | const mutation = graphql` 5 | mutation LoginEmailMutation($input: LoginEmailInput!) { 6 | LoginEmail(input: $input) { 7 | token 8 | } 9 | } 10 | `; 11 | 12 | const commit = (email, password) => { 13 | const variables = { 14 | input: { 15 | email, 16 | password, 17 | }, 18 | }; 19 | return new Promise((resolve, reject) => { 20 | commitMutation(env, { 21 | mutation, 22 | variables, 23 | onCompleted: (response, errors) => { 24 | console.log(response.LoginEmail.token); 25 | resolve(response.LoginEmail.token); 26 | }, 27 | onError: err => reject(err), 28 | }); 29 | }); 30 | }; 31 | 32 | export default commit; 33 | -------------------------------------------------------------------------------- /ios/ReactNativeRelayModernTests/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/ReactNativeRelayModern-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 | -------------------------------------------------------------------------------- /src/components/user/mutation/RegisterEmailMutation.js: -------------------------------------------------------------------------------- 1 | import { graphql, commitMutation } from 'react-relay'; 2 | import env from '../../../config/Enviroment'; 3 | 4 | const mutation = graphql` 5 | mutation RegisterEmailMutation($input: RegisterEmailInput!) { 6 | RegisterEmail(input: $input) { 7 | token 8 | } 9 | } 10 | `; 11 | 12 | const commit = (email, name, image, password) => { 13 | const variables = { 14 | input: { 15 | email, 16 | name, 17 | image, 18 | password, 19 | }, 20 | }; 21 | return new Promise((resolve, reject) => { 22 | commitMutation(env, { 23 | mutation, 24 | variables, 25 | onCompleted: (response, errors) => { 26 | console.log(response.RegisterEmail.token); 27 | resolve(response.RegisterEmail.token); 28 | }, 29 | onError: err => reject(err), 30 | }); 31 | }); 32 | }; 33 | 34 | export default commit; 35 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "parser": "babel-eslint", 3 | "env": { 4 | "browser": true, 5 | "node": true, 6 | "jest": true 7 | }, 8 | "plugins": ["react", "react-native", "flowtype", "import"], 9 | "extends": ["eslint:recommended", "plugin:react/recommended"], 10 | "rules": { 11 | "comma-dangle": [2, "always-multiline"], 12 | "quotes": [2, "single", { "allowTemplateLiterals": true }], 13 | "react/prop-types": 0, 14 | "react/jsx-no-bind": 0, 15 | "react/display-name": 0, 16 | "new-cap": 0, 17 | "react-native/no-unused-styles": 2, 18 | "react-native/split-platform-components": 2, 19 | "react-native/no-inline-styles": 1, 20 | "react-native/no-color-literals": 0, 21 | "no-class-assign": 1, 22 | "no-console": 1, 23 | "object-curly-spacing": [1, "always"], 24 | "flowtype/define-flow-type": 1, 25 | "flowtype/use-flow-type": 1, 26 | "import/first": 2 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /.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://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 50 | 51 | fastlane/report.xml 52 | fastlane/Preview.html 53 | fastlane/screenshots 54 | 55 | #relay 56 | __generated__/ -------------------------------------------------------------------------------- /src/config/Router.js: -------------------------------------------------------------------------------- 1 | import { StackNavigator } from 'react-navigation'; 2 | import Feed from '../components/tweetsFeed/Feed'; 3 | import UserMenu from '../components/user/UserMenu'; 4 | import Login from '../components/user/Login'; 5 | import SignUp from '../components/user/SignUp'; 6 | import Splash from '../components/splash/Splash'; 7 | import Create from '../components/tweetsCreate/Create'; 8 | import Gallery from '../components/common/Gallery'; 9 | 10 | export const Router = StackNavigator( 11 | { 12 | Splash: { 13 | screen: Splash, 14 | }, 15 | Feed: { 16 | screen: Feed, 17 | navigationOptions: { 18 | header: null, 19 | gesturesEnabled: false, 20 | }, 21 | }, 22 | Login: { 23 | screen: Login, 24 | }, 25 | UserMenu: { 26 | screen: UserMenu, 27 | }, 28 | SignUp: { 29 | screen: SignUp, 30 | }, 31 | Create: { 32 | screen: Create, 33 | }, 34 | Gallery: { 35 | screen: Gallery, 36 | }, 37 | }, 38 | { 39 | initialRouteName: 'Splash', 40 | mode: 'modal', 41 | } 42 | ); 43 | -------------------------------------------------------------------------------- /src/config/Enviroment.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @flow 3 | */ 4 | 5 | import { AsyncStorage } from 'react-native'; 6 | import { Environment, Network, RecordSource, Store } from 'relay-runtime'; 7 | 8 | // Define a function that fetches the results of an operation (query/mutation/etc) 9 | // and returns its results as a Promise: 10 | const fetchQuery = async (operation, variables, cacheConfig, uploadables) => { 11 | return fetch('http://localhost:5000/graphql', { 12 | method: 'POST', 13 | headers: { 14 | Accept: 'application/json', 15 | 'Content-Type': 'application/json', 16 | Authorization: await AsyncStorage.getItem('token'), 17 | }, // Add authentication and other headers here 18 | body: JSON.stringify({ 19 | query: operation.text, // GraphQL text from input 20 | variables, 21 | }), 22 | }).then(response => { 23 | return response.json(); 24 | }); 25 | }; 26 | 27 | // Create a network layer from the fetch function 28 | const network = Network.create(fetchQuery); 29 | 30 | const source = new RecordSource(); 31 | const store = new Store(source); 32 | 33 | const env = new Environment({ 34 | network, 35 | store, 36 | }); 37 | 38 | export default env; 39 | -------------------------------------------------------------------------------- /src/components/icons/CloseIcon.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | import React, { Component } from 'react'; 3 | import { View, Text, StyleSheet } from 'react-native'; 4 | import Svg, { Path } from 'react-native-svg'; 5 | 6 | class CloseIcon extends Component { 7 | static defaultProps = { 8 | color: 'black', 9 | size: 20, 10 | }; 11 | render() { 12 | const { color, size, style } = this.props; 13 | return ( 14 | 22 | 26 | 27 | ); 28 | } 29 | } 30 | const styles = StyleSheet.create({ 31 | container: { 32 | flex: 1, 33 | }, 34 | }); 35 | export default CloseIcon; 36 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/reactnativerelaymodern/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.reactnativerelaymodern; 2 | 3 | import android.app.Application; 4 | 5 | import com.facebook.react.ReactApplication; 6 | import com.azendoo.reactnativesnackbar.SnackbarPackage; 7 | import com.horcrux.svg.SvgPackage; 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 SnackbarPackage(), 29 | new SvgPackage() 30 | ); 31 | } 32 | }; 33 | 34 | @Override 35 | public ReactNativeHost getReactNativeHost() { 36 | return mReactNativeHost; 37 | } 38 | 39 | @Override 40 | public void onCreate() { 41 | super.onCreate(); 42 | SoLoader.init(this, /* native exopackage */ false); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/components/icons/TwitterIcon.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | import React, { Component } from 'react'; 3 | import { View, Text, StyleSheet } from 'react-native'; 4 | import Svg, { Path } from 'react-native-svg'; 5 | 6 | class TwitterIcon extends Component { 7 | static defaultProps = { 8 | size: 100, 9 | color: 'black', 10 | children: null, 11 | }; 12 | render() { 13 | const { size, color, children, style } = this.props; 14 | return ( 15 | 23 | 27 | {children} 28 | 29 | ); 30 | } 31 | } 32 | const styles = StyleSheet.create({ 33 | container: { 34 | flex: 1, 35 | }, 36 | }); 37 | export default TwitterIcon; 38 | -------------------------------------------------------------------------------- /src/components/icons/BackArrow.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | import React, { Component } from 'react'; 3 | import { View, Text, StyleSheet } from 'react-native'; 4 | import Svg, { Path } from 'react-native-svg'; 5 | 6 | class BackArrowIcon extends Component { 7 | static defaultProps = { 8 | color: 'black', 9 | }; 10 | render() { 11 | const { size, color } = this.props; 12 | return ( 13 | 23 | 27 | 31 | 35 | 36 | ); 37 | } 38 | } 39 | const styles = StyleSheet.create({ 40 | container: { 41 | flex: 1, 42 | }, 43 | }); 44 | export default BackArrowIcon; 45 | -------------------------------------------------------------------------------- /.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 | emoji=true 26 | 27 | module.system=haste 28 | 29 | munge_underscores=true 30 | 31 | module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub' 32 | 33 | suppress_type=$FlowIssue 34 | suppress_type=$FlowFixMe 35 | suppress_type=$FixMe 36 | 37 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(4[0-9]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) 38 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(4[0-9]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ 39 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy 40 | suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError 41 | 42 | unsafe.enable_getters_and_setters=true 43 | 44 | [version] 45 | ^0.49.1 46 | -------------------------------------------------------------------------------- /ios/ReactNativeRelayModern/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "AppDelegate.h" 11 | 12 | #import 13 | #import 14 | 15 | @implementation AppDelegate 16 | 17 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 18 | { 19 | NSURL *jsCodeLocation; 20 | 21 | jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil]; 22 | 23 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation 24 | moduleName:@"ReactNativeRelayModern" 25 | initialProperties:nil 26 | launchOptions:launchOptions]; 27 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; 28 | 29 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 30 | UIViewController *rootViewController = [UIViewController new]; 31 | rootViewController.view = rootView; 32 | self.window.rootViewController = rootViewController; 33 | [self.window makeKeyAndVisible]; 34 | return YES; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /ios/ReactNativeRelayModern/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /ios/ReactNativeRelayModern-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 | -------------------------------------------------------------------------------- /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.reactnativerelaymodern", 49 | ) 50 | 51 | android_resource( 52 | name = "res", 53 | package = "com.reactnativerelaymodern", 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 | -------------------------------------------------------------------------------- /ios/ReactNativeRelayModern/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | Twitter 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 | NSAppTransportSecurity 28 | 29 | NSExceptionDomains 30 | 31 | localhost 32 | 33 | NSExceptionAllowsInsecureHTTPLoads 34 | 35 | 36 | 37 | 38 | NSLocationWhenInUseUsageDescription 39 | 40 | NSPhotoLibraryUsageDescription 41 | This app requires access to the camera roll 42 | UILaunchStoryboardName 43 | LaunchScreen 44 | UIRequiredDeviceCapabilities 45 | 46 | armv7 47 | 48 | UISupportedInterfaceOrientations 49 | 50 | UIInterfaceOrientationPortrait 51 | UIInterfaceOrientationLandscapeLeft 52 | UIInterfaceOrientationLandscapeRight 53 | 54 | UIViewControllerBasedStatusBarAppearance 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /ios/ReactNativeRelayModernTests/ReactNativeRelayModernTests.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 ReactNativeRelayModernTests : XCTestCase 20 | 21 | @end 22 | 23 | @implementation ReactNativeRelayModernTests 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 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "TwitterClone-RelayModern", 3 | "description": "React Native + Relay modern Twitter Clone", 4 | "version": "1.0.0", 5 | "author": { 6 | "name": "lXSPandora", 7 | "email": "luizepauloxd@gmail.com", 8 | "url": "https://github.com/lXSPandora" 9 | }, 10 | "dependencies": { 11 | "firebase": "^4.8.1", 12 | "hoist-non-react-statics": "^2.3.1", 13 | "lint-staged": "^6.0.0", 14 | "react": "16.0.0-alpha.12", 15 | "react-native": "^0.51.0", 16 | "react-native-camera-roll-picker": "^1.2.3", 17 | "react-native-keyboard-aware-scrollview": "^1.1.7", 18 | "react-native-progress": "^3.4.0", 19 | "react-native-snackbar": "^0.4.4", 20 | "react-native-svg": "^5.4.1", 21 | "react-navigation": "^1.0.0-beta.11", 22 | "react-redux": "^5.0.6", 23 | "react-relay": "^1.3.0", 24 | "redux": "^3.7.2", 25 | "redux-logger": "^3.0.6", 26 | "relay-runtime": "^1.4.1", 27 | "styled-components": "^2.1.2" 28 | }, 29 | "devDependencies": { 30 | "babel-eslint": "^7.2.3", 31 | "babel-jest": "21.0.2", 32 | "babel-plugin-relay": "^1.4.1", 33 | "babel-preset-react-native": "4.0.0", 34 | "babel-preset-react-native-stage-0": "^1.0.1", 35 | "eslint": "^4.13.1", 36 | "eslint-plugin-flowtype": "^2.40.1", 37 | "eslint-plugin-import": "^2.8.0", 38 | "eslint-plugin-react": "^7.5.1", 39 | "eslint-plugin-react-native": "^3.2.0", 40 | "jest": "21.1.0", 41 | "prettier": "^1.9.2", 42 | "react-test-renderer": "16.0.0-alpha.12", 43 | "relay-compiler": "^1.4.0" 44 | }, 45 | "jest": { 46 | "preset": "react-native" 47 | }, 48 | "lint-staged": { 49 | "*.js": [ 50 | "prettier --write --single-quote true --trailing-comma all --print-width 120", 51 | "git add" 52 | ] 53 | }, 54 | "pre-commit": "lint:staged", 55 | "private": true, 56 | "repository": { 57 | "url": "git@github.com:lXSPandora/TwitterClone-RelayModern.git", 58 | "type": "git" 59 | }, 60 | "scripts": { 61 | "clear": "node node_modules/react-native/local-cli/cli.js start --reset-cache", 62 | "start": "node node_modules/react-native/local-cli/cli.js start", 63 | "test": "jest", 64 | "relay": "relay-compiler --src ./src --schema data/schema.graphql", 65 | "prettier": "prettier --write --single-quote true --trailing-comma all --print-width 120", 66 | "relay:watch": "yarn relay -- --watch", 67 | "lint:staged": "lint-staged" 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /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/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 | # TextLayoutBuilder uses a non-public Android constructor within StaticLayout. 54 | # See libs/proxy/src/main/java/com/facebook/fbui/textlayoutbuilder/proxy for details. 55 | -dontwarn android.text.StaticLayout 56 | 57 | # okhttp 58 | 59 | -keepattributes Signature 60 | -keepattributes *Annotation* 61 | -keep class okhttp3.** { *; } 62 | -keep interface okhttp3.** { *; } 63 | -dontwarn okhttp3.** 64 | 65 | # okio 66 | 67 | -keep class sun.misc.Unsafe { *; } 68 | -dontwarn java.nio.file.* 69 | -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement 70 | -dontwarn okio.** 71 | -------------------------------------------------------------------------------- /src/components/common/Gallery.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | import React, { Component } from 'react'; 3 | import { connect } from 'react-redux'; 4 | import styled from 'styled-components/native'; 5 | import BackArrow from '../icons/BackArrow'; 6 | import CameraRollPicker from 'react-native-camera-roll-picker'; 7 | import { imageAdd } from '../../redux/actions/appActions'; 8 | 9 | const Wrapper = styled.View` 10 | flex: 1; 11 | background-color: #fff; 12 | `; 13 | 14 | const Header = styled.View` 15 | padding-top: 20; 16 | flex-direction: row; 17 | align-items: center; 18 | height: 70; 19 | `; 20 | 21 | const BackButton = styled.TouchableOpacity` 22 | width: 20; 23 | margin-left: 5; 24 | `; 25 | 26 | const ActionButton = styled.TouchableOpacity` 27 | background-color: rgb(28, 156, 235); 28 | align-items: center; 29 | justify-content: center; 30 | width: 60; 31 | height: 60; 32 | border-radius: 30; 33 | bottom: 20; 34 | right: 20; 35 | position: absolute; 36 | `; 37 | 38 | const Title = styled.Text` 39 | color: black; 40 | font-size: 22; 41 | font-weight: bold; 42 | margin-left: 25; 43 | `; 44 | 45 | const CheckIcon = styled.Image` 46 | width: 20; 47 | height: 20; 48 | tint-color: #fff; 49 | `; 50 | 51 | class Gallery extends Component { 52 | static navigationOptions = { 53 | header: null, 54 | }; 55 | state = { 56 | num: 0, 57 | image: [], 58 | uri: '', 59 | }; 60 | 61 | getSelectedImage = (images: Image[]) => { 62 | // TODO - handle multiple images 63 | 64 | this.setState({ 65 | image: images, 66 | uri: images[0].uri, 67 | }); 68 | }; 69 | 70 | confirmSelection = async () => { 71 | const { uri } = this.state; 72 | 73 | await this.props.imageAdd(uri); 74 | 75 | this.props.navigation.goBack(); 76 | }; 77 | 78 | render() { 79 | console.log(this.state); 80 | console.log(this.props); 81 | return ( 82 | 83 |
84 | 85 | 86 | 87 | Pick a profile picture 88 |
89 | 98 | 106 | 107 | 108 |
109 | ); 110 | } 111 | } 112 | 113 | const mapDispatchToProps = dispatch => ({ 114 | imageAdd: uri => dispatch(imageAdd(uri)), 115 | }); 116 | 117 | export default connect(null, mapDispatchToProps)(Gallery); 118 | -------------------------------------------------------------------------------- /src/components/splash/Splash.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | import React, { Component } from 'react'; 3 | import { 4 | Animated, 5 | View, 6 | Text, 7 | StyleSheet, 8 | ImageBackground, 9 | AsyncStorage, 10 | } from 'react-native'; 11 | import styled from 'styled-components/native'; 12 | import Svg, { Path } from 'react-native-svg'; 13 | 14 | const ViewAnimated = Animated.createAnimatedComponent(View); 15 | 16 | const Wrapper = styled.View` 17 | justify-content: center; 18 | align-items: center; 19 | flex: 1; 20 | background-color: rgb(29, 161, 242); 21 | `; 22 | 23 | const Logo = styled.ImageBackground` 24 | width: 100; 25 | height: 100; 26 | align-items: center; 27 | justify-content: center; 28 | `; 29 | 30 | class Login extends Component { 31 | state = { 32 | scaleAnimated: new Animated.Value(2), 33 | token: '', 34 | }; 35 | 36 | static navigationOptions = { 37 | header: null, 38 | }; 39 | 40 | componentDidMount() { 41 | AsyncStorage.getItem('token') 42 | .then(this.startViewAnimated) 43 | .done(); 44 | } 45 | 46 | startViewAnimated = value => { 47 | const { scaleAnimated } = this.state; 48 | Animated.sequence([ 49 | Animated.timing(scaleAnimated, { 50 | duration: 2000, 51 | toValue: 0.1, 52 | }), 53 | Animated.timing(scaleAnimated, { 54 | duration: 500, 55 | toValue: 1000, 56 | }), 57 | ]).start(() => { 58 | if (!value) { 59 | this.props.navigation.navigate('UserMenu'); 60 | } else { 61 | this.props.navigation.navigate('Feed'); 62 | } 63 | }); 64 | }; 65 | 66 | render() { 67 | const { scaleAnimated } = this.state; 68 | 69 | return ( 70 | 71 | 80 | 84 | 99 | 100 | 101 | ); 102 | } 103 | } 104 | const styles = StyleSheet.create({ 105 | container: { 106 | flex: 1, 107 | }, 108 | }); 109 | export default Login; 110 | -------------------------------------------------------------------------------- /src/components/common/PostCard.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import React, { Component } from 'react'; 4 | import { View, Text, StyleSheet } from 'react-native'; 5 | import styled from 'styled-components/native'; 6 | 7 | const ProfilePicturePost = styled.Image` 8 | width: 50; 9 | height: 50; 10 | border-radius: 25; 11 | `; 12 | 13 | const PictureContainer = styled.View` 14 | width: 50; 15 | height: 50; 16 | border-radius: 25; 17 | margin-right: 10; 18 | `; 19 | 20 | const PostView = styled.View` 21 | flex-direction: row; 22 | padding-vertical: 10; 23 | padding-right: 20; 24 | padding-left: 10; 25 | `; 26 | 27 | const PostColumns = styled.View` 28 | flex-direction: column; 29 | justify-content: center; 30 | `; 31 | 32 | const PostTitle = styled.Text` 33 | font-size: 16; 34 | font-weight: bold; 35 | color: black; 36 | `; 37 | 38 | const PostUser = styled.Text` 39 | font-size: 16; 40 | font-weight: bold; 41 | color: grey; 42 | `; 43 | 44 | const PostDescription = styled.Text` 45 | font-size: 16; 46 | padding-right: 30; 47 | color: black; 48 | `; 49 | 50 | const IconButton = styled.TouchableOpacity` 51 | width: 30; 52 | height: 30; 53 | align-items: center; 54 | justify-content: center; 55 | flex-direction: row; 56 | margin-top: 2; 57 | margin-left: -5; 58 | `; 59 | 60 | const Icon = styled.Image` 61 | width: 40; 62 | height: 40; 63 | `; 64 | 65 | class PostCard extends Component { 66 | state = { 67 | checked: false, 68 | likes: [], 69 | }; 70 | componentWillMount() { 71 | this.setState({ 72 | likes: this.props.likes, 73 | }); 74 | } 75 | like = checked => { 76 | const { likes } = this.state; 77 | this.setState({ 78 | checked, 79 | }); 80 | if (likes.indexOf(this.props.userLogged)) { 81 | const index = likes.indexOf(this.props.userLogged); 82 | const newLikes = likes.splice(index, 1); 83 | this.setState({ 84 | likes: newLikes, 85 | }); 86 | return; 87 | } 88 | this.setState({ 89 | likes: [...likes, this.props.userLogged], 90 | }); 91 | }; 92 | render() { 93 | const { checked } = this.state; 94 | const { image, user, description, likes } = this.props; 95 | return ( 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | @{user} 105 | 106 | {description} 107 | 108 | 109 | {this.state.likes.length} 110 | 111 | 112 | 113 | ); 114 | } 115 | } 116 | 117 | const styles = StyleSheet.create({ 118 | shadow: { 119 | shadowOffset: { width: 1, height: 1 }, 120 | shadowColor: 'darkgrey', 121 | shadowOpacity: 0.5, 122 | }, 123 | }); 124 | 125 | export default PostCard; 126 | -------------------------------------------------------------------------------- /src/components/user/UserMenu.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | import React, { Component } from 'react'; 3 | import { View, Text, StyleSheet, Dimensions } from 'react-native'; 4 | import styled from 'styled-components/native'; 5 | import Svg, { Path } from 'react-native-svg'; 6 | import TwitterIcon from '../icons/TwitterIcon'; 7 | 8 | const { width } = Dimensions.get('window'); 9 | 10 | const birdWidth = width + 220; 11 | 12 | const BackgroundView = styled.View` 13 | background-color: rgb(29, 161, 242); 14 | flex: 1; 15 | `; 16 | 17 | const WelcomeText = styled.Text` 18 | color: #ffffff; 19 | font-size: 50; 20 | font-weight: 700; 21 | margin-top: 30; 22 | text-align: left; 23 | margin-left: 10; 24 | `; 25 | 26 | const DescriptionText = styled.Text` 27 | color: #ffffff; 28 | font-size: 22; 29 | font-weight: bold; 30 | margin-top: 10; 31 | margin-horizontal: 10; 32 | `; 33 | 34 | const ActionView = styled.View` 35 | margin-top: -550; 36 | background-color: rgba(0, 0, 0, 0); 37 | `; 38 | 39 | const SignUpButton = styled.TouchableOpacity` 40 | background-color: #ffffff; 41 | padding-horizontal: 40; 42 | padding-vertical: 10; 43 | align-items: center; 44 | margin-horizontal: 10; 45 | justify-content: center; 46 | border-radius: 45; 47 | `; 48 | 49 | const LoginButton = styled.TouchableOpacity` 50 | border-style: solid; 51 | border-width: 1; 52 | border-color: #ffffff; 53 | padding-horizontal: 40; 54 | padding-vertical: 10; 55 | align-items: center; 56 | justify-content: center; 57 | border-radius: 40; 58 | margin-horizontal: 10; 59 | `; 60 | 61 | const LoginButtonText = styled.Text` 62 | color: #ffffff; 63 | font-size: 22; 64 | font-weight: 800; 65 | `; 66 | 67 | const SignUpText = styled.Text` 68 | color: rgb(29, 161, 242); 69 | font-size: 22; 70 | font-weight: 800; 71 | `; 72 | 73 | const ButtonsContainer = styled.View` 74 | flex-direction: row; 75 | justify-content: space-around; 76 | position: absolute; 77 | left: 0; 78 | right: 0; 79 | bottom: 20; 80 | `; 81 | 82 | class UserMenu extends Component { 83 | static navigationOptions = { 84 | header: null, 85 | gesturesEnabled: false, 86 | }; 87 | goLogin = () => { 88 | this.props.navigation.navigate('Login'); 89 | }; 90 | 91 | goSignUp = () => { 92 | this.props.navigation.navigate('SignUp'); 93 | }; 94 | 95 | render() { 96 | return ( 97 | 98 | 106 | 107 | Welcome to {'\n'}Twitter 108 | 109 | See what’s happening in the world right now. 110 | 111 | 112 | 113 | 114 | Sign up 115 | 116 | 117 | Log in 118 | 119 | 120 | 121 | ); 122 | } 123 | } 124 | const styles = StyleSheet.create({ 125 | container: { 126 | flex: 1, 127 | }, 128 | }); 129 | export default UserMenu; 130 | -------------------------------------------------------------------------------- /ios/ReactNativeRelayModern/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "icon-20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "icon-20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "icon-29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "icon-29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "icon-29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "icon-40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "icon-40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "57x57", 47 | "idiom" : "iphone", 48 | "filename" : "icon-57@1x.png", 49 | "scale" : "1x" 50 | }, 51 | { 52 | "size" : "57x57", 53 | "idiom" : "iphone", 54 | "filename" : "icon-57@2x.png", 55 | "scale" : "2x" 56 | }, 57 | { 58 | "size" : "60x60", 59 | "idiom" : "iphone", 60 | "filename" : "icon-60@2x.png", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "size" : "60x60", 65 | "idiom" : "iphone", 66 | "filename" : "icon-60@3x.png", 67 | "scale" : "3x" 68 | }, 69 | { 70 | "size" : "20x20", 71 | "idiom" : "ipad", 72 | "filename" : "icon-20@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "20x20", 77 | "idiom" : "ipad", 78 | "filename" : "icon-20@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "29x29", 83 | "idiom" : "ipad", 84 | "filename" : "icon-29@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "29x29", 89 | "idiom" : "ipad", 90 | "filename" : "icon-29@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "40x40", 95 | "idiom" : "ipad", 96 | "filename" : "icon-40@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "40x40", 101 | "idiom" : "ipad", 102 | "filename" : "icon-40@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "50x50", 107 | "idiom" : "ipad", 108 | "filename" : "icon-50@1x.png", 109 | "scale" : "1x" 110 | }, 111 | { 112 | "size" : "50x50", 113 | "idiom" : "ipad", 114 | "filename" : "icon-50@2x.png", 115 | "scale" : "2x" 116 | }, 117 | { 118 | "size" : "72x72", 119 | "idiom" : "ipad", 120 | "filename" : "icon-72@1x.png", 121 | "scale" : "1x" 122 | }, 123 | { 124 | "size" : "72x72", 125 | "idiom" : "ipad", 126 | "filename" : "icon-72@2x.png", 127 | "scale" : "2x" 128 | }, 129 | { 130 | "size" : "76x76", 131 | "idiom" : "ipad", 132 | "filename" : "icon-76@1x.png", 133 | "scale" : "1x" 134 | }, 135 | { 136 | "size" : "76x76", 137 | "idiom" : "ipad", 138 | "filename" : "icon-76@2x.png", 139 | "scale" : "2x" 140 | }, 141 | { 142 | "size" : "83.5x83.5", 143 | "idiom" : "ipad", 144 | "filename" : "icon-83.5@2x.png", 145 | "scale" : "2x" 146 | }, 147 | { 148 | "size" : "1024x1024", 149 | "idiom" : "ios-marketing", 150 | "filename" : "icon-1024@1x.png", 151 | "scale" : "1x" 152 | } 153 | ], 154 | "info" : { 155 | "version" : 1, 156 | "author" : "xcode" 157 | } 158 | } 159 | -------------------------------------------------------------------------------- /data/schema.graphql: -------------------------------------------------------------------------------- 1 | input ChangePasswordInput { 2 | oldPassword: String! 3 | 4 | # user new password 5 | password: String! 6 | clientMutationId: String 7 | } 8 | 9 | type ChangePasswordPayload { 10 | error: String 11 | me: User 12 | clientMutationId: String 13 | } 14 | 15 | input LoginEmailInput { 16 | email: String! 17 | password: String! 18 | clientMutationId: String 19 | } 20 | 21 | type LoginEmailPayload { 22 | token: String 23 | error: String 24 | clientMutationId: String 25 | } 26 | 27 | type Mutation { 28 | LoginEmail(input: LoginEmailInput!): LoginEmailPayload 29 | RegisterEmail(input: RegisterEmailInput!): RegisterEmailPayload 30 | ChangePassword(input: ChangePasswordInput!): ChangePasswordPayload 31 | TweetAdd(input: TweetAddInput!): TweetAddPayload 32 | TweetEdit(input: TweetEditInput!): TweetEditPayload 33 | } 34 | 35 | # An object with an ID 36 | interface Node { 37 | # The id of the object. 38 | id: ID! 39 | } 40 | 41 | # Information about pagination in a connection. 42 | type PageInfo { 43 | # When paginating forwards, are there more items? 44 | hasNextPage: Boolean! 45 | 46 | # When paginating backwards, are there more items? 47 | hasPreviousPage: Boolean! 48 | 49 | # When paginating backwards, the cursor to continue. 50 | startCursor: String 51 | 52 | # When paginating forwards, the cursor to continue. 53 | endCursor: String 54 | } 55 | 56 | # The root of all... queries 57 | type Query { 58 | # Fetches an object given its ID 59 | node( 60 | # The ID of an object 61 | id: ID! 62 | ): Node 63 | me: User 64 | user(id: ID!): User 65 | users(after: String, first: Int, before: String, last: Int, search: String): UserConnection 66 | tweet(id: ID!): Tweet 67 | tweets(after: String, first: Int, before: String, last: Int, search: String): TweetConnection 68 | } 69 | 70 | input RegisterEmailInput { 71 | name: String! 72 | image: String! 73 | email: String! 74 | password: String! 75 | clientMutationId: String 76 | } 77 | 78 | type RegisterEmailPayload { 79 | token: String 80 | error: String 81 | clientMutationId: String 82 | } 83 | 84 | # Represents Tweet 85 | type Tweet implements Node { 86 | # The ID of an object 87 | id: ID! 88 | 89 | # username of the tweet owner 90 | username: String 91 | 92 | # userImage of the tweet owner 93 | userImage: String 94 | 95 | # tweet body 96 | text: String 97 | 98 | # tweet likes 99 | likes: [String] 100 | } 101 | 102 | input TweetAddInput { 103 | # username of the tweet owner 104 | username: String 105 | 106 | # userImage of the tweet owner 107 | userImage: String 108 | 109 | # tweet body 110 | text: String 111 | 112 | # tweet likes 113 | likes: [String] 114 | clientMutationId: String 115 | } 116 | 117 | type TweetAddPayload { 118 | tweetEdge: TweetEdge 119 | error: String 120 | clientMutationId: String 121 | } 122 | 123 | # A connection to a list of items. 124 | type TweetConnection { 125 | # Information to aid in pagination. 126 | pageInfo: PageInfo! 127 | 128 | # A list of edges. 129 | edges: [TweetEdge] 130 | count: Int 131 | } 132 | 133 | # An edge in a connection. 134 | type TweetEdge { 135 | # The item at the end of the edge 136 | node: Tweet 137 | 138 | # A cursor for use in pagination 139 | cursor: String! 140 | } 141 | 142 | input TweetEditInput { 143 | id: ID! 144 | likes: [String] 145 | text: String 146 | clientMutationId: String 147 | } 148 | 149 | type TweetEditPayload { 150 | tweet: Tweet 151 | error: String 152 | clientMutationId: String 153 | } 154 | 155 | # User data 156 | type User implements Node { 157 | # The ID of an object 158 | id: ID! 159 | _id: String 160 | name: String 161 | image: String 162 | email: String 163 | active: Boolean 164 | } 165 | 166 | # A connection to a list of items. 167 | type UserConnection { 168 | # Information to aid in pagination. 169 | pageInfo: PageInfo! 170 | 171 | # A list of edges. 172 | edges: [UserEdge] 173 | count: Int 174 | } 175 | 176 | # An edge in a connection. 177 | type UserEdge { 178 | # The item at the end of the edge 179 | node: User 180 | 181 | # A cursor for use in pagination 182 | cursor: String! 183 | } 184 | -------------------------------------------------------------------------------- /ios/ReactNativeRelayModern.xcodeproj/xcshareddata/xcschemes/ReactNativeRelayModern.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 43 | 49 | 50 | 51 | 52 | 53 | 58 | 59 | 61 | 67 | 68 | 69 | 70 | 71 | 77 | 78 | 79 | 80 | 81 | 82 | 92 | 94 | 100 | 101 | 102 | 103 | 104 | 105 | 111 | 113 | 119 | 120 | 121 | 122 | 124 | 125 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ios/ReactNativeRelayModern.xcodeproj/xcshareddata/xcschemes/ReactNativeRelayModern-tvOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 43 | 49 | 50 | 51 | 52 | 53 | 58 | 59 | 61 | 67 | 68 | 69 | 70 | 71 | 77 | 78 | 79 | 80 | 81 | 82 | 92 | 94 | 100 | 101 | 102 | 103 | 104 | 105 | 111 | 113 | 119 | 120 | 121 | 122 | 124 | 125 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /src/components/tweetsCreate/Create.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | import React, { Component } from 'react'; 3 | import { 4 | View, 5 | Text, 6 | StyleSheet, 7 | Animated, 8 | KeyboardAvoidingView, 9 | ActivityIndicator, 10 | } from 'react-native'; 11 | import styled from 'styled-components/native'; 12 | import CloseIcon from '../icons/CloseIcon'; 13 | import { QueryRenderer, graphql } from 'react-relay'; 14 | import env from '../../config/Enviroment'; 15 | import Snackbar from 'react-native-snackbar'; 16 | import hoistStatics from 'hoist-non-react-statics'; 17 | import { withNavigation, NavigationActions } from 'react-navigation'; 18 | import commit from './mutation/TweetAddMutation'; 19 | 20 | const Header = styled.View` 21 | flex-direction: row; 22 | justify-content: space-between; 23 | padding: 20px; 24 | padding-top: 30; 25 | background-color: #ffffff; 26 | `; 27 | 28 | const ProfilePicture = styled.Image` 29 | width: 40; 30 | height: 40; 31 | border-radius: 20; 32 | `; 33 | 34 | const CloseButton = styled.TouchableOpacity` 35 | align-items: center; 36 | justify-content: center; 37 | `; 38 | 39 | const Textarea = styled.TextInput` 40 | padding: 20px; 41 | margin-top: 10; 42 | font-size: 20; 43 | font-weight: bold; 44 | color: #2d2d2d; 45 | `; 46 | 47 | const SignUpButton = styled.TouchableOpacity` 48 | background-color: rgb(29, 161, 242); 49 | padding-horizontal: 30; 50 | padding-vertical: 10; 51 | align-items: center; 52 | justify-content: center; 53 | border-radius: 40; 54 | `; 55 | 56 | const SignUpText = styled.Text` 57 | color: white; 58 | font-size: 18; 59 | font-weight: 800; 60 | `; 61 | 62 | const Footer = styled.View` 63 | align-items: flex-end; 64 | justify-content: center; 65 | bottom: 20; 66 | right: 20; 67 | `; 68 | 69 | const ViewAnimated = Animated.createAnimatedComponent(View); 70 | 71 | @withNavigation 72 | class Create extends Component { 73 | static navigationOptions = { 74 | header: null, 75 | }; 76 | 77 | state = { 78 | tweetText: '', 79 | }; 80 | 81 | showError = () => { 82 | Snackbar.show({ 83 | title: 'Ocorreu um erro inesperado', 84 | duration: Snackbar.LENGTH_INDEFINITE, 85 | action: { 86 | title: 'RETRY', 87 | color: 'red', 88 | onPress: () => this.Tweet, 89 | }, 90 | }); 91 | }; 92 | 93 | onComplete = () => { 94 | this.props.navigation.Snackbar.show({ 95 | title: 'Hello world', 96 | duration: Snackbar.LENGTH_INDEFINITE, 97 | action: { 98 | title: 'UNDO', 99 | color: 'green', 100 | onPress: () => {}, 101 | }, 102 | }); 103 | const navigateAction = NavigationActions.navigate({ 104 | routeName: 'Profile', 105 | 106 | params: {}, 107 | 108 | action: NavigationActions.navigate({ routeName: 'Feed' }), 109 | }); 110 | 111 | this.props.navigation.dispatch(navigateAction); 112 | }; 113 | 114 | goBack = () => { 115 | this.props.navigation.goBack(); 116 | }; 117 | 118 | Tweet = () => { 119 | const { me } = this.props; 120 | const { tweetText } = this.state; 121 | 122 | commit(me.name, me.image, tweetText, [], this.onComplete, this.showError); 123 | }; 124 | 125 | render() { 126 | const { image } = this.props.me; 127 | const { tweetText } = this.state; 128 | return ( 129 | 130 |
131 | 132 | 139 | 140 | 141 | 142 | 143 |
144 | 145 | 146 |