more lint

This commit is contained in:
zeppi 2021-07-17 12:19:44 -04:00 committed by jessopb
parent 27aa4e4a22
commit 7ffd59c169
3 changed files with 44 additions and 31 deletions

View file

@ -1,6 +1,6 @@
// @flow
import type { ElementRef } from 'react';
import { SIMPLE_SITE } from 'config';
import { SIMPLE_SITE, STRIPE_PUBLIC_KEY } from 'config';
import * as PAGES from 'constants/pages';
import * as ICONS from 'constants/icons';
import React from 'react';
@ -16,7 +16,6 @@ import CreditAmount from 'component/common/credit-amount';
import ChannelThumbnail from 'component/channelThumbnail';
import UriIndicator from 'component/uriIndicator';
import Empty from 'component/common/empty';
import { STRIPE_PUBLIC_KEY } from 'config';
import { Lbryio } from 'lbryinc';
let stripeEnvironment = 'test';
@ -228,7 +227,7 @@ export function CommentCreate(props: Props) {
// handleCreateComment(null);
})
.catch(function(error) {
.catch(function (error) {
var displayError = 'Sorry, there was an error in processing your payment!';
if (error.message !== 'payment intent failed to confirm') {
@ -305,11 +304,15 @@ export function CommentCreate(props: Props) {
}
if (isReviewingSupportComment && activeChannelClaim) {
return (
<div className="comment__create">
<div className="comment__sc-preview">
<CreditAmount className="comment__scpreview-amount" isFiat={activeTab === TAB_FIAT} amount={tipAmount} size={activeTab === TAB_LBC ? 18 : 2} />
<CreditAmount
className="comment__scpreview-amount"
isFiat={activeTab === TAB_FIAT}
amount={tipAmount}
size={activeTab === TAB_LBC ? 18 : 2}
/>
<ChannelThumbnail xsmall uri={activeChannelClaim.canonical_url} />
<div>
@ -371,7 +374,15 @@ export function CommentCreate(props: Props) {
textAreaMaxLength={livestream ? FF_MAX_CHARS_IN_LIVESTREAM_COMMENT : FF_MAX_CHARS_IN_COMMENT}
/>
{/* TODO: the tip validation is done in selector */}
{isSupportComment && <WalletTipAmountSelector onTipErrorChange={setTipError} claim={claim} activeTab={activeTab} amount={tipAmount} onChange={(amount) => setTipAmount(amount)} />}
{isSupportComment && (
<WalletTipAmountSelector
onTipErrorChange={setTipError}
claim={claim}
activeTab={activeTab}
amount={tipAmount}
onChange={(amount) => setTipAmount(amount)}
/>
)}
<div className="section__actions section__actions--no-margin">
{isSupportComment ? (
<>
@ -406,16 +417,28 @@ export function CommentCreate(props: Props) {
requiresAuth={IS_WEB}
/>
{!claimIsMine && (
<Button disabled={disabled} button="alt" className="thatButton" icon={ICONS.LBC} onClick={() => {
setIsSupportComment(true);
setActiveTab(TAB_LBC);
}} />
<Button
disabled={disabled}
button="alt"
className="thatButton"
icon={ICONS.LBC}
onClick={() => {
setIsSupportComment(true);
setActiveTab(TAB_LBC);
}}
/>
)}
{!claimIsMine && (
<Button disabled={disabled} button="alt" className="thisButton" icon={ICONS.FINANCE} onClick={() => {
setIsSupportComment(true);
setActiveTab(TAB_FIAT);
}} />
<Button
disabled={disabled}
button="alt"
className="thisButton"
icon={ICONS.FINANCE}
onClick={() => {
setIsSupportComment(true);
setActiveTab(TAB_FIAT);
}}
/>
)}
{isReply && (
<Button

View file

@ -1,17 +1,12 @@
// @flow
import React, { useState } from 'react';
import React from 'react';
import { Modal } from 'modal/modal';
import { FormField } from 'component/common/form';
import * as txnTypes from 'constants/transaction_types';
import Card from 'component/common/card';
import Button from 'component/button';
import I18nMessage from 'component/i18nMessage';
import LbcSymbol from 'component/common/lbc-symbol';
import * as ICONS from 'constants/icons';
import { Lbryio } from 'lbryinc';
import { STRIPE_PUBLIC_KEY } from 'config';
let stripeEnvironment = 'test';
// if the key contains pk_live it's a live key
// update the environment for the calls to the backend to indicate which environment to hit
@ -19,7 +14,6 @@ if (STRIPE_PUBLIC_KEY.indexOf('pk_live') > -1) {
stripeEnvironment = 'live';
}
type Props = {
closeModal: () => void,
abandonTxo: (Txo, () => void) => void,
@ -34,7 +28,6 @@ type Props = {
};
export default function ModalRevokeClaim(props: Props) {
var that = this;
console.log(that);
@ -44,9 +37,9 @@ export default function ModalRevokeClaim(props: Props) {
console.log(uri);
console.log(setAsConfirmingCard)
console.log(setAsConfirmingCard);
function removeCard(){
function removeCard() {
console.log(paymentMethodId);
Lbryio.call(
@ -54,19 +47,17 @@ export default function ModalRevokeClaim(props: Props) {
'detach',
{
environment: stripeEnvironment,
payment_method_id: paymentMethodId
payment_method_id: paymentMethodId,
},
'post'
).then((removeCardResponse) => {
console.log(removeCardResponse)
console.log(removeCardResponse);
//TODO: add toast here
// TODO: add toast here
// closeModal();
location.reload();
window.location.reload();
});
}
return (

View file

@ -3,7 +3,6 @@ import React from 'react';
import { withRouter } from 'react-router';
import WalletBalance from 'component/walletBalance';
import TxoList from 'component/txoList';
import StripeAccountConnection from 'component/stripeAccountConnection';
import Page from 'component/page';
import Spinner from 'component/spinner';
import YrblWalletEmpty from 'component/yrblWalletEmpty';