# react-uber-rides-estimates

> React Component to get Uber Rides Estimates

Latest version **0.1.9** (published 2018-04-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-uber-rides-estimates
pnpm add react-uber-rides-estimates
yarn add react-uber-rides-estimates
bun add react-uber-rides-estimates
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.9 |
| Published | 2018-04-20 |
| First published | 2018-01-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 10.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Zain Sajjad |
| Maintainers | zsajjad |
| Keywords | react-native, react, uber, estimates, rides, price, time |

## Links

- npm: https://www.npmjs.com/package/react-uber-rides-estimates
- Repository: https://github.com/zsajjad/react-uber-rides-estimates
- Issues: https://github.com/zsajjad/react-uber-rides-estimates/issues
- npm.io page: https://npm.io/package/react-uber-rides-estimates

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.1.9 (latest) — 2018-04-20
- 0.1.8 — 2018-04-19
- 0.1.7 — 2018-04-16
- 0.1.6 — 2018-04-10
- 0.1.5 — 2018-04-05
- 0.1.4 — 2018-04-05
- 0.1.3 — 2018-01-12
- 0.1.2 — 2018-01-12

## README

# React UBER Rides Estimates

> React Higher Order Component to get Uber Rides Estimates

### This is not the wrapper for [UBER Rides SDK Native Solution](https://developer.uber.com/docs/riders/ride-requests/introduction). Please refer to [React Native UBER Rides](https://github.com/Kureev/react-native-uber-rides) for native solution.

## Install

```
npm install react-uber-rides-estimates
```

## How to use

```js
import React, { Component } from "react";

import {
  AppRegistry,
  StyleSheet,
  Text,
  View,
  ActivityIndicator,
  TouchableOpacity
} from "react-native";

import UberButton from "react-uber-rides-estimates";

export default class TestingApp extends Component {
  render() {
    return (
      <View style={styles.container}>
        <UberButton
          clientId="your.uber.client.id"
          serverToken="your.uber.server.token"
        >
          {uberRides => {
            if (uberRides.loading) {
              return <ActivityIndicator />;
            }
            if (uberRides.priceEstimate) {
              return <Text>{JSON.stringify(uberRides.priceEstimate)}</Text>;
            }
            if (uberRides.timeEstimate) {
              return <Text>{JSON.stringify(uberRides.timeEstimate)}</Text>;
            }
            return (
              <TouchableOpacity
                onPress={() =>
                  uberRides.getPriceEstimate({
                    pickupLocation: {
                      lat: 37.775304,
                      long: -122.417522,
                      nickname: "Uber HQ",
                      formattedAddress: "1455 Market Street, San Francisco"
                    },
                    dropoffLocation: {
                      lat: 37.795079,
                      long: -122.4397805,
                      nickname: "Embarcadero",
                      formattedAddress: "One Embarcadero Center, San Francisco"
                    }
                  })
                }
              >
                <View>
                  <Text>Ride with UBER</Text>
                </View>
              </TouchableOpacity>
            );
          }}
        </UberButton>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: "center",
    alignItems: "center",
    backgroundColor: "#F5FCFF"
  }
});

AppRegistry.registerComponent("TestingApp", () => TestingApp);
```

### API

documentation coming soon

### Follow me on Twitter: [@zsajjad93](https://twitter.com/zsajjad93)

---
_Source: https://npm.io/package/react-uber-rides-estimates · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
