Revolut frontend test case based on demo video.
git clone https://github.com/luixo/revolut-test-case-frontend.git
Checkout revolut-test-case-frontend and run yarn install && npm start
, then visit http://localhost:5000
.
To run real requests to openexchangerates.org create an .env
file with given content. To switch back to fake requesting delete the NOVE_ENV
variable or put development
in it.
OPENEX_API_KEY=ffffffffffffffffffffffffffffffFf
NODE_ENV=production
Run npm run build
from the project directory, copy dist
contents to your project and import Widget from '..somepath/Widget'
. You can use Widget
as a React component.
Property | Type | Description |
---|---|---|
apiKey | string | A key to Open Exchange Rates API |
user | object({ cash: [{ code:String, amount:Number },..], favourites: [{ from:String, to:String },..]) |
Initializing user object |
onChangeCash | function({ code:String, amount:Number }) |
Invoked with argument as object describing new amount of user wallet with given code. |
onChangeFavourites | function({ from:String, to: String }, index:Number) |
Invoked with first argument describing new favourites pair and index as second argument |
onExit | function | Invoked on exit from widget or successful exchange, without arguments |