1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-28 23:06:37 +01:00
metamask-extension/ui/app/components/send/send-header/send-header.selectors.js
Dan b3d78ed8a1 Remove send_ directory, revert to just having send
Revert accidentally changed constants.

Require defaults in ens-input, gas-fee-display and confirm screens.
2018-07-16 12:58:32 -02:30

38 lines
814 B
JavaScript

const {
getSelectedToken,
getSendEditingTransactionId,
} = require('../send.selectors.js')
const selectors = {
getTitleKey,
getSubtitleParams,
}
module.exports = selectors
function getTitleKey (state) {
const isEditing = Boolean(getSendEditingTransactionId(state))
const isToken = Boolean(getSelectedToken(state))
if (isEditing) {
return 'edit'
} else if (isToken) {
return 'sendTokens'
} else {
return 'sendETH'
}
}
function getSubtitleParams (state) {
const isEditing = Boolean(getSendEditingTransactionId(state))
const token = getSelectedToken(state)
if (isEditing) {
return [ 'editingTransaction' ]
} else if (token) {
return [ 'onlySendTokensToAccountAddress', [ token.symbol ] ]
} else {
return [ 'onlySendToEtherAddress' ]
}
}