lint master
This commit is contained in:
parent
fc7edc875b
commit
50556bba97
7 changed files with 17 additions and 33 deletions
|
@ -41,7 +41,7 @@
|
||||||
"react-hooks/rules-of-hooks": "error",
|
"react-hooks/rules-of-hooks": "error",
|
||||||
"react/no-unescaped-entities": 0,
|
"react/no-unescaped-entities": 0,
|
||||||
"space-before-function-paren": [
|
"space-before-function-paren": [
|
||||||
"error",
|
"warn",
|
||||||
{
|
{
|
||||||
"anonymous": "never",
|
"anonymous": "never",
|
||||||
"named": "never",
|
"named": "never",
|
||||||
|
|
|
@ -21,7 +21,6 @@ export const selectClaimsById = createSelector(
|
||||||
state => state.byId || {}
|
state => state.byId || {}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
const select = (state) => ({
|
const select = (state) => ({
|
||||||
followedTags: selectFollowedTags(state),
|
followedTags: selectFollowedTags(state),
|
||||||
claimSearchByQuery: selectClaimSearchByQuery(state),
|
claimSearchByQuery: selectClaimSearchByQuery(state),
|
||||||
|
|
|
@ -90,7 +90,6 @@ class StripeAccountConnection extends React.Component<Props, State> {
|
||||||
Lbryio.call('account', 'status', {
|
Lbryio.call('account', 'status', {
|
||||||
environment: stripeEnvironment,
|
environment: stripeEnvironment,
|
||||||
}, 'post').then(accountStatusResponse => {
|
}, 'post').then(accountStatusResponse => {
|
||||||
|
|
||||||
const yetToBeCashedOutBalance = accountStatusResponse.total_received_unpaid;
|
const yetToBeCashedOutBalance = accountStatusResponse.total_received_unpaid;
|
||||||
if (yetToBeCashedOutBalance) {
|
if (yetToBeCashedOutBalance) {
|
||||||
that.setState({
|
that.setState({
|
||||||
|
@ -107,7 +106,6 @@ class StripeAccountConnection extends React.Component<Props, State> {
|
||||||
});
|
});
|
||||||
// user has not confirmed an account but have received payments
|
// user has not confirmed an account but have received payments
|
||||||
} else if (accountStatusResponse.total_received_unpaid > 0) {
|
} else if (accountStatusResponse.total_received_unpaid > 0) {
|
||||||
|
|
||||||
that.setState({
|
that.setState({
|
||||||
accountNotConfirmedButReceivedTips: true,
|
accountNotConfirmedButReceivedTips: true,
|
||||||
});
|
});
|
||||||
|
@ -176,29 +174,29 @@ class StripeAccountConnection extends React.Component<Props, State> {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
{/* user has completed their integration */}
|
{ /* user has completed their integration */ }
|
||||||
{accountConfirmed &&
|
{accountConfirmed &&
|
||||||
<div className="card__body-actions">
|
<div className="card__body-actions">
|
||||||
<div>
|
<div>
|
||||||
<div>
|
<div>
|
||||||
<h3>Congratulations! Your account has been connected with Odysee.</h3>
|
<h3>Congratulations! Your account has been connected with Odysee.</h3>
|
||||||
{unpaidBalance > 0 ? <div><br></br>
|
{unpaidBalance > 0 ? <div><br />
|
||||||
<h3>Your account balance is ${unpaidBalance/100} USD. Functionality to view your transactions and withdraw your balance will be landing shortly.</h3>
|
<h3>Your account balance is ${unpaidBalance / 100} USD. Functionality to view your transactions and withdraw your balance will be landing shortly.</h3>
|
||||||
</div> : <div><br></br>
|
</div> : <div><br />
|
||||||
<h3>Your account balance is $0 USD. When you receive a tip you will see it here.</h3>
|
<h3>Your account balance is $0 USD. When you receive a tip you will see it here.</h3>
|
||||||
</div>}
|
</div>}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
{accountNotConfirmedButReceivedTips &&
|
{ accountNotConfirmedButReceivedTips &&
|
||||||
<div className="card__body-actions">
|
<div className="card__body-actions">
|
||||||
<div>
|
<div>
|
||||||
<div>
|
<div>
|
||||||
<h3>Congratulations, you have already begun receiving tips on Odysee!</h3>
|
<h3>Congratulations, you have already begun receiving tips on Odysee!</h3>
|
||||||
<div><br></br>
|
<div><br />
|
||||||
<h3>Your pending account balance is ${unpaidBalance/100} USD. Functionality to view and receive your transactions will land soon.</h3>
|
<h3>Your pending account balance is ${unpaidBalance / 100} USD. Functionality to view and receive your transactions will land soon.</h3>
|
||||||
</div><br></br>
|
</div><br />
|
||||||
<div>
|
<div>
|
||||||
<h3>Connect your Bank Account to be able to cash your pending balance out to your account.</h3>
|
<h3>Connect your Bank Account to be able to cash your pending balance out to your account.</h3>
|
||||||
</div>
|
</div>
|
||||||
|
@ -220,7 +218,7 @@ class StripeAccountConnection extends React.Component<Props, State> {
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return (<></>);
|
return (<></>); // probably null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,7 +136,7 @@ function WalletSendTip(props: Props) {
|
||||||
setCanReceiveFiatTip(true);
|
setCanReceiveFiatTip(true);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(function (error) {
|
.catch(function(error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -276,7 +276,7 @@ function WalletSendTip(props: Props) {
|
||||||
function isNan(tipAmount) {
|
function isNan(tipAmount) {
|
||||||
// testing for NaN ES5 style https://stackoverflow.com/a/35912757/3973137
|
// testing for NaN ES5 style https://stackoverflow.com/a/35912757/3973137
|
||||||
// also sometimes it's returned as a string
|
// also sometimes it's returned as a string
|
||||||
if (tipAmount !== tipAmount || tipAmount === 'NaN') {
|
if (tipAmount !== tipAmount || tipAmount === 'NaN') { //eslint-disable-line
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { doSetClientSetting } from 'redux/actions/settings';
|
import { doSetClientSetting } from 'redux/actions/settings';
|
||||||
import { selectosNotificationsEnabled } from 'redux/selectors/settings';
|
import { selectosNotificationsEnabled } from 'redux/selectors/settings';
|
||||||
import { selectUserVerifiedEmail } from 'redux/selectors/user';
|
import { selectUserVerifiedEmail, selectUserEmail } from 'redux/selectors/user';
|
||||||
import { selectUserEmail } from 'redux/selectors/user';
|
|
||||||
|
|
||||||
import SettingsPage from './view';
|
import SettingsPage from './view';
|
||||||
|
|
||||||
|
|
|
@ -4,21 +4,13 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import Page from 'component/page';
|
import Page from 'component/page';
|
||||||
import Card from 'component/common/card';
|
import Card from 'component/common/card';
|
||||||
import { SETTINGS } from 'lbry-redux';
|
|
||||||
import { Lbryio } from 'lbryinc';
|
import { Lbryio } from 'lbryinc';
|
||||||
import { STRIPE_PUBLIC_KEY } from 'config';
|
import { STRIPE_PUBLIC_KEY } from 'config';
|
||||||
import classnames from 'classnames';
|
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
|
|
||||||
let scriptLoading = false;
|
let scriptLoading = false;
|
||||||
let scriptLoaded = false;
|
// let scriptLoaded = false;
|
||||||
let scriptDidError = false;
|
// let scriptDidError = false; // these could probably be in state if managing locally
|
||||||
|
|
||||||
const dateFormat = {
|
|
||||||
month: 'short',
|
|
||||||
day: 'numeric',
|
|
||||||
year: 'numeric',
|
|
||||||
};
|
|
||||||
|
|
||||||
let stripeEnvironment = 'test';
|
let stripeEnvironment = 'test';
|
||||||
// if the key contains pk_live it's a live key
|
// if the key contains pk_live it's a live key
|
||||||
|
@ -69,21 +61,19 @@ class CardVerify extends React.Component<Props, State> {
|
||||||
Lbryio.call('customer', 'status', {
|
Lbryio.call('customer', 'status', {
|
||||||
environment: stripeEnvironment,
|
environment: stripeEnvironment,
|
||||||
}, 'post').then(customerStatusResponse => {
|
}, 'post').then(customerStatusResponse => {
|
||||||
|
|
||||||
// user has a card saved if their defaultPaymentMethod has an id
|
// user has a card saved if their defaultPaymentMethod has an id
|
||||||
const defaultPaymentMethod = customerStatusResponse.Customer.invoice_settings.default_payment_method;
|
const defaultPaymentMethod = customerStatusResponse.Customer.invoice_settings.default_payment_method;
|
||||||
var userHasAlreadySetupPayment = Boolean(defaultPaymentMethod && defaultPaymentMethod.id);
|
var userHasAlreadySetupPayment = Boolean(defaultPaymentMethod && defaultPaymentMethod.id);
|
||||||
|
|
||||||
// show different frontend if user already has card
|
// show different frontend if user already has card
|
||||||
if (userHasAlreadySetupPayment) {
|
if (userHasAlreadySetupPayment) {
|
||||||
|
|
||||||
var card = customerStatusResponse.PaymentMethods[0].card;
|
var card = customerStatusResponse.PaymentMethods[0].card;
|
||||||
|
|
||||||
var cardDetails = {
|
var cardDetails = {
|
||||||
brand: card.brand,
|
brand: card.brand,
|
||||||
expiryYear: card.exp_year,
|
expiryYear: card.exp_year,
|
||||||
expiryMonth: card.exp_month,
|
expiryMonth: card.exp_month,
|
||||||
lastFour: card.last4
|
lastFour: card.last4,
|
||||||
};
|
};
|
||||||
|
|
||||||
that.setState({
|
that.setState({
|
||||||
|
@ -98,7 +88,7 @@ class CardVerify extends React.Component<Props, State> {
|
||||||
}, 'post').then(customerTransactionsResponse => {
|
}, 'post').then(customerTransactionsResponse => {
|
||||||
that.setState({
|
that.setState({
|
||||||
customerTransactions: customerTransactionsResponse,
|
customerTransactions: customerTransactionsResponse,
|
||||||
})
|
});
|
||||||
|
|
||||||
console.log(customerTransactionsResponse);
|
console.log(customerTransactionsResponse);
|
||||||
});
|
});
|
||||||
|
@ -262,7 +252,6 @@ class CardVerify extends React.Component<Props, State> {
|
||||||
// shows a success / error message when the payment is complete
|
// shows a success / error message when the payment is complete
|
||||||
var orderComplete = function(stripe, clientSecret) {
|
var orderComplete = function(stripe, clientSecret) {
|
||||||
stripe.retrieveSetupIntent(clientSecret).then(function(result) {
|
stripe.retrieveSetupIntent(clientSecret).then(function(result) {
|
||||||
|
|
||||||
Lbryio.call('customer', 'status', {
|
Lbryio.call('customer', 'status', {
|
||||||
environment: stripeEnvironment,
|
environment: stripeEnvironment,
|
||||||
}, 'post').then(customerStatusResponse => {
|
}, 'post').then(customerStatusResponse => {
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { selectTotalBalance } from 'lbry-redux';
|
import { selectTotalBalance } from 'lbry-redux';
|
||||||
import { doOpenModal } from 'redux/actions/app';
|
import { doOpenModal } from 'redux/actions/app';
|
||||||
import { selectUser } from 'redux/selectors/user';
|
|
||||||
import Wallet from './view';
|
import Wallet from './view';
|
||||||
|
|
||||||
const select = state => ({
|
const select = state => ({
|
||||||
|
|
Loading…
Reference in a new issue