diff --git a/.eslintrc b/.eslintrc index 71fae415b..54ef341a3 100644 --- a/.eslintrc +++ b/.eslintrc @@ -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", diff --git a/ui/component/claimListDiscover/index.js b/ui/component/claimListDiscover/index.js index ea9606252..49c48fb7b 100644 --- a/ui/component/claimListDiscover/index.js +++ b/ui/component/claimListDiscover/index.js @@ -21,7 +21,6 @@ export const selectClaimsById = createSelector( state => state.byId || {} ); - const select = (state) => ({ followedTags: selectFollowedTags(state), claimSearchByQuery: selectClaimSearchByQuery(state), diff --git a/ui/component/stripeAccountConnection/view.jsx b/ui/component/stripeAccountConnection/view.jsx index e78090aec..4bfc1b337 100644 --- a/ui/component/stripeAccountConnection/view.jsx +++ b/ui/component/stripeAccountConnection/view.jsx @@ -90,7 +90,6 @@ class StripeAccountConnection extends React.Component { 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 { }); // user has not confirmed an account but have received payments } else if (accountStatusResponse.total_received_unpaid > 0) { - that.setState({ accountNotConfirmedButReceivedTips: true, }); @@ -176,29 +174,29 @@ class StripeAccountConnection extends React.Component { } - {/* user has completed their integration */} + { /* user has completed their integration */ } {accountConfirmed &&

Congratulations! Your account has been connected with Odysee.

- {unpaidBalance > 0 ?


-

Your account balance is ${unpaidBalance/100} USD. Functionality to view your transactions and withdraw your balance will be landing shortly.

-
:


+ {unpaidBalance > 0 ?

+

Your account balance is ${unpaidBalance / 100} USD. Functionality to view your transactions and withdraw your balance will be landing shortly.

+
:

Your account balance is $0 USD. When you receive a tip you will see it here.

}
} - {accountNotConfirmedButReceivedTips && + { accountNotConfirmedButReceivedTips &&

Congratulations, you have already begun receiving tips on Odysee!

-


-

Your pending account balance is ${unpaidBalance/100} USD. Functionality to view and receive your transactions will land soon.

-


+

+

Your pending account balance is ${unpaidBalance / 100} USD. Functionality to view and receive your transactions will land soon.

+

Connect your Bank Account to be able to cash your pending balance out to your account.

@@ -220,7 +218,7 @@ class StripeAccountConnection extends React.Component { /> ); } else { - return (<>); + return (<>); // probably null; } } } diff --git a/ui/component/walletSendTip/view.jsx b/ui/component/walletSendTip/view.jsx index 822494dea..550f6e52e 100644 --- a/ui/component/walletSendTip/view.jsx +++ b/ui/component/walletSendTip/view.jsx @@ -136,7 +136,7 @@ function WalletSendTip(props: Props) { setCanReceiveFiatTip(true); } }) - .catch(function (error) { + .catch(function(error) { console.log(error); }); } @@ -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; diff --git a/ui/page/settingsStripeCard/index.js b/ui/page/settingsStripeCard/index.js index 7cb6a65d7..c74607b04 100644 --- a/ui/page/settingsStripeCard/index.js +++ b/ui/page/settingsStripeCard/index.js @@ -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'; diff --git a/ui/page/settingsStripeCard/view.jsx b/ui/page/settingsStripeCard/view.jsx index c1f453d62..ee0654054 100644 --- a/ui/page/settingsStripeCard/view.jsx +++ b/ui/page/settingsStripeCard/view.jsx @@ -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 { 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 { }, 'post').then(customerTransactionsResponse => { that.setState({ customerTransactions: customerTransactionsResponse, - }) + }); console.log(customerTransactionsResponse); }); @@ -262,7 +252,6 @@ class CardVerify extends React.Component { // 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 => { diff --git a/ui/page/wallet/index.js b/ui/page/wallet/index.js index 2183ae1d2..2e51e48c3 100644 --- a/ui/page/wallet/index.js +++ b/ui/page/wallet/index.js @@ -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 => ({