aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/user-preferenced-currency-input/user-preferenced-currency-input.component.js
blob: 463e66b807533ec228dcbad9f5a514ce02189e89 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
import CurrencyInput from '../currency-input'

export default class UserPreferencedCurrencyInput extends PureComponent {
  static propTypes = {
    useNativeCurrencyAsPrimaryCurrency: PropTypes.bool,
  }

  render () {
    const { useNativeCurrencyAsPrimaryCurrency, ...restProps } = this.props

    return (
      <CurrencyInput
        {...restProps}
        useFiat={!useNativeCurrencyAsPrimaryCurrency}
      />
    )
  }
}