more cleanup
This commit is contained in:
parent
5908f90d74
commit
e5ef460e7e
4 changed files with 5 additions and 65 deletions
|
@ -1,40 +1,3 @@
|
||||||
import { connect } from 'react-redux';
|
|
||||||
import {
|
|
||||||
selectBalance,
|
|
||||||
selectClaimsBalance,
|
|
||||||
selectSupportsBalance,
|
|
||||||
selectTipsBalance,
|
|
||||||
selectIsFetchingUtxoCounts,
|
|
||||||
selectUtxoCounts,
|
|
||||||
doFetchUtxoCounts,
|
|
||||||
doUtxoConsolidate,
|
|
||||||
selectIsConsolidatingUtxos,
|
|
||||||
selectIsMassClaimingTips,
|
|
||||||
selectPendingConsolidateTxid,
|
|
||||||
selectPendingMassClaimTxid,
|
|
||||||
} from 'lbry-redux';
|
|
||||||
import { doOpenModal } from 'redux/actions/app';
|
|
||||||
import { selectSyncHash } from 'redux/selectors/sync';
|
|
||||||
import { selectClaimedRewards } from 'redux/selectors/rewards';
|
|
||||||
import WalletBalance from './view';
|
import WalletBalance from './view';
|
||||||
|
|
||||||
const select = state => ({
|
export default WalletBalance;
|
||||||
balance: selectBalance(state),
|
|
||||||
claimsBalance: selectClaimsBalance(state) || 0,
|
|
||||||
supportsBalance: selectSupportsBalance(state) || 0,
|
|
||||||
tipsBalance: selectTipsBalance(state) || 0,
|
|
||||||
rewards: selectClaimedRewards(state),
|
|
||||||
hasSynced: Boolean(selectSyncHash(state)),
|
|
||||||
fetchingUtxoCounts: selectIsFetchingUtxoCounts(state),
|
|
||||||
consolidatingUtxos: selectIsConsolidatingUtxos(state),
|
|
||||||
massClaimingTips: selectIsMassClaimingTips(state),
|
|
||||||
utxoCounts: selectUtxoCounts(state),
|
|
||||||
consolidateIsPending: selectPendingConsolidateTxid(state),
|
|
||||||
massClaimIsPending: selectPendingMassClaimTxid(state),
|
|
||||||
});
|
|
||||||
|
|
||||||
export default connect(select, {
|
|
||||||
doOpenModal,
|
|
||||||
doFetchUtxoCounts,
|
|
||||||
doUtxoConsolidate,
|
|
||||||
})(WalletBalance);
|
|
||||||
|
|
|
@ -1,12 +1,9 @@
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { withRouter } from 'react-router';
|
import { withRouter } from 'react-router';
|
||||||
import StripeAccountConnection from './view';
|
import StripeAccountConnection from './view';
|
||||||
import { selectUser } from 'redux/selectors/user';
|
|
||||||
import { doToast } from 'redux/actions/notifications';
|
import { doToast } from 'redux/actions/notifications';
|
||||||
|
|
||||||
const select = (state) => ({
|
const select = (state) => ({});
|
||||||
user: selectUser(state),
|
|
||||||
});
|
|
||||||
|
|
||||||
const perform = (dispatch) => ({
|
const perform = (dispatch) => ({
|
||||||
doToast: (options) => dispatch(doToast(options)),
|
doToast: (options) => dispatch(doToast(options)),
|
||||||
|
|
|
@ -31,7 +31,6 @@ if (isDev) {
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
source: string,
|
source: string,
|
||||||
user: User,
|
|
||||||
doOpenModal: (string, {}) => void,
|
doOpenModal: (string, {}) => void,
|
||||||
doToast: ({ message: string }) => void,
|
doToast: ({ message: string }) => void,
|
||||||
};
|
};
|
||||||
|
@ -41,13 +40,11 @@ type State = {
|
||||||
loading: boolean,
|
loading: boolean,
|
||||||
content: ?string,
|
content: ?string,
|
||||||
stripeConnectionUrl: string,
|
stripeConnectionUrl: string,
|
||||||
// alreadyUpdated: boolean,
|
|
||||||
accountConfirmed: boolean,
|
accountConfirmed: boolean,
|
||||||
accountPendingConfirmation: boolean,
|
accountPendingConfirmation: boolean,
|
||||||
accountNotConfirmedButReceivedTips: boolean,
|
accountNotConfirmedButReceivedTips: boolean,
|
||||||
unpaidBalance: number,
|
unpaidBalance: number,
|
||||||
pageTitle: string,
|
pageTitle: string,
|
||||||
accountTransactions: any, // define this type
|
|
||||||
stillRequiringVerification: boolean
|
stillRequiringVerification: boolean
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -64,20 +61,13 @@ class StripeAccountConnection extends React.Component<Props, State> {
|
||||||
unpaidBalance: 0,
|
unpaidBalance: 0,
|
||||||
stripeConnectionUrl: '',
|
stripeConnectionUrl: '',
|
||||||
pageTitle: 'Add Payout Method',
|
pageTitle: 'Add Payout Method',
|
||||||
accountTransactions: [],
|
|
||||||
stillRequiringVerification: true,
|
stillRequiringVerification: true,
|
||||||
// alreadyUpdated: false,
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
const { user } = this.props;
|
|
||||||
|
|
||||||
let doToast = this.props.doToast;
|
let doToast = this.props.doToast;
|
||||||
|
|
||||||
// $FlowFixMe
|
|
||||||
this.experimentalUiEnabled = user && user.experimental_ui;
|
|
||||||
|
|
||||||
var that = this;
|
var that = this;
|
||||||
|
|
||||||
function getAndSetAccountLink(stillNeedToConfirmAccount) {
|
function getAndSetAccountLink(stillNeedToConfirmAccount) {
|
||||||
|
@ -200,7 +190,6 @@ class StripeAccountConnection extends React.Component<Props, State> {
|
||||||
accountNotConfirmedButReceivedTips,
|
accountNotConfirmedButReceivedTips,
|
||||||
pageTitle,
|
pageTitle,
|
||||||
stillRequiringVerification,
|
stillRequiringVerification,
|
||||||
// accountTransactions,
|
|
||||||
} = this.state;
|
} = this.state;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -42,18 +42,8 @@ const WalletPage = (props: Props) => {
|
||||||
environment: stripeEnvironment,
|
environment: stripeEnvironment,
|
||||||
},
|
},
|
||||||
'post'
|
'post'
|
||||||
); };
|
);
|
||||||
|
}
|
||||||
// function getCustomerStatus() {
|
|
||||||
// return Lbryio.call(
|
|
||||||
// 'customer',
|
|
||||||
// 'status',
|
|
||||||
// {
|
|
||||||
// environment: stripeEnvironment,
|
|
||||||
// },
|
|
||||||
// 'post'
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
|
|
||||||
function getAccountStatus() {
|
function getAccountStatus() {
|
||||||
return Lbryio.call(
|
return Lbryio.call(
|
||||||
|
@ -117,6 +107,7 @@ const WalletPage = (props: Props) => {
|
||||||
})();
|
})();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
// TODO: use built in tabs functionality
|
||||||
function focusLBCTab() {
|
function focusLBCTab() {
|
||||||
document.getElementsByClassName('lbc-transactions')[0].style.display = 'inline';
|
document.getElementsByClassName('lbc-transactions')[0].style.display = 'inline';
|
||||||
document.getElementsByClassName('fiat-transactions')[0].style.display = 'none';
|
document.getElementsByClassName('fiat-transactions')[0].style.display = 'none';
|
||||||
|
|
Loading…
Reference in a new issue