lint master

This commit is contained in:
zeppi 2021-07-04 22:28:14 -04:00 committed by jessopb
parent fc7edc875b
commit 50556bba97
7 changed files with 17 additions and 33 deletions

View file

@ -41,7 +41,7 @@
"react-hooks/rules-of-hooks": "error",
"react/no-unescaped-entities": 0,
"space-before-function-paren": [
"error",
"warn",
{
"anonymous": "never",
"named": "never",

View file

@ -21,7 +21,6 @@ export const selectClaimsById = createSelector(
state => state.byId || {}
);
const select = (state) => ({
followedTags: selectFollowedTags(state),
claimSearchByQuery: selectClaimSearchByQuery(state),

View file

@ -90,7 +90,6 @@ class StripeAccountConnection extends React.Component<Props, State> {
Lbryio.call('account', 'status', {
environment: stripeEnvironment,
}, 'post').then(accountStatusResponse => {
const yetToBeCashedOutBalance = accountStatusResponse.total_received_unpaid;
if (yetToBeCashedOutBalance) {
that.setState({
@ -107,7 +106,6 @@ class StripeAccountConnection extends React.Component<Props, State> {
});
// user has not confirmed an account but have received payments
} else if (accountStatusResponse.total_received_unpaid > 0) {
that.setState({
accountNotConfirmedButReceivedTips: true,
});
@ -182,9 +180,9 @@ class StripeAccountConnection extends React.Component<Props, State> {
<div>
<div>
<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>
</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>
</div>}
</div>
@ -196,9 +194,9 @@ class StripeAccountConnection extends React.Component<Props, State> {
<div>
<div>
<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>
</div><br></br>
</div><br />
<div>
<h3>Connect your Bank Account to be able to cash your pending balance out to your account.</h3>
</div>
@ -220,7 +218,7 @@ class StripeAccountConnection extends React.Component<Props, State> {
/>
);
} else {
return (<></>);
return (<></>); // probably null;
}
}
}

View file

@ -276,7 +276,7 @@ function WalletSendTip(props: Props) {
function isNan(tipAmount) {
// testing for NaN ES5 style https://stackoverflow.com/a/35912757/3973137
// also sometimes it's returned as a string
if (tipAmount !== tipAmount || tipAmount === 'NaN') {
if (tipAmount !== tipAmount || tipAmount === 'NaN') { //eslint-disable-line
return true;
}
return false;

View file

@ -1,8 +1,7 @@
import { connect } from 'react-redux';
import { doSetClientSetting } from 'redux/actions/settings';
import { selectosNotificationsEnabled } from 'redux/selectors/settings';
import { selectUserVerifiedEmail } from 'redux/selectors/user';
import { selectUserEmail } from 'redux/selectors/user';
import { selectUserVerifiedEmail, selectUserEmail } from 'redux/selectors/user';
import SettingsPage from './view';

View file

@ -4,21 +4,13 @@
import React from 'react';
import Page from 'component/page';
import Card from 'component/common/card';
import { SETTINGS } from 'lbry-redux';
import { Lbryio } from 'lbryinc';
import { STRIPE_PUBLIC_KEY } from 'config';
import classnames from 'classnames';
import moment from 'moment';
let scriptLoading = false;
let scriptLoaded = false;
let scriptDidError = false;
const dateFormat = {
month: 'short',
day: 'numeric',
year: 'numeric',
};
// let scriptLoaded = false;
// let scriptDidError = false; // these could probably be in state if managing locally
let stripeEnvironment = 'test';
// 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', {
environment: stripeEnvironment,
}, 'post').then(customerStatusResponse => {
// user has a card saved if their defaultPaymentMethod has an id
const defaultPaymentMethod = customerStatusResponse.Customer.invoice_settings.default_payment_method;
var userHasAlreadySetupPayment = Boolean(defaultPaymentMethod && defaultPaymentMethod.id);
// show different frontend if user already has card
if (userHasAlreadySetupPayment) {
var card = customerStatusResponse.PaymentMethods[0].card;
var cardDetails = {
brand: card.brand,
expiryYear: card.exp_year,
expiryMonth: card.exp_month,
lastFour: card.last4
lastFour: card.last4,
};
that.setState({
@ -98,7 +88,7 @@ class CardVerify extends React.Component<Props, State> {
}, 'post').then(customerTransactionsResponse => {
that.setState({
customerTransactions: 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
var orderComplete = function(stripe, clientSecret) {
stripe.retrieveSetupIntent(clientSecret).then(function(result) {
Lbryio.call('customer', 'status', {
environment: stripeEnvironment,
}, 'post').then(customerStatusResponse => {

View file

@ -1,7 +1,6 @@
import { connect } from 'react-redux';
import { selectTotalBalance } from 'lbry-redux';
import { doOpenModal } from 'redux/actions/app';
import { selectUser } from 'redux/selectors/user';
import Wallet from './view';
const select = state => ({