blob: 88dee0dcbdb2aef44ca0a79f03301c3371ef360d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
import {
getSelectedToken,
getSelectedTokenToFiatRate,
getConversionRate,
} from '../../send.selectors.js'
const selectors = {
getAmountConversionRate,
getMaxModeOn,
getPrimaryCurrency,
sendAmountIsInError,
}
module.exports = selectors
function getMaxModeOn (state) {
return state.metamask.send.maxModeOn
}
function sendAmountIsInError (state) {
return Boolean(state.metamask.send.errors.amount)
}
function getPrimaryCurrency (state) {
const selectedToken = getSelectedToken(state)
return selectedToken && selectedToken.symbol
}
function getAmountConversionRate (state) {
return getSelectedToken(state)
? getSelectedTokenToFiatRate(state)
: getConversionRate(state)
}
|