Browse Source

addcoin modal animation

all-modes
pbca26 8 years ago
parent
commit
c8f407b52f
  1. 15
      react/src/components/addcoin/addcoin.js
  2. 4
      react/src/components/dashboard/receiveCoin.js
  3. 2
      react/src/components/dashboard/walletsData.js

15
react/src/components/addcoin/addcoin.js

@ -36,6 +36,7 @@ class AddCoin extends React.Component {
}, },
display: false, display: false,
actionsMenu: false, actionsMenu: false,
modalClassName: 'hide',
}; };
this.activateCoin = this.activateCoin.bind(this); this.activateCoin = this.activateCoin.bind(this);
this.dismiss = this.dismiss.bind(this); this.dismiss = this.dismiss.bind(this);
@ -56,7 +57,7 @@ class AddCoin extends React.Component {
loadCoinSelection() { loadCoinSelection() {
shepherdGetCoinList() shepherdGetCoinList()
.then(function(json) { .then(function(json) {
if (json.msg !== 'error') { if (json.msg !== 'error') {
this.setState(Object.assign({}, this.state, { this.setState(Object.assign({}, this.state, {
coins: json.result, coins: json.result,
actionsMenu: false, actionsMenu: false,
@ -90,10 +91,18 @@ class AddCoin extends React.Component {
} }
componentWillReceiveProps(props) { componentWillReceiveProps(props) {
if (props) { if (props && props.display !== this.state.display) {
this.setState(Object.assign({}, this.state, { this.setState(Object.assign({}, this.state, {
display: props.display, display: props.display,
modalClassName: props.display ? 'show fade' : 'show fade',
})); }));
setTimeout(function() {
this.setState(Object.assign({}, this.state, {
display: props.display,
modalClassName: props.display ? 'show in' : 'hide',
}));
}.bind(this), 100);
} }
} }
@ -307,7 +316,7 @@ class AddCoin extends React.Component {
return ( return (
<div> <div>
<div <div
className={'modal modal-3d-sign add-coin-modal ' + (this.state.display ? 'show in' : 'fade hide')} className={'modal modal-3d-sign add-coin-modal ' + this.state.modalClassName}
id="AddCoinDilogModel-login" id="AddCoinDilogModel-login"
aria-hidden="true" aria-hidden="true"
aria-labelledby="AddCoinDilogModel-login" aria-labelledby="AddCoinDilogModel-login"

4
react/src/components/dashboard/receiveCoin.js

@ -66,10 +66,10 @@ class ReceiveCoin extends React.Component {
let address = this.props.addresses.public[i]; let address = this.props.addresses.public[i];
if (this.props.mode === 'basilisk' && address.amount === 'N/A') { if (this.props.mode === 'basilisk' && address.amount === 'N/A') {
address.amount = this.props.cache[this.props.coin][address.address].getbalance.data && this.props.cache[this.props.coin][address.address].getbalance.data.balance ? this.props.cache[this.props.coin][address.address].getbalance.data.balance : 'N/A'; address.amount = this.props.cache && this.props.cache[this.props.coin][address.address] && this.props.cache[this.props.coin][address.address].getbalance.data && this.props.cache[this.props.coin][address.address].getbalance.data.balance ? this.props.cache[this.props.coin][address.address].getbalance.data.balance : 'N/A';
} }
if (this.props.mode === 'basilisk' && (address.interest === 'N/A' || !address.interest)) { if (this.props.mode === 'basilisk' && (address.interest === 'N/A' || !address.interest)) {
address.interest = this.props.cache[this.props.coin][address.address].getbalance.data && this.props.cache[this.props.coin][address.address].getbalance.data.interest ? this.props.cache[this.props.coin][address.address].getbalance.data.interest : 'N/A'; address.interest = this.props.cache && this.props.cache[this.props.coin][address.address] && this.props.cache[this.props.coin][address.address].getbalance.data && this.props.cache[this.props.coin][address.address].getbalance.data.interest ? this.props.cache[this.props.coin][address.address].getbalance.data.interest : 'N/A';
} }
items.push( items.push(

2
react/src/components/dashboard/walletsData.js

@ -430,7 +430,7 @@ class WalletsData extends React.Component {
let _amount = address.amount; let _amount = address.amount;
if (this.props.ActiveCoin.mode === 'basilisk') { if (this.props.ActiveCoin.mode === 'basilisk') {
_amount = this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][address.address] && this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][address.address].getbalance.data && this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][address.address].getbalance.data.balance ? this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][address.address].getbalance.data.balance : 'N/A'; _amount = this.props.ActiveCoin.cache && this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][address.address] && this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][address.address].getbalance.data && this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][address.address].getbalance.data.balance ? this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][address.address].getbalance.data.balance : 'N/A';
} }
items.push( items.push(

Loading…
Cancel
Save