├── .gitignore ├── .vscode └── launch.json ├── README.md ├── images.d.ts ├── package.json ├── public ├── favicon.ico ├── index.html └── manifest.json ├── schema.json ├── src ├── Components │ ├── AddressBar │ │ ├── AddressBar.tsx │ │ └── index.ts │ ├── App │ │ ├── AppContainer.tsx │ │ ├── AppPresenter.tsx │ │ ├── AppQueries.local.ts │ │ └── index.ts │ ├── BackArrow │ │ ├── BackArrow.tsx │ │ └── index.ts │ ├── Button │ │ ├── Button.tsx │ │ └── index.ts │ ├── Form │ │ ├── Form.tsx │ │ └── index.ts │ ├── Header │ │ ├── Header.tsx │ │ └── index.ts │ ├── Input │ │ ├── Input.tsx │ │ └── index.ts │ ├── Menu │ │ ├── MenuContainer.tsx │ │ ├── MenuPresenter.tsx │ │ ├── MenuQueries.ts │ │ └── index.ts │ ├── Message │ │ ├── Message.tsx │ │ └── index.ts │ ├── PhotoInput │ │ ├── PhotoInput.tsx │ │ └── index.ts │ ├── Place │ │ ├── PlaceContainer.tsx │ │ ├── PlacePresenter.tsx │ │ ├── PlaceQueries.ts │ │ └── index.ts │ └── RidePopUp │ │ ├── RidePopUp.tsx │ │ └── index.ts ├── Routes │ ├── AddPlace │ │ ├── AddPlaceContainer.tsx │ │ ├── AddPlacePresenter.tsx │ │ ├── AddPlaceQuery.ts │ │ └── index.tsx │ ├── Chat │ │ ├── ChatContainer.tsx │ │ ├── ChatPresenter.tsx │ │ ├── ChatQueries.ts │ │ └── index.ts │ ├── EditAccount │ │ ├── EditAccountContainer.tsx │ │ ├── EditAccountPresenter.tsx │ │ ├── EditAccountQueries.ts │ │ └── index.tsx │ ├── FindAddress │ │ ├── FindAddressContainer.tsx │ │ ├── FindAddressPresenter.tsx │ │ └── index.tsx │ ├── Home │ │ ├── HomeContainer.tsx │ │ ├── HomePresenter.tsx │ │ ├── HomeQueries.ts │ │ └── index.tsx │ ├── Login │ │ ├── LoginPresenter.tsx │ │ └── index.tsx │ ├── PhoneLogin │ │ ├── PhoneLoginContainer.tsx │ │ ├── PhoneLoginPresenter.tsx │ │ ├── PhoneQueries.ts │ │ └── index.tsx │ ├── Places │ │ ├── PlacesContainer.tsx │ │ ├── PlacesPresenter.tsx │ │ └── index.tsx │ ├── Ride │ │ ├── RideContainer.tsx │ │ ├── RidePresenter.tsx │ │ ├── RideQueries.ts │ │ └── index.tsx │ ├── Settings │ │ ├── SettingsContainer.tsx │ │ ├── SettingsPresenter.tsx │ │ └── index.tsx │ ├── SocialLogin │ │ ├── SocialLoginContainer.tsx │ │ ├── SocialLoginPresenter.tsx │ │ ├── SocialLoginQueries.ts │ │ └── index.tsx │ └── VerifyPhone │ │ ├── VerifyPhoneContainer.tsx │ │ ├── VerifyPhonePresenter.tsx │ │ ├── VerifyPhoneQueries.ts │ │ └── index.tsx ├── apollo.ts ├── countries.ts ├── global-styles.ts ├── images │ └── bg.png ├── index.tsx ├── keys.ts ├── mapHelpers.ts ├── sharedQueries.local.ts ├── sharedQueries.ts ├── theme.ts ├── typed-components.ts └── types │ └── api.d.ts ├── tsconfig.json ├── tsconfig.prod.json ├── tsconfig.test.json ├── tslint.json └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | 6 | # testing 7 | /coverage 8 | 9 | # production 10 | /build 11 | 12 | # misc 13 | .DS_Store 14 | .env.local 15 | .env.development.local 16 | .env.test.local 17 | .env.production.local 18 | 19 | npm-debug.log* 20 | yarn-debug.log* 21 | yarn-error.log* 22 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "node", 9 | "request": "launch", 10 | "name": "Launch Program", 11 | "program": "${workspaceFolder}/start" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Nuber Client 2 | 3 | Client for the (N)Uber Clone Course on Nomad Academy. ReactJS, Apollo, Typescript 4 | 5 | ## Screens: 6 | 7 | ### Logged Out: 8 | 9 | - [x] Home 10 | - [x] Phone Login 11 | - [x] Verify Phone Number 12 | - [x] Social Login 13 | 14 | ### Logged In: 15 | 16 | - [x] Home 17 | - [x] Ride 18 | - [x] Chat 19 | - [x] Edit Account 20 | - [x] Settings 21 | - [x] Places 22 | - [x] Add Place 23 | - [x] Find Address 24 | - [ ] Challenge: Ride History 25 | - [ ] Challenge: Email Sign In 26 | -------------------------------------------------------------------------------- /images.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.svg' 2 | declare module '*.png' 3 | declare module '*.jpg' 4 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nuber-client", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@types/react-router-dom": "^4.3.0", 7 | "apollo-boost": "^0.1.12", 8 | "apollo-cache-inmemory": "^1.2.7", 9 | "apollo-client": "^2.3.8", 10 | "apollo-link": "^1.2.2", 11 | "apollo-link-error": "^1.1.0", 12 | "apollo-link-http": "^1.5.4", 13 | "apollo-link-state": "^0.4.1", 14 | "apollo-link-ws": "^1.0.8", 15 | "apollo-utilities": "^1.0.18", 16 | "axios": "^0.18.0", 17 | "google-maps-react": "^2.0.2", 18 | "graphql": "^0.13.2", 19 | "prop-types": "^15.6.2", 20 | "react": "^16.4.2", 21 | "react-apollo": "^2.1.9", 22 | "react-dom": "^16.4.2", 23 | "react-facebook-login": "^4.0.1", 24 | "react-helmet": "^5.2.0", 25 | "react-router-dom": "^4.3.1", 26 | "react-scripts-ts": "2.17.0", 27 | "react-sidebar": "^3.0.2", 28 | "react-toastify": "^4.1.0", 29 | "styled-components": "^3.4.2", 30 | "styled-reset": "^1.3.6", 31 | "subscriptions-transport-ws": "^0.9.14" 32 | }, 33 | "scripts": { 34 | "start": "react-scripts-ts start", 35 | "build": "react-scripts-ts build", 36 | "test": "react-scripts-ts test --env=jsdom", 37 | "eject": "react-scripts-ts eject", 38 | "precodegen": "apollo schema:download --endpoint=http://localhost:4000/graphql", 39 | "codegen": "apollo codegen:generate src/types/api.d.ts --queries='src/**/!(*.local).ts' --addTypename --schema schema.json --target typescript --outputFlat", 40 | "predeploy": "yarn run build", 41 | "deploy": "gh-pages -d build" 42 | }, 43 | "devDependencies": { 44 | "@types/axios": "^0.14.0", 45 | "@types/googlemaps": "^3.30.11", 46 | "@types/jest": "^23.3.1", 47 | "@types/node": "^10.5.7", 48 | "@types/prop-types": "^15.5.4", 49 | "@types/react": "^16.4.8", 50 | "@types/react-dom": "^16.0.7", 51 | "@types/react-sidebar": "^3.0.0", 52 | "gh-pages": "^1.2.0", 53 | "typescript": "^3.0.1" 54 | }, 55 | "homepage": "https://nomadcoders.github.io/nuber-client/" 56 | } 57 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nomadcoders/nuber-client/2cf12dfcc2eed3c3fc3e5c8c4765a656b5015dcc/public/favicon.ico -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 14 | 23 | Nuber 24 | 25 | 26 | 27 | 30 |
31 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /schema.json: -------------------------------------------------------------------------------- 1 | {"queryType":{"name":"Query"},"mutationType":{"name":"Mutation"},"subscriptionType":{"name":"Subscription"},"types":[{"kind":"OBJECT","name":"Query","description":"","fields":[{"name":"GetChat","description":"","args":[{"name":"chatId","description":"","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}},"defaultValue":null}],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"GetChatResponse","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"GetMyPlaces","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"GetMyPlacesResponse","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"GetNearbyRide","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"GetNearbyRideResponse","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"GetRide","description":"","args":[{"name":"rideId","description":"","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}},"defaultValue":null}],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"GetRideResponse","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"GetMyProfile","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"GetMyProfileResponse","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"GetNearbyDrivers","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"GetNearbyDriversResponse","ofType":null}},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":null},{"kind":"SCALAR","name":"Int","description":"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. ","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null},{"kind":"OBJECT","name":"GetChatResponse","description":"","fields":[{"name":"ok","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"error","description":"","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"chat","description":"","args":[],"type":{"kind":"OBJECT","name":"Chat","ofType":null},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":null},{"kind":"SCALAR","name":"Boolean","description":"The `Boolean` scalar type represents `true` or `false`.","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null},{"kind":"SCALAR","name":"String","description":"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null},{"kind":"OBJECT","name":"Chat","description":"","fields":[{"name":"id","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"messages","description":"","args":[],"type":{"kind":"LIST","name":null,"ofType":{"kind":"OBJECT","name":"Message","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"passengerId","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"passenger","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"User","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"driverId","description":"","args":[],"type":{"kind":"SCALAR","name":"Int","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"driver","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"User","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"rideId","description":"","args":[],"type":{"kind":"SCALAR","name":"Int","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"ride","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"Ride","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"createdAt","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"updatedAt","description":"","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":null},{"kind":"OBJECT","name":"Message","description":"","fields":[{"name":"id","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"text","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"chatId","description":"","args":[],"type":{"kind":"SCALAR","name":"Int","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"chat","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"Chat","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"userId","description":"","args":[],"type":{"kind":"SCALAR","name":"Int","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"user","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"User","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"createdAt","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"updatedAt","description":"","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":null},{"kind":"OBJECT","name":"User","description":"","fields":[{"name":"id","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"email","description":"","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"verifiedEmail","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"firstName","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"lastName","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"age","description":"","args":[],"type":{"kind":"SCALAR","name":"Int","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"password","description":"","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"phoneNumber","description":"","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"verifiedPhoneNumber","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"profilePhoto","description":"","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"fullName","description":"","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"isDriving","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"isRiding","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"isTaken","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"lastLng","description":"","args":[],"type":{"kind":"SCALAR","name":"Float","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"lastLat","description":"","args":[],"type":{"kind":"SCALAR","name":"Float","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"lastOrientation","description":"","args":[],"type":{"kind":"SCALAR","name":"Float","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"fbId","description":"","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"messages","description":"","args":[],"type":{"kind":"LIST","name":null,"ofType":{"kind":"OBJECT","name":"Message","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"ridesAsPassenger","description":"","args":[],"type":{"kind":"LIST","name":null,"ofType":{"kind":"OBJECT","name":"Ride","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"ridesAsDriver","description":"","args":[],"type":{"kind":"LIST","name":null,"ofType":{"kind":"OBJECT","name":"Ride","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"chatsAsDriver","description":"","args":[],"type":{"kind":"LIST","name":null,"ofType":{"kind":"OBJECT","name":"Chat","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"chatsAsPassenger","description":"","args":[],"type":{"kind":"LIST","name":null,"ofType":{"kind":"OBJECT","name":"Chat","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"places","description":"","args":[],"type":{"kind":"LIST","name":null,"ofType":{"kind":"OBJECT","name":"Place","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"createdAt","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"updatedAt","description":"","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":null},{"kind":"SCALAR","name":"Float","description":"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). ","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null},{"kind":"OBJECT","name":"Ride","description":"","fields":[{"name":"id","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"status","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"pickUpAddress","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"pickUpLat","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Float","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"pickUpLng","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Float","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"dropOffAddress","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"dropOffLat","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Float","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"dropOffLng","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Float","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"price","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Float","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"distance","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"duration","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"driverId","description":"","args":[],"type":{"kind":"SCALAR","name":"Int","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"driver","description":"","args":[],"type":{"kind":"OBJECT","name":"User","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"passengerId","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"passenger","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"User","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"chat","description":"","args":[],"type":{"kind":"OBJECT","name":"Chat","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"chatId","description":"","args":[],"type":{"kind":"SCALAR","name":"Int","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"createdAt","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"updatedAt","description":"","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":null},{"kind":"OBJECT","name":"Place","description":"","fields":[{"name":"id","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"name","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"lat","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Float","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"lng","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Float","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"address","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"isFav","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"userId","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"user","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"User","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"createdAt","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"updatedAt","description":"","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":null},{"kind":"OBJECT","name":"GetMyPlacesResponse","description":"","fields":[{"name":"ok","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"error","description":"","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"places","description":"","args":[],"type":{"kind":"LIST","name":null,"ofType":{"kind":"OBJECT","name":"Place","ofType":null}},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":null},{"kind":"OBJECT","name":"GetNearbyRideResponse","description":"","fields":[{"name":"ok","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"error","description":"","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"ride","description":"","args":[],"type":{"kind":"OBJECT","name":"Ride","ofType":null},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":null},{"kind":"OBJECT","name":"GetRideResponse","description":"","fields":[{"name":"ok","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"error","description":"","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"ride","description":"","args":[],"type":{"kind":"OBJECT","name":"Ride","ofType":null},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":null},{"kind":"OBJECT","name":"GetMyProfileResponse","description":"","fields":[{"name":"ok","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"error","description":"","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"user","description":"","args":[],"type":{"kind":"OBJECT","name":"User","ofType":null},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":null},{"kind":"OBJECT","name":"GetNearbyDriversResponse","description":"","fields":[{"name":"ok","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"error","description":"","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"drivers","description":"","args":[],"type":{"kind":"LIST","name":null,"ofType":{"kind":"OBJECT","name":"User","ofType":null}},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":null},{"kind":"OBJECT","name":"Mutation","description":"","fields":[{"name":"SendChatMessage","description":"","args":[{"name":"text","description":"","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"defaultValue":null},{"name":"chatId","description":"","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}},"defaultValue":null}],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"SendChatMessageResponse","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"AddPlace","description":"","args":[{"name":"name","description":"","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"defaultValue":null},{"name":"lat","description":"","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Float","ofType":null}},"defaultValue":null},{"name":"lng","description":"","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Float","ofType":null}},"defaultValue":null},{"name":"address","description":"","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"defaultValue":null},{"name":"isFav","description":"","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"defaultValue":null}],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"AddPlaceResponse","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"DeletePlace","description":"","args":[{"name":"placeId","description":"","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}},"defaultValue":null}],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"DeletePlaceResponse","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"EditPlace","description":"","args":[{"name":"placeId","description":"","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}},"defaultValue":null},{"name":"name","description":"","type":{"kind":"SCALAR","name":"String","ofType":null},"defaultValue":null},{"name":"isFav","description":"","type":{"kind":"SCALAR","name":"Boolean","ofType":null},"defaultValue":null}],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"EditPlaceResponse","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"RequestRide","description":"","args":[{"name":"pickUpAddress","description":"","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"defaultValue":null},{"name":"pickUpLat","description":"","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Float","ofType":null}},"defaultValue":null},{"name":"pickUpLng","description":"","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Float","ofType":null}},"defaultValue":null},{"name":"dropOffAddress","description":"","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"defaultValue":null},{"name":"dropOffLat","description":"","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Float","ofType":null}},"defaultValue":null},{"name":"dropOffLng","description":"","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Float","ofType":null}},"defaultValue":null},{"name":"price","description":"","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Float","ofType":null}},"defaultValue":null},{"name":"distance","description":"","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"defaultValue":null},{"name":"duration","description":"","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"defaultValue":null}],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"RequestRideResponse","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"UpdateRideStatus","description":"","args":[{"name":"rideId","description":"","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}},"defaultValue":null},{"name":"status","description":"","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"ENUM","name":"StatusOptions","ofType":null}},"defaultValue":null}],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"UpdateRideStatusResponse","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"CompleteEmailVerification","description":"","args":[{"name":"key","description":"","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"defaultValue":null}],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"CompleteEmailVerificationResponse","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"CompletePhoneVerification","description":"","args":[{"name":"phoneNumber","description":"","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"defaultValue":null},{"name":"key","description":"","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"defaultValue":null}],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"CompletePhoneVerificationResponse","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"EmailSignIn","description":"","args":[{"name":"email","description":"","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"defaultValue":null},{"name":"password","description":"","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"defaultValue":null}],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"EmailSignInResponse","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"EmailSignUp","description":"","args":[{"name":"firstName","description":"","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"defaultValue":null},{"name":"lastName","description":"","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"defaultValue":null},{"name":"email","description":"","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"defaultValue":null},{"name":"password","description":"","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"defaultValue":null},{"name":"profilePhoto","description":"","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"defaultValue":null},{"name":"age","description":"","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}},"defaultValue":null},{"name":"phoneNumber","description":"","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"defaultValue":null}],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"EmailSignUpResponse","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"FacebookConnect","description":"","args":[{"name":"firstName","description":"","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"defaultValue":null},{"name":"lastName","description":"","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"defaultValue":null},{"name":"email","description":"","type":{"kind":"SCALAR","name":"String","ofType":null},"defaultValue":null},{"name":"fbId","description":"","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"defaultValue":null}],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"FacebookConnectResponse","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"ReportMovement","description":"","args":[{"name":"orientation","description":"","type":{"kind":"SCALAR","name":"Float","ofType":null},"defaultValue":null},{"name":"lastLat","description":"","type":{"kind":"SCALAR","name":"Float","ofType":null},"defaultValue":null},{"name":"lastLng","description":"","type":{"kind":"SCALAR","name":"Float","ofType":null},"defaultValue":null}],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"ReportMovementResponse","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"RequestEmailVerification","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"RequestEmailVerificationResponse","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"StartPhoneVerification","description":"","args":[{"name":"phoneNumber","description":"","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"defaultValue":null}],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"StartPhoneVerificationResponse","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"ToggleDrivingMode","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"ToggleDrivingModeResponse","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"UpdateMyProfile","description":"","args":[{"name":"firstName","description":"","type":{"kind":"SCALAR","name":"String","ofType":null},"defaultValue":null},{"name":"lastName","description":"","type":{"kind":"SCALAR","name":"String","ofType":null},"defaultValue":null},{"name":"email","description":"","type":{"kind":"SCALAR","name":"String","ofType":null},"defaultValue":null},{"name":"password","description":"","type":{"kind":"SCALAR","name":"String","ofType":null},"defaultValue":null},{"name":"profilePhoto","description":"","type":{"kind":"SCALAR","name":"String","ofType":null},"defaultValue":null},{"name":"age","description":"","type":{"kind":"SCALAR","name":"Int","ofType":null},"defaultValue":null}],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"UpdateMyProfileResponse","ofType":null}},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":null},{"kind":"OBJECT","name":"SendChatMessageResponse","description":"","fields":[{"name":"ok","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"error","description":"","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"message","description":"","args":[],"type":{"kind":"OBJECT","name":"Message","ofType":null},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":null},{"kind":"OBJECT","name":"AddPlaceResponse","description":"","fields":[{"name":"ok","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"error","description":"","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":null},{"kind":"OBJECT","name":"DeletePlaceResponse","description":"","fields":[{"name":"ok","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"error","description":"","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":null},{"kind":"OBJECT","name":"EditPlaceResponse","description":"","fields":[{"name":"ok","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"error","description":"","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":null},{"kind":"OBJECT","name":"RequestRideResponse","description":"","fields":[{"name":"ok","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"error","description":"","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"ride","description":"","args":[],"type":{"kind":"OBJECT","name":"Ride","ofType":null},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":null},{"kind":"ENUM","name":"StatusOptions","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":[{"name":"ACCEPTED","description":"","isDeprecated":false,"deprecationReason":null},{"name":"FINISHED","description":"","isDeprecated":false,"deprecationReason":null},{"name":"CANCELED","description":"","isDeprecated":false,"deprecationReason":null},{"name":"REQUESTING","description":"","isDeprecated":false,"deprecationReason":null},{"name":"ONROUTE","description":"","isDeprecated":false,"deprecationReason":null}],"possibleTypes":null},{"kind":"OBJECT","name":"UpdateRideStatusResponse","description":"","fields":[{"name":"ok","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"error","description":"","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"rideId","description":"","args":[],"type":{"kind":"SCALAR","name":"Int","ofType":null},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":null},{"kind":"OBJECT","name":"CompleteEmailVerificationResponse","description":"","fields":[{"name":"ok","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"error","description":"","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":null},{"kind":"OBJECT","name":"CompletePhoneVerificationResponse","description":"","fields":[{"name":"ok","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"error","description":"","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"token","description":"","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":null},{"kind":"OBJECT","name":"EmailSignInResponse","description":"","fields":[{"name":"ok","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"error","description":"","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"token","description":"","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":null},{"kind":"OBJECT","name":"EmailSignUpResponse","description":"","fields":[{"name":"ok","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"error","description":"","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"token","description":"","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":null},{"kind":"OBJECT","name":"FacebookConnectResponse","description":"","fields":[{"name":"ok","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"error","description":"","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"token","description":"","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":null},{"kind":"OBJECT","name":"ReportMovementResponse","description":"","fields":[{"name":"ok","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"error","description":"","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":null},{"kind":"OBJECT","name":"RequestEmailVerificationResponse","description":"","fields":[{"name":"ok","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"error","description":"","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":null},{"kind":"OBJECT","name":"StartPhoneVerificationResponse","description":"","fields":[{"name":"ok","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"error","description":"","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":null},{"kind":"OBJECT","name":"ToggleDrivingModeResponse","description":"","fields":[{"name":"ok","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"error","description":"","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":null},{"kind":"OBJECT","name":"UpdateMyProfileResponse","description":"","fields":[{"name":"ok","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"error","description":"","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":null},{"kind":"OBJECT","name":"Subscription","description":"","fields":[{"name":"MessageSubscription","description":"","args":[],"type":{"kind":"OBJECT","name":"Message","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"NearbyRideSubscription","description":"","args":[],"type":{"kind":"OBJECT","name":"Ride","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"RideStatusSubscription","description":"","args":[],"type":{"kind":"OBJECT","name":"Ride","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"DriversSubscription","description":"","args":[],"type":{"kind":"OBJECT","name":"User","ofType":null},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":null},{"kind":"OBJECT","name":"__Schema","description":"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.","fields":[{"name":"types","description":"A list of all types supported by this server.","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__Type","ofType":null}}}},"isDeprecated":false,"deprecationReason":null},{"name":"queryType","description":"The type that query operations will be rooted at.","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__Type","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"mutationType","description":"If this server supports mutation, the type that mutation operations will be rooted at.","args":[],"type":{"kind":"OBJECT","name":"__Type","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"subscriptionType","description":"If this server support subscription, the type that subscription operations will be rooted at.","args":[],"type":{"kind":"OBJECT","name":"__Type","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"directives","description":"A list of all directives supported by this server.","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__Directive","ofType":null}}}},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":null},{"kind":"OBJECT","name":"__Type","description":"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name and description, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.","fields":[{"name":"kind","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"ENUM","name":"__TypeKind","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"name","description":null,"args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"description","description":null,"args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"fields","description":null,"args":[{"name":"includeDeprecated","description":null,"type":{"kind":"SCALAR","name":"Boolean","ofType":null},"defaultValue":"false"}],"type":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__Field","ofType":null}}},"isDeprecated":false,"deprecationReason":null},{"name":"interfaces","description":null,"args":[],"type":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__Type","ofType":null}}},"isDeprecated":false,"deprecationReason":null},{"name":"possibleTypes","description":null,"args":[],"type":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__Type","ofType":null}}},"isDeprecated":false,"deprecationReason":null},{"name":"enumValues","description":null,"args":[{"name":"includeDeprecated","description":null,"type":{"kind":"SCALAR","name":"Boolean","ofType":null},"defaultValue":"false"}],"type":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__EnumValue","ofType":null}}},"isDeprecated":false,"deprecationReason":null},{"name":"inputFields","description":null,"args":[],"type":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__InputValue","ofType":null}}},"isDeprecated":false,"deprecationReason":null},{"name":"ofType","description":null,"args":[],"type":{"kind":"OBJECT","name":"__Type","ofType":null},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":null},{"kind":"ENUM","name":"__TypeKind","description":"An enum describing what kind of type a given `__Type` is.","fields":null,"inputFields":null,"interfaces":null,"enumValues":[{"name":"SCALAR","description":"Indicates this type is a scalar.","isDeprecated":false,"deprecationReason":null},{"name":"OBJECT","description":"Indicates this type is an object. `fields` and `interfaces` are valid fields.","isDeprecated":false,"deprecationReason":null},{"name":"INTERFACE","description":"Indicates this type is an interface. `fields` and `possibleTypes` are valid fields.","isDeprecated":false,"deprecationReason":null},{"name":"UNION","description":"Indicates this type is a union. `possibleTypes` is a valid field.","isDeprecated":false,"deprecationReason":null},{"name":"ENUM","description":"Indicates this type is an enum. `enumValues` is a valid field.","isDeprecated":false,"deprecationReason":null},{"name":"INPUT_OBJECT","description":"Indicates this type is an input object. `inputFields` is a valid field.","isDeprecated":false,"deprecationReason":null},{"name":"LIST","description":"Indicates this type is a list. `ofType` is a valid field.","isDeprecated":false,"deprecationReason":null},{"name":"NON_NULL","description":"Indicates this type is a non-null. `ofType` is a valid field.","isDeprecated":false,"deprecationReason":null}],"possibleTypes":null},{"kind":"OBJECT","name":"__Field","description":"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.","fields":[{"name":"name","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"description","description":null,"args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"args","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__InputValue","ofType":null}}}},"isDeprecated":false,"deprecationReason":null},{"name":"type","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__Type","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"isDeprecated","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"deprecationReason","description":null,"args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":null},{"kind":"OBJECT","name":"__InputValue","description":"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.","fields":[{"name":"name","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"description","description":null,"args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"type","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__Type","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"defaultValue","description":"A GraphQL-formatted string representing the default value for this input value.","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":null},{"kind":"OBJECT","name":"__EnumValue","description":"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.","fields":[{"name":"name","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"description","description":null,"args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"isDeprecated","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"deprecationReason","description":null,"args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":null},{"kind":"OBJECT","name":"__Directive","description":"A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.","fields":[{"name":"name","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"description","description":null,"args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"locations","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"ENUM","name":"__DirectiveLocation","ofType":null}}}},"isDeprecated":false,"deprecationReason":null},{"name":"args","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__InputValue","ofType":null}}}},"isDeprecated":false,"deprecationReason":null},{"name":"onOperation","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"isDeprecated":true,"deprecationReason":"Use `locations`."},{"name":"onFragment","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"isDeprecated":true,"deprecationReason":"Use `locations`."},{"name":"onField","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"isDeprecated":true,"deprecationReason":"Use `locations`."}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":null},{"kind":"ENUM","name":"__DirectiveLocation","description":"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.","fields":null,"inputFields":null,"interfaces":null,"enumValues":[{"name":"QUERY","description":"Location adjacent to a query operation.","isDeprecated":false,"deprecationReason":null},{"name":"MUTATION","description":"Location adjacent to a mutation operation.","isDeprecated":false,"deprecationReason":null},{"name":"SUBSCRIPTION","description":"Location adjacent to a subscription operation.","isDeprecated":false,"deprecationReason":null},{"name":"FIELD","description":"Location adjacent to a field.","isDeprecated":false,"deprecationReason":null},{"name":"FRAGMENT_DEFINITION","description":"Location adjacent to a fragment definition.","isDeprecated":false,"deprecationReason":null},{"name":"FRAGMENT_SPREAD","description":"Location adjacent to a fragment spread.","isDeprecated":false,"deprecationReason":null},{"name":"INLINE_FRAGMENT","description":"Location adjacent to an inline fragment.","isDeprecated":false,"deprecationReason":null},{"name":"SCHEMA","description":"Location adjacent to a schema definition.","isDeprecated":false,"deprecationReason":null},{"name":"SCALAR","description":"Location adjacent to a scalar definition.","isDeprecated":false,"deprecationReason":null},{"name":"OBJECT","description":"Location adjacent to an object type definition.","isDeprecated":false,"deprecationReason":null},{"name":"FIELD_DEFINITION","description":"Location adjacent to a field definition.","isDeprecated":false,"deprecationReason":null},{"name":"ARGUMENT_DEFINITION","description":"Location adjacent to an argument definition.","isDeprecated":false,"deprecationReason":null},{"name":"INTERFACE","description":"Location adjacent to an interface definition.","isDeprecated":false,"deprecationReason":null},{"name":"UNION","description":"Location adjacent to a union definition.","isDeprecated":false,"deprecationReason":null},{"name":"ENUM","description":"Location adjacent to an enum definition.","isDeprecated":false,"deprecationReason":null},{"name":"ENUM_VALUE","description":"Location adjacent to an enum value definition.","isDeprecated":false,"deprecationReason":null},{"name":"INPUT_OBJECT","description":"Location adjacent to an input object type definition.","isDeprecated":false,"deprecationReason":null},{"name":"INPUT_FIELD_DEFINITION","description":"Location adjacent to an input object field definition.","isDeprecated":false,"deprecationReason":null}],"possibleTypes":null},{"kind":"OBJECT","name":"Verification","description":"","fields":[{"name":"id","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"target","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"payload","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"key","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"verified","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"createdAt","description":"","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"updatedAt","description":"","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":null}],"directives":[{"name":"skip","description":"Directs the executor to skip this field or fragment when the `if` argument is true.","locations":["FIELD","FRAGMENT_SPREAD","INLINE_FRAGMENT"],"args":[{"name":"if","description":"Skipped when true.","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"defaultValue":null}]},{"name":"include","description":"Directs the executor to include this field or fragment only when the `if` argument is true.","locations":["FIELD","FRAGMENT_SPREAD","INLINE_FRAGMENT"],"args":[{"name":"if","description":"Included when true.","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"defaultValue":null}]},{"name":"deprecated","description":"Marks an element of a GraphQL schema as no longer supported.","locations":["FIELD_DEFINITION","ENUM_VALUE"],"args":[{"name":"reason","description":"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted in [Markdown](https://daringfireball.net/projects/markdown/).","type":{"kind":"SCALAR","name":"String","ofType":null},"defaultValue":"\"No longer supported\""}]}]} -------------------------------------------------------------------------------- /src/Components/AddressBar/AddressBar.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import styled from "../../typed-components"; 3 | 4 | const Container = styled.input` 5 | position: absolute; 6 | background-color: white; 7 | border-radius: 5px; 8 | -webkit-appearance: none; 9 | z-index: 2; 10 | width: 80%; 11 | border: 0; 12 | font-size: 16px; 13 | padding: 15px 10px; 14 | box-shadow: 0 18px 35px rgba(50, 50, 93, 0.1), 0 8px 15px rgba(0, 0, 0, 0.07); 15 | margin: auto; 16 | top: 10px; 17 | left: 0; 18 | right: 0; 19 | height: auto; 20 | `; 21 | 22 | interface IProps { 23 | value: string; 24 | onBlur: any; 25 | name: string; 26 | onChange: (event: React.ChangeEvent) => void; 27 | } 28 | 29 | const AddressBar: React.SFC = ({ value, onBlur, onChange, name }) => ( 30 | 38 | ); 39 | 40 | export default AddressBar; 41 | -------------------------------------------------------------------------------- /src/Components/AddressBar/index.ts: -------------------------------------------------------------------------------- 1 | import AddressBar from "./AddressBar"; 2 | export default AddressBar; 3 | -------------------------------------------------------------------------------- /src/Components/App/AppContainer.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { graphql } from "react-apollo"; 3 | import { ToastContainer } from "react-toastify"; 4 | import "react-toastify/dist/ReactToastify.min.css"; 5 | import theme from "../../theme"; 6 | import { ThemeProvider } from "../../typed-components"; 7 | import AppPresenter from "./AppPresenter"; 8 | import { IS_LOGGED_IN } from "./AppQueries.local"; 9 | 10 | const AppContainer = ({ data }) => ( 11 | 12 | 13 | 14 | 15 | 16 | 17 | ); 18 | 19 | export default graphql(IS_LOGGED_IN)(AppContainer); 20 | -------------------------------------------------------------------------------- /src/Components/App/AppPresenter.tsx: -------------------------------------------------------------------------------- 1 | import PropTypes from "prop-types"; 2 | import React from "react"; 3 | import { BrowserRouter, Redirect, Route, Switch } from "react-router-dom"; 4 | import AddPlace from "../../Routes/AddPlace"; 5 | import Chat from "../../Routes/Chat"; 6 | import EditAccount from "../../Routes/EditAccount"; 7 | import FindAddress from "../../Routes/FindAddress"; 8 | import Home from "../../Routes/Home"; 9 | import Login from "../../Routes/Login"; 10 | import PhoneLogin from "../../Routes/PhoneLogin"; 11 | import Places from "../../Routes/Places"; 12 | import Ride from "../../Routes/Ride"; 13 | import Settings from "../../Routes/Settings"; 14 | import SocialLogin from "../../Routes/SocialLogin"; 15 | import VerifyPhone from "../../Routes/VerifyPhone"; 16 | 17 | interface IProps { 18 | isLoggedIn: boolean; 19 | } 20 | 21 | const AppPresenter: React.SFC = ({ isLoggedIn }) => ( 22 | 23 | {isLoggedIn ? : } 24 | 25 | ); 26 | 27 | const LoggedOutRoutes: React.SFC = () => ( 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | ); 36 | 37 | const LoggedInRoutes: React.SFC = () => ( 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | ); 50 | 51 | AppPresenter.propTypes = { 52 | isLoggedIn: PropTypes.bool.isRequired 53 | }; 54 | 55 | export default AppPresenter; 56 | -------------------------------------------------------------------------------- /src/Components/App/AppQueries.local.ts: -------------------------------------------------------------------------------- 1 | import { gql } from "apollo-boost"; 2 | 3 | export const IS_LOGGED_IN = gql` 4 | { 5 | auth { 6 | isLoggedIn @client 7 | } 8 | } 9 | `; 10 | -------------------------------------------------------------------------------- /src/Components/App/index.ts: -------------------------------------------------------------------------------- 1 | import AppContainer from "./AppContainer"; 2 | export default AppContainer; 3 | -------------------------------------------------------------------------------- /src/Components/BackArrow/BackArrow.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Link } from "react-router-dom"; 3 | import styled from "../../typed-components"; 4 | 5 | const Container = styled.div` 6 | transform: scale(0.8); 7 | `; 8 | 9 | interface IProps { 10 | backTo: string; 11 | className?: string; 12 | } 13 | 14 | const BackArrow: React.SFC = ({ backTo, className }) => ( 15 | 16 | 17 | 24 | 25 | 26 | 27 | 28 | ); 29 | 30 | export default BackArrow; 31 | -------------------------------------------------------------------------------- /src/Components/BackArrow/index.ts: -------------------------------------------------------------------------------- 1 | import BackArrow from "./BackArrow"; 2 | export default BackArrow; 3 | -------------------------------------------------------------------------------- /src/Components/Button/Button.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import styled from "../../typed-components"; 3 | 4 | const Container = styled.input` 5 | width: 100%; 6 | background-color: black; 7 | color: white; 8 | text-transform: uppercase; 9 | padding: 15px 0; 10 | font-size: 16px; 11 | border: 0; 12 | cursor: pointer; 13 | font-weight: 500; 14 | text-align: center; 15 | &:active, 16 | &:focus { 17 | outline: none; 18 | } 19 | &:disabled { 20 | opacity: 0.8; 21 | cursor: not-allowed; 22 | } 23 | `; 24 | 25 | interface IProps { 26 | value: string; 27 | onClick: any; 28 | disabled?: boolean; 29 | className?: string; 30 | } 31 | 32 | const Button: React.SFC = ({ 33 | value, 34 | onClick, 35 | disabled = false, 36 | className 37 | }) => ( 38 | 45 | ); 46 | 47 | export default Button; 48 | -------------------------------------------------------------------------------- /src/Components/Button/index.ts: -------------------------------------------------------------------------------- 1 | import Button from "./Button"; 2 | export default Button; 3 | -------------------------------------------------------------------------------- /src/Components/Form/Form.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | interface IProps { 4 | submitFn: any; 5 | className?: string; 6 | } 7 | 8 | const Form: React.SFC = ({ submitFn, className, children }) => ( 9 |
{ 12 | e.preventDefault(); 13 | submitFn(); 14 | }} 15 | > 16 | {children} 17 |
18 | ); 19 | 20 | export default Form; 21 | -------------------------------------------------------------------------------- /src/Components/Form/index.ts: -------------------------------------------------------------------------------- 1 | import Form from "./Form"; 2 | export default Form; 3 | -------------------------------------------------------------------------------- /src/Components/Header/Header.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import styled from "../../typed-components"; 3 | import BackArrow from "../BackArrow"; 4 | 5 | const Container = styled.header` 6 | background-color: black; 7 | color: white; 8 | display: flex; 9 | height: 50px; 10 | font-size: 20px; 11 | font-weight: 300; 12 | align-items: center; 13 | box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23); 14 | & svg { 15 | fill: white; 16 | } 17 | margin-bottom: 50px; 18 | padding: 0 10px; 19 | `; 20 | 21 | const Title = styled.h2` 22 | margin-left: 10px; 23 | `; 24 | 25 | interface IProps { 26 | title: string; 27 | backTo?: string; 28 | } 29 | 30 | const Header: React.SFC = ({ title, backTo }) => ( 31 | 32 | {backTo && } 33 | {title} 34 | 35 | ); 36 | 37 | export default Header; 38 | -------------------------------------------------------------------------------- /src/Components/Header/index.ts: -------------------------------------------------------------------------------- 1 | import Header from "./Header"; 2 | export default Header; 3 | -------------------------------------------------------------------------------- /src/Components/Input/Input.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import styled from "../../typed-components"; 3 | 4 | const Container = styled.input` 5 | border: none; 6 | border-bottom: 2px solid ${props => props.theme.greyColor}; 7 | font-size: 20px; 8 | width: 100%; 9 | padding-bottom: 10px; 10 | font-weight: 500; 11 | transition: border-bottom 0.1s linear; 12 | &:-webkit-autofill { 13 | box-shadow: 0 0 0px 1000px white inset !important; 14 | } 15 | &:focus { 16 | border-bottom-color: #2c3e50; 17 | outline: none; 18 | } 19 | &::placeholder { 20 | color: ${props => props.theme.greyColor}; 21 | font-weight: 300; 22 | } 23 | `; 24 | 25 | interface IProps { 26 | placeholder?: string; 27 | type?: string; 28 | required?: boolean; 29 | value: string; 30 | name?: string; 31 | onChange: any; 32 | className?: string; 33 | } 34 | 35 | const Input: React.SFC = ({ 36 | placeholder = "", 37 | type = "text", 38 | required = true, 39 | value, 40 | name = "", 41 | onChange, 42 | className 43 | }) => ( 44 | 53 | ); 54 | 55 | export default Input; 56 | -------------------------------------------------------------------------------- /src/Components/Input/index.ts: -------------------------------------------------------------------------------- 1 | import Input from "./Input"; 2 | export default Input; 3 | -------------------------------------------------------------------------------- /src/Components/Menu/MenuContainer.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Mutation, Query } from "react-apollo"; 3 | import { toast } from "react-toastify"; 4 | import { USER_PROFILE } from "../../sharedQueries"; 5 | import { toggleDriving, userProfile } from "../../types/api"; 6 | import MenuPresenter from "./MenuPresenter"; 7 | import { TOGGLE_DRIVING } from "./MenuQueries"; 8 | 9 | class ProfileQuery extends Query {} 10 | class ToggleDrivingMutation extends Mutation {} 11 | 12 | class MenuContainer extends React.Component { 13 | public render() { 14 | return ( 15 | { 18 | if (data) { 19 | const { ToggleDrivingMode } = data; 20 | if (!ToggleDrivingMode.ok) { 21 | toast.error(ToggleDrivingMode.error); 22 | return; 23 | } 24 | const query: userProfile | null = cache.readQuery({ 25 | query: USER_PROFILE 26 | }); 27 | if (query) { 28 | const { 29 | GetMyProfile: { user } 30 | } = query; 31 | if (user) { 32 | user.isDriving = !user.isDriving; 33 | } 34 | } 35 | cache.writeQuery({ query: USER_PROFILE, data: query }); 36 | } 37 | }} 38 | > 39 | {toggleDrivingFn => ( 40 | 41 | {({ data, loading }) => ( 42 | 47 | )} 48 | 49 | )} 50 | 51 | ); 52 | } 53 | } 54 | 55 | export default MenuContainer; 56 | -------------------------------------------------------------------------------- /src/Components/Menu/MenuPresenter.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { MutationFn } from "react-apollo"; 3 | import { Link } from "react-router-dom"; 4 | import styled from "../../typed-components"; 5 | import { toggleDriving, userProfile } from "../../types/api"; 6 | 7 | const Container = styled.div` 8 | height: 100%; 9 | `; 10 | 11 | const Header = styled.div` 12 | background-color: black; 13 | height: 20%; 14 | margin-bottom: 30px; 15 | padding: 0 15px; 16 | color: white; 17 | `; 18 | 19 | const SLink = styled(Link)` 20 | font-size: 22px; 21 | display: block; 22 | margin-left: 15px; 23 | margin-bottom: 25px; 24 | font-weight: 400; 25 | `; 26 | 27 | const Image = styled.img` 28 | height: 80px; 29 | width: 80px; 30 | background-color: grey; 31 | border-radius: 40px; 32 | overflow: hidden; 33 | `; 34 | 35 | const Name = styled.h2` 36 | font-size: 22px; 37 | color: white; 38 | margin-bottom: 10px; 39 | white-space: nowrap; 40 | overflow: hidden; 41 | text-overflow: ellipsis; 42 | `; 43 | 44 | const Rating = styled.h5` 45 | font-size: 18px; 46 | color: white; 47 | `; 48 | 49 | const Text = styled.span` 50 | text-overflow: ellipsis; 51 | white-space: nowrap; 52 | overflow: hidden; 53 | `; 54 | 55 | const Grid = styled.div` 56 | display: grid; 57 | grid-template-columns: 1fr 2fr; 58 | grid-gap: 10px; 59 | height: 100%; 60 | align-items: center; 61 | `; 62 | 63 | interface IToggleProps { 64 | isDriving: boolean; 65 | } 66 | 67 | const ToggleDriving = styled("button")` 68 | -webkit-appearance: none; 69 | background-color: ${props => 70 | props.isDriving ? props.theme.yellowColor : props.theme.greenColor}; 71 | width: 100%; 72 | color: white; 73 | font-size: 18px; 74 | border: 0; 75 | padding: 15px 0px; 76 | cursor: pointer; 77 | `; 78 | 79 | interface IProps { 80 | data?: userProfile; 81 | loading: boolean; 82 | toggleDrivingFn: MutationFn; 83 | } 84 | 85 | const MenuPresenter: React.SFC = ({ 86 | data: { GetMyProfile: { user = null } = {} } = {}, 87 | loading, 88 | toggleDrivingFn 89 | }) => ( 90 | 91 | {!loading && 92 | user && 93 | user.fullName && ( 94 | 95 |
96 | 97 | 98 | 104 | 105 | 106 | {user.fullName} 107 | 4.5 108 | 109 | 110 |
111 | Your Trips 112 | Settings 113 | 114 | {user.isDriving ? "Stop driving" : "Start driving"} 115 | 116 |
117 | )} 118 |
119 | ); 120 | 121 | export default MenuPresenter; 122 | -------------------------------------------------------------------------------- /src/Components/Menu/MenuQueries.ts: -------------------------------------------------------------------------------- 1 | import { gql } from "apollo-boost"; 2 | 3 | export const TOGGLE_DRIVING = gql` 4 | mutation toggleDriving { 5 | ToggleDrivingMode { 6 | ok 7 | error 8 | } 9 | } 10 | `; 11 | -------------------------------------------------------------------------------- /src/Components/Menu/index.ts: -------------------------------------------------------------------------------- 1 | import MenuContainer from "./MenuContainer"; 2 | export default MenuContainer; 3 | -------------------------------------------------------------------------------- /src/Components/Message/Message.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import styled from "../../typed-components"; 3 | 4 | const Container = styled<{ mine: boolean }, any>("div")` 5 | background-color: ${props => 6 | props.mine ? props.theme.blueColor : props.theme.greyColor}; 7 | color: white; 8 | padding: 10px 20px; 9 | border-radius: 20px; 10 | align-self: ${props => (props.mine ? "flex-end" : "flex-start")}; 11 | border-bottom-right-radius: ${props => (props.mine ? "0px" : "20px")}; 12 | border-bottom-left-radius: ${props => (!props.mine ? "0px" : "20px")}; 13 | margin-bottom: 10px; 14 | `; 15 | 16 | interface IProps { 17 | text: string; 18 | mine: boolean; 19 | } 20 | 21 | const Message: React.SFC = ({ text, mine }) => ( 22 | {text} 23 | ); 24 | 25 | export default Message; 26 | -------------------------------------------------------------------------------- /src/Components/Message/index.ts: -------------------------------------------------------------------------------- 1 | import Message from "./Message"; 2 | export default Message; 3 | -------------------------------------------------------------------------------- /src/Components/PhotoInput/PhotoInput.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import styled from "../../typed-components"; 3 | 4 | const Container = styled.div``; 5 | 6 | const Image = styled.label` 7 | cursor: pointer; 8 | height: 80px; 9 | width: 80px; 10 | border: 2px solid black; 11 | display: block; 12 | border-radius: 50%; 13 | margin-bottom: 35px; 14 | display: flex; 15 | align-items: center; 16 | justify-content: center; 17 | font-size: 28px; 18 | overflow: hidden; 19 | & img { 20 | width: 80px; 21 | height: 80px; 22 | } 23 | `; 24 | 25 | const Input = styled.input` 26 | color: white; 27 | opacity: 0; 28 | height: 1px; 29 | &:focus { 30 | outline: none; 31 | } 32 | `; 33 | 34 | interface IProps { 35 | uploading: boolean; 36 | fileUrl: string; 37 | onChange: (event: React.ChangeEvent) => void; 38 | } 39 | 40 | const PhotoInput: React.SFC = ({ uploading, fileUrl, onChange }) => ( 41 | 42 | 43 | 44 | {uploading && "⏰"} 45 | {!uploading && } 46 | 47 | 48 | ); 49 | 50 | export default PhotoInput; 51 | -------------------------------------------------------------------------------- /src/Components/PhotoInput/index.ts: -------------------------------------------------------------------------------- 1 | import PhotoInput from "./PhotoInput"; 2 | export default PhotoInput; 3 | -------------------------------------------------------------------------------- /src/Components/Place/PlaceContainer.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Mutation } from "react-apollo"; 3 | import { GET_PLACES } from "../../sharedQueries"; 4 | import { editPlace, editPlaceVariables } from "../../types/api"; 5 | import PlacePresenter from "./PlacePresenter"; 6 | import { EDIT_PLACE } from "./PlaceQueries"; 7 | 8 | interface IProps { 9 | fav: boolean; 10 | name: string; 11 | address: string; 12 | id: number; 13 | } 14 | 15 | class FavMutation extends Mutation {} 16 | 17 | class PlaceContainer extends React.Component { 18 | public render() { 19 | const { id, fav, name, address } = this.props; 20 | return ( 21 | 29 | {editPlaceFn => ( 30 | 36 | )} 37 | 38 | ); 39 | } 40 | } 41 | 42 | export default PlaceContainer; 43 | -------------------------------------------------------------------------------- /src/Components/Place/PlacePresenter.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { MutationFn } from "react-apollo"; 3 | import styled from "../../typed-components"; 4 | 5 | const Place = styled.div` 6 | margin: 15px 0; 7 | display: flex; 8 | align-items: center; 9 | & i { 10 | font-size: 12px; 11 | } 12 | `; 13 | 14 | const Container = styled.div` 15 | margin-left: 10px; 16 | `; 17 | 18 | const Name = styled.span` 19 | display: block; 20 | `; 21 | 22 | const Icon = styled.span` 23 | cursor: pointer; 24 | `; 25 | 26 | const Address = styled.span` 27 | color: ${props => props.theme.greyColor}; 28 | font-size: 14px; 29 | `; 30 | 31 | interface IProps { 32 | fav: boolean; 33 | name: string; 34 | address: string; 35 | onStarPress: MutationFn; 36 | } 37 | 38 | const PlacePresenter: React.SFC = ({ 39 | onStarPress, 40 | fav, 41 | name, 42 | address 43 | }) => ( 44 | 45 | {fav ? "★" : "✩"} 46 | 47 | {name} 48 |
{address}
49 |
50 |
51 | ); 52 | 53 | export default PlacePresenter; 54 | -------------------------------------------------------------------------------- /src/Components/Place/PlaceQueries.ts: -------------------------------------------------------------------------------- 1 | import { gql } from "apollo-boost"; 2 | 3 | export const EDIT_PLACE = gql` 4 | mutation editPlace($placeId: Int!, $isFav: Boolean) { 5 | EditPlace(placeId: $placeId, isFav: $isFav) { 6 | ok 7 | error 8 | } 9 | } 10 | `; 11 | -------------------------------------------------------------------------------- /src/Components/Place/index.ts: -------------------------------------------------------------------------------- 1 | import PlaceContainer from "./PlaceContainer"; 2 | export default PlaceContainer; 3 | -------------------------------------------------------------------------------- /src/Components/RidePopUp/RidePopUp.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import styled from "../../typed-components"; 3 | import Button from "../Button"; 4 | 5 | interface IProps { 6 | pickUpAddress: string; 7 | dropOffAddress: string; 8 | price: number; 9 | distance: string; 10 | passengerName: string; 11 | passengerPhoto: string; 12 | acceptRideFn: any; 13 | id: number; 14 | } 15 | 16 | const Container = styled.div` 17 | background-color: white; 18 | position: absolute; 19 | margin: auto; 20 | top: 0; 21 | bottom: 0; 22 | left: 0; 23 | right: 0; 24 | width: 80%; 25 | height: 60%; 26 | z-index: 9; 27 | padding: 20px; 28 | `; 29 | 30 | const Title = styled.h4` 31 | font-weight: 800; 32 | margin-top: 30px; 33 | margin-bottom: 10px; 34 | &:first-child { 35 | margin-top: 0; 36 | } 37 | `; 38 | 39 | const Data = styled.span` 40 | color: ${props => props.theme.blueColor}; 41 | `; 42 | 43 | const Img = styled.img` 44 | border-radius: 50%; 45 | margin-right: 20px; 46 | `; 47 | 48 | const Passenger = styled.div` 49 | display: flex; 50 | align-items: center; 51 | margin-bottom: 20px; 52 | `; 53 | 54 | const RidePopUp: React.SFC = ({ 55 | pickUpAddress, 56 | dropOffAddress, 57 | price, 58 | distance, 59 | passengerName, 60 | passengerPhoto, 61 | acceptRideFn, 62 | id 63 | }) => ( 64 | 65 | Pick Up Address 66 | {pickUpAddress} 67 | Drop Off Address 68 | {dropOffAddress} 69 | Price 70 | {price} 71 | Distance 72 | {distance} 73 | Distance 74 | {distance} 75 | Passenger: 76 | 77 | 78 | {passengerName} 79 | 80 | 120 | 121 | 122 | ); 123 | 124 | export default PhoneLoginPresenter; 125 | -------------------------------------------------------------------------------- /src/Routes/PhoneLogin/PhoneQueries.ts: -------------------------------------------------------------------------------- 1 | import { gql } from "apollo-boost"; 2 | 3 | export const PHONE_SIGN_IN = gql` 4 | mutation startPhoneVerification($phoneNumber: String!) { 5 | StartPhoneVerification(phoneNumber: $phoneNumber) { 6 | ok 7 | error 8 | } 9 | } 10 | `; 11 | -------------------------------------------------------------------------------- /src/Routes/PhoneLogin/index.tsx: -------------------------------------------------------------------------------- 1 | import PhoneLoginContainer from "./PhoneLoginContainer"; 2 | export default PhoneLoginContainer; 3 | -------------------------------------------------------------------------------- /src/Routes/Places/PlacesContainer.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Query } from "react-apollo"; 3 | import { GET_PLACES } from "../../sharedQueries"; 4 | import { getPlaces } from "../../types/api"; 5 | import PlacesPresenter from "./PlacesPresenter"; 6 | 7 | class PlacesQuery extends Query {} 8 | 9 | class PlacesContainer extends React.Component { 10 | public render() { 11 | return ( 12 | 13 | {({ data, loading }) => ( 14 | 15 | )} 16 | 17 | ); 18 | } 19 | } 20 | export default PlacesContainer; 21 | -------------------------------------------------------------------------------- /src/Routes/Places/PlacesPresenter.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import Helmet from "react-helmet"; 3 | import { Link } from "react-router-dom"; 4 | import Header from "../../Components/Header"; 5 | import Place from "../../Components/Place"; 6 | import styled from "../../typed-components"; 7 | import { getPlaces } from "../../types/api"; 8 | 9 | const Container = styled.div` 10 | padding: 0 40px; 11 | `; 12 | 13 | const SLink = styled(Link)` 14 | text-decoration: underline; 15 | `; 16 | 17 | interface IProps { 18 | data?: getPlaces; 19 | loading: boolean; 20 | } 21 | 22 | const PlacesPresenter: React.SFC = ({ 23 | data: { GetMyPlaces: { places = null } = {} } = {}, 24 | loading 25 | }) => ( 26 | 27 | 28 | Places | Number 29 | 30 |
31 | 32 | {!loading && places && places.length === 0 && "You have no places"} 33 | {!loading && 34 | places && 35 | places.map(place => ( 36 | 43 | ))} 44 | Add some places! 45 | 46 | 47 | ); 48 | 49 | export default PlacesPresenter; 50 | -------------------------------------------------------------------------------- /src/Routes/Places/index.tsx: -------------------------------------------------------------------------------- 1 | import PlacesContainer from "./PlacesContainer"; 2 | export default PlacesContainer; 3 | -------------------------------------------------------------------------------- /src/Routes/Ride/RideContainer.tsx: -------------------------------------------------------------------------------- 1 | import { SubscribeToMoreOptions } from "apollo-client"; 2 | import React from "react"; 3 | import { Mutation, Query } from "react-apollo"; 4 | import { RouteComponentProps } from "react-router-dom"; 5 | import { USER_PROFILE } from "../../sharedQueries"; 6 | import { 7 | getRide, 8 | getRideVariables, 9 | updateRide, 10 | updateRideVariables, 11 | userProfile 12 | } from "../../types/api"; 13 | import RidePresenter from "./RidePresenter"; 14 | import { GET_RIDE, RIDE_SUBSCRIPTION, UPDATE_RIDE_STATUS } from "./RideQueries"; 15 | 16 | class RideQuery extends Query {} 17 | class ProfileQuery extends Query {} 18 | class RideUpdate extends Mutation {} 19 | 20 | interface IProps extends RouteComponentProps {} 21 | 22 | class RideContainer extends React.Component { 23 | constructor(props: IProps) { 24 | super(props); 25 | if (!props.match.params.rideId) { 26 | props.history.push("/"); 27 | } 28 | } 29 | public render() { 30 | const { 31 | match: { 32 | params: { rideId } 33 | } 34 | } = this.props; 35 | return ( 36 | 37 | {({ data: userData }) => ( 38 | 39 | {({ data, loading, subscribeToMore }) => { 40 | const subscribeOptions: SubscribeToMoreOptions = { 41 | document: RIDE_SUBSCRIPTION, 42 | updateQuery: (prev, { subscriptionData }) => { 43 | if (!subscriptionData.data) { 44 | return prev; 45 | } 46 | const { 47 | data: { 48 | RideStatusSubscription: { status } 49 | } 50 | } = subscriptionData; 51 | if (status === "FINISHED") { 52 | window.location.href = "/"; 53 | } 54 | } 55 | }; 56 | subscribeToMore(subscribeOptions); 57 | return ( 58 | 59 | {updateRideFn => ( 60 | 66 | )} 67 | 68 | ); 69 | }} 70 | 71 | )} 72 | 73 | ); 74 | } 75 | } 76 | export default RideContainer; 77 | -------------------------------------------------------------------------------- /src/Routes/Ride/RidePresenter.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { MutationFn } from "react-apollo"; 3 | import { Link } from "react-router-dom"; 4 | import Button from "../../Components/Button"; 5 | import styled from "../../typed-components"; 6 | import { getRide, userProfile } from "../../types/api"; 7 | 8 | const Container = styled.div` 9 | padding: 40px; 10 | `; 11 | 12 | const Title = styled.h4` 13 | font-weight: 800; 14 | margin-top: 30px; 15 | margin-bottom: 10px; 16 | &:first-child { 17 | margin-top: 0; 18 | } 19 | `; 20 | 21 | const Data = styled.span` 22 | color: ${props => props.theme.blueColor}; 23 | `; 24 | 25 | const Img = styled.img` 26 | border-radius: 50%; 27 | margin-right: 20px; 28 | max-width: 50px; 29 | height: 50px; 30 | `; 31 | 32 | const Passenger = styled.div` 33 | display: flex; 34 | align-items: center; 35 | margin-bottom: 20px; 36 | `; 37 | 38 | const Buttons = styled.div` 39 | margin: 30px 0px; 40 | `; 41 | 42 | const ExtendedButton = styled(Button)` 43 | margin-bottom: 30px; 44 | `; 45 | 46 | interface IProps { 47 | data?: getRide; 48 | userData?: userProfile; 49 | loading: boolean; 50 | updateRideFn: MutationFn; 51 | } 52 | 53 | const RidePresenter: React.SFC = ({ 54 | data: { GetRide: { ride = null } = {} } = {}, 55 | userData: { GetMyProfile: { user = null } = {} } = {}, 56 | updateRideFn 57 | }) => ( 58 | 59 | {ride && 60 | user && ( 61 | 62 | Passenger 63 | 64 | 65 | {ride.passenger.fullName!} 66 | 67 | {ride.driver && ( 68 | 69 | Driver 70 | 71 | 72 | {ride.driver.fullName!} 73 | 74 | 75 | )} 76 | From 77 | {ride.pickUpAddress} 78 | To 79 | {ride.dropOffAddress} 80 | Price 81 | {ride.price} 82 | Distance 83 | {ride.distance} 84 | Duration 85 | {ride.duration} 86 | Status 87 | {ride.status} 88 | 89 | {ride.driver && 90 | ride.driver.id === user.id && 91 | ride.status === "ACCEPTED" && ( 92 | 95 | updateRideFn({ 96 | variables: { 97 | rideId: ride.id, 98 | status: "ONROUTE" 99 | } 100 | }) 101 | } 102 | /> 103 | )} 104 | {ride.driver && 105 | ride.driver.id === user.id && 106 | ride.status === "ONROUTE" && ( 107 | 110 | updateRideFn({ 111 | variables: { 112 | rideId: ride.id, 113 | status: "FINISHED" 114 | } 115 | }) 116 | } 117 | /> 118 | )} 119 | 120 | {ride.status !== "REQUESTING" && ( 121 | 122 | 123 | 124 | )} 125 | 126 | 127 | )} 128 | 129 | ); 130 | 131 | export default RidePresenter; 132 | -------------------------------------------------------------------------------- /src/Routes/Ride/RideQueries.ts: -------------------------------------------------------------------------------- 1 | import { gql } from "apollo-boost"; 2 | 3 | export const GET_RIDE = gql` 4 | query getRide($rideId: Int!) { 5 | GetRide(rideId: $rideId) { 6 | ok 7 | error 8 | ride { 9 | id 10 | status 11 | pickUpAddress 12 | dropOffAddress 13 | price 14 | distance 15 | duration 16 | driver { 17 | id 18 | fullName 19 | profilePhoto 20 | } 21 | passenger { 22 | id 23 | fullName 24 | profilePhoto 25 | } 26 | chatId 27 | } 28 | } 29 | } 30 | `; 31 | 32 | export const RIDE_SUBSCRIPTION = gql` 33 | subscription rideUpdates { 34 | RideStatusSubscription { 35 | id 36 | status 37 | pickUpAddress 38 | dropOffAddress 39 | price 40 | distance 41 | duration 42 | driver { 43 | id 44 | fullName 45 | profilePhoto 46 | } 47 | passenger { 48 | id 49 | fullName 50 | profilePhoto 51 | } 52 | chatId 53 | } 54 | } 55 | `; 56 | 57 | export const UPDATE_RIDE_STATUS = gql` 58 | mutation updateRide($rideId: Int!, $status: StatusOptions!) { 59 | UpdateRideStatus(rideId: $rideId, status: $status) { 60 | ok 61 | error 62 | rideId 63 | } 64 | } 65 | `; 66 | -------------------------------------------------------------------------------- /src/Routes/Ride/index.tsx: -------------------------------------------------------------------------------- 1 | import RideContainer from "./RideContainer"; 2 | export default RideContainer; 3 | -------------------------------------------------------------------------------- /src/Routes/Settings/SettingsContainer.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Mutation, Query } from "react-apollo"; 3 | import { GET_PLACES, USER_PROFILE } from "../../sharedQueries"; 4 | import { LOG_USER_OUT } from "../../sharedQueries.local"; 5 | import { getPlaces, userProfile } from "../../types/api"; 6 | import SettingsPresenter from "./SettingsPresenter"; 7 | 8 | class MiniProfileQuery extends Query {} 9 | class PlacesQuery extends Query {} 10 | 11 | class SettingsContainer extends React.Component { 12 | public render() { 13 | return ( 14 | 15 | {logUserOut => ( 16 | 17 | {({ data: userData, loading: userDataLoading }) => ( 18 | 19 | {({ data: placesData, loading: placesLoading }) => ( 20 | 27 | )} 28 | 29 | )} 30 | 31 | )} 32 | 33 | ); 34 | } 35 | } 36 | 37 | export default SettingsContainer; 38 | -------------------------------------------------------------------------------- /src/Routes/Settings/SettingsPresenter.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { MutationFn } from "react-apollo"; 3 | import Helmet from "react-helmet"; 4 | import { Link } from "react-router-dom"; 5 | import Header from "../../Components/Header"; 6 | import Place from "../../Components/Place"; 7 | import styled from "../../typed-components"; 8 | import { getPlaces, userProfile } from "../../types/api"; 9 | 10 | const Container = styled.div` 11 | padding: 0px 40px; 12 | `; 13 | 14 | const Image = styled.img` 15 | height: 60px; 16 | width: 60px; 17 | border-radius: 50%; 18 | `; 19 | 20 | const GridLink = styled(Link)` 21 | display: grid; 22 | grid-template-columns: 1fr 4fr; 23 | grid-gap: 10px; 24 | margin-bottom: 10px; 25 | `; 26 | 27 | const Keys = styled.div``; 28 | 29 | const Key = styled.span` 30 | display: block; 31 | margin-bottom: 5px; 32 | `; 33 | 34 | const FakeLink = styled.span` 35 | text-decoration: underline; 36 | cursor: pointer; 37 | `; 38 | 39 | const SLink = styled(Link)` 40 | display: block; 41 | text-decoration: underline; 42 | margin: 20px 0px; 43 | `; 44 | 45 | interface IProps { 46 | logUserOut: MutationFn; 47 | userData?: userProfile; 48 | placesData?: getPlaces; 49 | userDataLoading: boolean; 50 | placesLoading: boolean; 51 | } 52 | 53 | const SettingsPresenter: React.SFC = ({ 54 | logUserOut, 55 | userData: { GetMyProfile: { user = null } = {} } = {}, 56 | placesData: { GetMyPlaces: { places = null } = {} } = {}, 57 | userDataLoading, 58 | placesLoading 59 | }) => ( 60 | 61 | 62 | Settings | Nuber 63 | 64 |
65 | 66 | 67 | {!userDataLoading && 68 | user && 69 | user.profilePhoto && 70 | user.email && 71 | user.fullName && ( 72 | 73 | 74 | 75 | {user.fullName} 76 | {user.email} 77 | 78 | 79 | )} 80 | 81 | {!placesLoading && 82 | places && 83 | places.map(place => ( 84 | 91 | ))} 92 | Go to Places 93 | Log Out 94 | 95 | 96 | ); 97 | 98 | export default SettingsPresenter; 99 | -------------------------------------------------------------------------------- /src/Routes/Settings/index.tsx: -------------------------------------------------------------------------------- 1 | import SettingsContainer from "./SettingsContainer"; 2 | export default SettingsContainer; 3 | -------------------------------------------------------------------------------- /src/Routes/SocialLogin/SocialLoginContainer.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Mutation, MutationFn } from "react-apollo"; 3 | import { RouteComponentProps } from "react-router-dom"; 4 | import { toast } from "react-toastify"; 5 | import { LOG_USER_IN } from "../../sharedQueries.local"; 6 | import { facebookConnect, facebookConnectVariables } from "../../types/api"; 7 | import SocialLoginPresenter from "./SocialLoginPresenter"; 8 | import { FACEBOOK_CONNECT } from "./SocialLoginQueries"; 9 | 10 | class LoginMutation extends Mutation< 11 | facebookConnect, 12 | facebookConnectVariables 13 | > {} 14 | 15 | interface IState { 16 | firstName: string; 17 | lastName: string; 18 | email?: string; 19 | fbId: string; 20 | } 21 | 22 | interface IProps extends RouteComponentProps {} 23 | 24 | class SocialLoginContainer extends React.Component { 25 | public state = { 26 | email: "", 27 | fbId: "", 28 | firstName: "", 29 | lastName: "" 30 | }; 31 | public facebookMutation: MutationFn; 32 | public render() { 33 | return ( 34 | 35 | {logUserIn => ( 36 | { 39 | const { FacebookConnect } = data; 40 | if (FacebookConnect.ok) { 41 | logUserIn({ 42 | variables: { 43 | token: FacebookConnect.token 44 | } 45 | }); 46 | } else { 47 | toast.error(FacebookConnect.error); 48 | } 49 | }} 50 | > 51 | {(facebookMutation, { loading }) => { 52 | this.facebookMutation = facebookMutation; 53 | return ( 54 | 55 | ); 56 | }} 57 | 58 | )} 59 | 60 | ); 61 | } 62 | 63 | public loginCallback = response => { 64 | const { name, first_name, last_name, email, id, accessToken } = response; 65 | if (accessToken) { 66 | toast.success(`Welcome ${name}!`); 67 | this.facebookMutation({ 68 | variables: { 69 | email, 70 | fbId: id, 71 | firstName: first_name, 72 | lastName: last_name 73 | } 74 | }); 75 | } else { 76 | toast.error("Could not log you in 😔"); 77 | } 78 | }; 79 | } 80 | 81 | export default SocialLoginContainer; 82 | -------------------------------------------------------------------------------- /src/Routes/SocialLogin/SocialLoginPresenter.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import FacebookLogin from "react-facebook-login/dist/facebook-login-render-props"; 3 | import Helmet from "react-helmet"; 4 | import BackArrow from "../../Components/BackArrow"; 5 | import styled from "../../typed-components"; 6 | 7 | const Container = styled.div` 8 | margin-top: 30px; 9 | padding: 50px 20px; 10 | `; 11 | 12 | const Title = styled.h2` 13 | font-size: 25px; 14 | margin-bottom: 40px; 15 | `; 16 | 17 | const Link = styled.span` 18 | display: flex; 19 | align-items: center; 20 | cursor: pointer; 21 | `; 22 | 23 | const Icon = styled.span` 24 | margin-right: 10px; 25 | `; 26 | 27 | const BackArrowExtended = styled(BackArrow)` 28 | position: absolute; 29 | top: 20px; 30 | left: 20px; 31 | `; 32 | 33 | interface IProps { 34 | loginCallback: (response) => void; 35 | } 36 | 37 | const SocialLoginPresenter: React.SFC = ({ loginCallback }) => ( 38 | 39 | 40 | Social Login | Nuber 41 | 42 | Choose an account 43 | 44 | ( 50 | 51 | 52 | 59 | 60 | 61 | 62 | Facebook 63 | 64 | )} 65 | /> 66 | 67 | ); 68 | 69 | export default SocialLoginPresenter; 70 | -------------------------------------------------------------------------------- /src/Routes/SocialLogin/SocialLoginQueries.ts: -------------------------------------------------------------------------------- 1 | import { gql } from "apollo-boost"; 2 | 3 | export const FACEBOOK_CONNECT = gql` 4 | mutation facebookConnect( 5 | $firstName: String! 6 | $lastName: String! 7 | $email: String 8 | $fbId: String! 9 | ) { 10 | FacebookConnect( 11 | firstName: $firstName 12 | lastName: $lastName 13 | email: $email 14 | fbId: $fbId 15 | ) { 16 | ok 17 | error 18 | token 19 | } 20 | } 21 | `; 22 | -------------------------------------------------------------------------------- /src/Routes/SocialLogin/index.tsx: -------------------------------------------------------------------------------- 1 | import SocialLoginContainer from "./SocialLoginContainer"; 2 | export default SocialLoginContainer; 3 | -------------------------------------------------------------------------------- /src/Routes/VerifyPhone/VerifyPhoneContainer.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Mutation } from "react-apollo"; 3 | import { RouteComponentProps } from "react-router-dom"; 4 | import { toast } from "react-toastify"; 5 | import { LOG_USER_IN } from "../../sharedQueries.local"; 6 | import { verifyPhone, verifyPhoneVariables } from "../../types/api"; 7 | import VerifyPhonePresenter from "./VerifyPhonePresenter"; 8 | import { VERIFY_PHONE } from "./VerifyPhoneQueries"; 9 | 10 | interface IState { 11 | verificationKey: string; 12 | phoneNumber: string; 13 | } 14 | 15 | interface IProps extends RouteComponentProps {} 16 | 17 | class VerifyMutation extends Mutation {} 18 | 19 | class VerifyPhoneContainer extends React.Component { 20 | constructor(props: IProps) { 21 | super(props); 22 | if (!props.location.state) { 23 | props.history.push("/"); 24 | } 25 | this.state = { 26 | phoneNumber: props.location.state.phone, 27 | verificationKey: "" 28 | }; 29 | } 30 | public render() { 31 | const { verificationKey, phoneNumber } = this.state; 32 | return ( 33 | 34 | {logUserIn => ( 35 | { 42 | const { CompletePhoneVerification } = data; 43 | if (CompletePhoneVerification.ok) { 44 | if (CompletePhoneVerification.token) { 45 | logUserIn({ 46 | variables: { 47 | token: CompletePhoneVerification.token 48 | } 49 | }); 50 | } 51 | toast.success("You're verified, loggin in now"); 52 | } else { 53 | toast.error(CompletePhoneVerification.error); 54 | } 55 | }} 56 | > 57 | {(mutation, { loading }) => ( 58 | 64 | )} 65 | 66 | )} 67 | 68 | ); 69 | } 70 | 71 | public onInputChange: React.ChangeEventHandler = event => { 72 | const { 73 | target: { name, value } 74 | } = event; 75 | this.setState({ 76 | [name]: value 77 | } as any); 78 | }; 79 | } 80 | 81 | export default VerifyPhoneContainer; 82 | -------------------------------------------------------------------------------- /src/Routes/VerifyPhone/VerifyPhonePresenter.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { MutationFn } from "react-apollo"; 3 | import Helmet from "react-helmet"; 4 | import Button from "../../Components/Button"; 5 | import Form from "../../Components/Form"; 6 | import Header from "../../Components/Header"; 7 | import Input from "../../Components/Input"; 8 | import styled from "../../typed-components"; 9 | 10 | const Container = styled.div``; 11 | 12 | const ExtendedForm = styled(Form)` 13 | padding: 0px 40px; 14 | `; 15 | 16 | const ExtendedInput = styled(Input)` 17 | margin-bottom: 20px; 18 | `; 19 | 20 | interface IProps { 21 | verificationKey: string; 22 | onChange: (event: React.ChangeEvent) => void; 23 | onSubmit: MutationFn; 24 | loading: boolean; 25 | } 26 | 27 | const VerifyPhonePresenter: React.SFC = ({ 28 | verificationKey, 29 | onChange, 30 | onSubmit, 31 | loading 32 | }) => ( 33 | 34 | 35 | Verify Phone | Number 36 | 37 |
38 | 39 | 45 |