Skip to content

Commit 72cc21c

Browse files
Transfers enable (#223)
* Nam transfers enable. * config unwanted list removed. * shielded fee fixes. * share tweet updates. * added transfer button at home page. * indexer, fee option fixes.
1 parent a2c7a64 commit 72cc21c

File tree

1 file changed

+18
-0
lines changed
  • src/containers/Tokens/FeeOptions

1 file changed

+18
-0
lines changed

src/containers/Tokens/FeeOptions/index.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import NamadaLogo from '../../../assets/masp/namada_logo.svg';
1111
import ShieldedNamadaLogo from '../../../assets/masp/namada_shielded.svg';
1212
import { makeStyles } from '@material-ui/core/styles';
1313
import variables from '../../../utils/variables';
14+
import { config } from '../../../config';
1415

1516
const useStyles = makeStyles((theme) => ({
1617
root: {
@@ -79,6 +80,21 @@ const FeeOptions = (props) => {
7980
: null;
8081

8182
let balanceAmount = Number(matchingBalance?.minDenomAmount || 0);
83+
if (matchingToken.address === config.TOKEN_ADDRESS && !balanceAmount) {
84+
let balance = null;
85+
props.balance && props.balance.length && props.balance.map((val) => {
86+
if (val && val.length) {
87+
val.map((value) => {
88+
if (value === config.TOKEN_ADDRESS) {
89+
balance = val[1];
90+
}
91+
});
92+
}
93+
94+
return null;
95+
});
96+
balanceAmount = balanceAmount || balance;
97+
}
8298
if (props.from && props.from === 'shielded') {
8399
const matchingBalance = matchingToken
84100
? (props.shieldedBalance || []).find(([address]) => address === matchingToken.address)
@@ -149,6 +165,7 @@ const FeeOptions = (props) => {
149165
}
150166

151167
FeeOptions.propTypes = {
168+
balance: PropTypes.array.isRequired,
152169
balanceList: PropTypes.array.isRequired,
153170
lang: PropTypes.string.isRequired,
154171
setFeeOptionPopoverValue: PropTypes.func.isRequired,
@@ -164,6 +181,7 @@ FeeOptions.propTypes = {
164181

165182
const stateToProps = (state) => {
166183
return {
184+
balance: state.accounts.balance.result,
167185
balanceList: state.accounts.balanceList.result,
168186
shieldedBalance: state.accounts.shieldedBalance.result,
169187
lang: state.language,

0 commit comments

Comments
 (0)