MyCrypto/common/components/ui/SimpleDropdown.jsx
Daniel Ternyak a66337ac0a Swap Part 4 (#101)
### Re-implements:
* min/max validators on initial currency swap selection
* polling of order status
* timer that persists across refreshes via localStorage (computed based on `createdTime` and `validFor` amount)
* swap persists across refreshes once order is created.
* various type refactors

### New additions:
* *SimpleButton* (can be PRd separately on request)
* clear loading state after order create (via SimpleButton and font-awesome)
* buffers for non-BTC swaps (bity does not actually accept 0.01 BTC worth of ETH as they claim they do in their JSON response, so a magic number of 10% is added to the minimum).
2017-07-31 18:14:30 -05:00

33 lines
712 B
JavaScript

// @flow
import React, { Component } from 'react';
type Props<T> = {
value?: T,
options: Array<T>,
onChange: (event: SyntheticInputEvent) => void
};
export default class SimpleDropDown<T: *> extends Component {
props: Props<T>;
render() {
return (
<span className="dropdown">
<select
value={this.props.value || this.props.options[0]}
className="btn btn-default dropdown-toggle"
onChange={this.props.onChange}
>
{this.props.options.map((obj, i) => {
return (
<option value={obj} key={i}>
{obj}
</option>
);
})}
</select>
</span>
);
}
}