1.0.4 • Published 7 years ago

rev-exchange v1.0.4

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

rev-exchange

rev-exchange is a simple React component for exchange currency.

It fetches rates from https://openexchangerates.org/.

demo

Install

npm:

npm install rev-exchange --save

yarn:

yarn add rev-exchange

Usage

const props = {
  openexchangeratesAppId: 'your-app-id',
  styles: true,
  colorStart: '#2978f7',
  colorStop: '#0a3cb9',
  width: 300,
  height: 350,
  baseFontSize: 16,
  syncInterval: 0,
  from: 'usd',
  to: 'gbp',
  wallet: {
    usd: 10,
    gbp: 15,
    eur: 20,
  },
  available: ['usd', 'gbp'],
  onChangeState: state => console.log(state),
  onClickRates: state => alert('onClickRates: ' + state.rate),
  onCancel: state => alert('onCancel: ' + state.rate),
  onExchange: state => alert('onExchange: ' + state.rate),
};

<RevExchange {...props} />