diff --git a/websrc/components/Currency.tsx b/websrc/components/Currency.tsx new file mode 100644 index 0000000..f2068a6 --- /dev/null +++ b/websrc/components/Currency.tsx @@ -0,0 +1,45 @@ +import {Button, ButtonGroup, Dropdown} from "react-bootstrap"; +import React, {Component} from "react"; +import DropdownItem from "react-bootstrap/DropdownItem"; +import {CurrencyPair} from "../types"; + + +export type CurrencyPairProps = { + active_pair: CurrencyPair, + pairs: Array +} + +export class CurrencyDropdown extends Component { + constructor(props) { + super(props); + } + + dropdownItems() { + return this.props.pairs.map((pair) => { + return ( + {pair.base} / {pair.quote} ) + }) + } + + render() { + return ( + + + + {this.props.pairs.length > 0 && + + <> + + + + {this.dropdownItems()} + + + } + + + ) + } + +} +