Skip to content

Commit

Permalink
Merge pull request #16 from hamzaPixl/development
Browse files Browse the repository at this point in the history
dev > master
  • Loading branch information
hamzaPixl authored Apr 24, 2018
2 parents 5b0fa30 + 570a982 commit 779d3b8
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions src/components/portfolio/CryptoView/CryptoView.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,40 +33,35 @@ class CryptoView extends Component {
render() {
const change24 = this.state.coin.percent_change_24h / 100;
const percentageClass = this.state.coin.percent_change_24h < 0 ? 'negative' : 'positive';

return (
<Container>
<SearchContainer>
<Select
name="form-field-name"
name="select-crypto"
options={this.state.list}
onBlurResetsInput={false}
onSelectResetsInput={false}
value={this.state.selectValue}
autoFocus
simpleValue
clearable
searchable
onChange={(value) => {
if (value) {
const tmp = this.state.list.find(c => c.value === value);
searchCoin(tmp)
.then(coin => this.setState({ coin, selectValue: value }));
if (!value) {
return;
}
const tmp = this.state.list.find(c => c.value === value);
searchCoin(tmp)
.then(coin => this.setState({ coin, selectValue: value }));
}}
searchable
/>
</SearchContainer>

<CardContainer>

<CoinInformation>

<SymbolContainer>
<CoinNameCointainer>
<Name>{this.state.coin.name}</Name>
<Symbol>{this.state.coin.symbol}</Symbol>
</CoinNameCointainer>
</SymbolContainer>

<PriceContainer>
<PriceBTC>
<FormattedCoin
Expand All @@ -87,7 +82,6 @@ class CryptoView extends Component {
/>
</Percent>
</PriceContainer>

</CoinInformation>
<MarketInformation>
<Capitalisation>
Expand All @@ -103,7 +97,6 @@ class CryptoView extends Component {
/>
</Volume>
</MarketInformation>

</CardContainer>
</Container>
);
Expand Down

0 comments on commit 779d3b8

Please sign in to comment.