Skip to content

Commit 2bb8abd

Browse files
committed
fix: lint errors
* temporarily suppress some lint issues * but these will need to be addressed in a future * PR Signed-off-by: Rakib Ansary <[email protected]>
1 parent 506fccb commit 2bb8abd

File tree

14 files changed

+89
-76
lines changed

14 files changed

+89
-76
lines changed

.editorconfig

+1
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ end_of_line = lf
1010
charset = utf-8
1111
trim_trailing_whitespace = true
1212
insert_final_newline = true
13+
quote_type = single

src/apps/platform/src/platform.routes.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { walletRoutes } from '~/apps/wallet'
1313

1414
const Home: LazyLoadedComponent = lazyLoad(
1515
() => import('./routes/home'),
16-
'HomePage'
16+
'HomePage',
1717
)
1818

1919
const homeRoutes: ReadonlyArray<PlatformRoute> = [

src/apps/wallet/src/home/tabs/payments/PaymentsTab.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const PaymentsTab: FC<PaymentsTabProps> = (props: PaymentsTabProps) => {
6666
const [userPaymentProvider, setUserPaymentProvider] = useState<PaymentProvider | undefined>(undefined)
6767
const [setupRequired, setSetupRequired] = useState(false)
6868
const [isLoading, setIsLoading] = useState(false)
69-
const [error, setError] = useState<string | undefined>(undefined)
69+
const [, setError] = useState<string | undefined>(undefined)
7070
const [selectedPaymentProvider, setSelectedPaymentProvider] = useState<string | undefined>(undefined)
7171
const [providerToSet, setProviderToSet] = useState<string | undefined>(undefined)
7272
const [transactionId, setTransactionId] = useState<string | undefined>(undefined)
@@ -263,7 +263,6 @@ const PaymentsTab: FC<PaymentsTabProps> = (props: PaymentsTabProps) => {
263263
onClose={() => {
264264
setProviderToSet(undefined)
265265
}}
266-
onResendClick={() => {}}
267266
onOtpVerified={() => {
268267
window.open(registrationLink, '_blank')
269268

src/apps/wallet/src/home/tabs/payments/payment-info-modal/PaymentInfoModal.tsx

+8-7
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ function renderPayoneer(): JSX.Element {
2323
transfer option (where available) and a wire transfer option. Certain fees may apply.
2424
</p>
2525
<p>
26-
You will be directed to Payoneer's website in a new tab to complete your the connection. Please make
27-
sure your account is fully verified to ensure withdrawal success.{' '}
28-
<strong>You can return here after finishing up on Payoneer's site.</strong>
26+
You will be directed to Payoneer&apos;s website in a new tab to complete your the connection. Please
27+
make sure your account is fully verified to ensure withdrawal success.
28+
<strong>You can return here after finishing up on Payoneer&apos;s site.</strong>
2929
</p>
3030
</>
3131
)
@@ -37,9 +37,9 @@ function renderPaypal(): JSX.Element {
3737
<PayPalLogo />
3838
<p>You can elect to receive payments deposited directly to your PayPal account. Certain fees may apply.</p>
3939
<p>
40-
You will be directed to PayPal's website in a new tab to complete your the connection. Please make sure
41-
your account is fully verified to ensure withdrawal success. You can return here after finishing up on
42-
PayPal's site.
40+
You will be directed to PayPal&apos;s website in a new tab to complete your the connection. Please make
41+
sure your account is fully verified to ensure withdrawal success. You can return here after finishing up
42+
on PayPal&apos;s site.
4343
</p>
4444
</>
4545
)
@@ -62,7 +62,8 @@ const PaymentInfoModal: FC<PaymentInfoModalProps> = (props: PaymentInfoModalProp
6262
open
6363
size='body'
6464
title='CONNECT PAYMENT PROVIDER ACCOUNT'
65-
classNames={{ modal: styles.infoModal }}>
65+
classNames={{ modal: styles.infoModal }}
66+
>
6667
<div className={styles.modalContent}>
6768
{props.selectedPaymentProvider === 'Payoneer' ? renderPayoneer() : renderPaypal()}
6869
</div>

src/apps/wallet/src/home/tabs/tax-forms/TaxFormsTab.tsx

+13-13
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const PaymentsTab: FC<TaxFormsTabProps> = (props: TaxFormsTabProps) => {
6868
const [setupRequired, setSetupRequired] = useState<boolean | undefined>(undefined)
6969
const [taxForm, setTaxForm] = useState<TaxForm | undefined>(undefined)
7070
const [isLoading, setIsLoading] = useState(false)
71-
const [taxFormToSetup, setTaxFormToSetup] = useState<string | undefined>(undefined)
71+
const [, setTaxFormToSetup] = useState<string | undefined>(undefined)
7272
const [taxFormSetupData, setTaxFormSetupData] = useState<SetupTaxFormResponse | undefined>(undefined)
7373

7474
const fetchUserTaxForms = async () => {
@@ -97,21 +97,21 @@ const PaymentsTab: FC<TaxFormsTabProps> = (props: TaxFormsTabProps) => {
9797
function renderAllTaxForms(): JSX.Element {
9898
return (
9999
<div className={styles.stacked}>
100-
{TAX_FORM_DETAILS.map((taxForm) => (
100+
{TAX_FORM_DETAILS.map(form => (
101101
<TaxFormCard
102-
key={taxForm.id}
103-
formTitle={taxForm.formTitle}
104-
formDescription={taxForm.formDescription}
105-
reasonTitle={taxForm.reasonTitle}
106-
reasonDescription={taxForm.reasonDescription}
107-
completionLabel={taxForm.completionLabel}
108-
instructionsLabel={taxForm.instructionsLabel}
109-
instructionsLink={taxForm.instructionsLink}
110-
additionalInfo={taxForm.additionalInfo}
111-
icon={taxForm.icon}
102+
key={form.id}
103+
formTitle={form.formTitle}
104+
formDescription={form.formDescription}
105+
reasonTitle={form.reasonTitle}
106+
reasonDescription={form.reasonDescription}
107+
completionLabel={form.completionLabel}
108+
instructionsLabel={form.instructionsLabel}
109+
instructionsLink={form.instructionsLink}
110+
additionalInfo={form.additionalInfo}
111+
icon={form.icon}
112112
onSetupClick={async () => {
113113
try {
114-
const setupTaxFormResponse = await setupTaxForm(`${props.profile.userId}`, taxForm.id)
114+
const setupTaxFormResponse = await setupTaxForm(`${props.profile.userId}`, form.id)
115115
setTaxFormSetupData(setupTaxFormResponse)
116116

117117
fetchUserTaxForms()

src/apps/wallet/src/home/tabs/winnings/WinningsTab.tsx

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
import React, { FC, useEffect, useMemo } from 'react'
1+
/* eslint-disable react/jsx-no-bind */
2+
import React, { FC, useEffect } from 'react'
23

3-
import { LoadingCircles, Table, TableColumn } from '~/libs/ui'
4+
import { LoadingCircles } from '~/libs/ui'
45
import { UserProfile } from '~/libs/core'
6+
57
import { getPayments, processPayments } from '../../../lib/services/wallet'
68
import { Winning, WinningDetail } from '../../../lib/models/WinningDetail'
7-
89
import PaymentsTable from '../../../lib/components/payments-table/PaymentTable'
10+
911
import styles from './Winnings.module.scss'
1012

1113
interface ListViewProps {
@@ -36,6 +38,7 @@ const ListView: FC<ListViewProps> = (props: ListViewProps) => {
3638
const [winnings, setWinnings] = React.useState<ReadonlyArray<Winning>>([])
3739
const [isLoading, setIsLoading] = React.useState<boolean>(false)
3840

41+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
3942
const fetchWinnings = async () => {
4043
setIsLoading(true)
4144
try {
@@ -54,7 +57,7 @@ const ListView: FC<ListViewProps> = (props: ListViewProps) => {
5457
const tempWinnings: Winning[] = []
5558

5659
payments.forEach((payment: WinningDetail) => {
57-
payment.details.forEach((detail) => {
60+
payment.details.forEach(detail => {
5861
const winning: Winning = {
5962
createDate: formatIOSDateString(payment.createdAt),
6063
datePaid: '',
@@ -83,7 +86,7 @@ const ListView: FC<ListViewProps> = (props: ListViewProps) => {
8386
{!isLoading && (
8487
<PaymentsTable
8588
payments={winnings}
86-
onPayMeClick={async (paymentIds) => {
89+
onPayMeClick={async paymentIds => {
8790
const ids = Object.keys(paymentIds)
8891
await processPayments(ids)
8992

src/apps/wallet/src/lib/components/info-row/InfoRow.tsx

+8-10
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,14 @@ interface InfoRowProps {
88
action?: React.ReactNode
99
}
1010

11-
const InfoRow: React.FC<InfoRowProps> = ({ title, value, action }) => {
12-
return (
13-
<div className={styles['info-row']}>
14-
<div className={styles.title}>{title}</div>
15-
<div className={styles['value-action-container']}>
16-
<div className={styles.value}>{value}</div>
17-
{action && <div className={styles.action}>{action}</div>}
18-
</div>
11+
const InfoRow: React.FC<InfoRowProps> = (props: InfoRowProps) => (
12+
<div className={styles['info-row']}>
13+
<div className={styles.title}>{props.title}</div>
14+
<div className={styles['value-action-container']}>
15+
<div className={styles.value}>{props.value}</div>
16+
{props.action && <div className={styles.action}>{props.action}</div>}
1917
</div>
20-
)
21-
}
18+
</div>
19+
)
2220

2321
export default InfoRow

src/apps/wallet/src/lib/components/otp-modal/OtpModal.tsx

+6-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const OtpModal = ({
2323
key: string
2424
transactionId: string
2525
onClose: () => void
26-
onResendClick: () => void
26+
onResendClick?: () => void
2727
onOtpVerified: (key: string) => void
2828
}) => {
2929
const [otp, setOtp] = React.useState('')
@@ -60,7 +60,11 @@ const OtpModal = ({
6060
<div className={styles['otp-modal']}>
6161
{error && <p className={styles.error}>{error}</p>}
6262
<p>
63-
For added security we’ve sent a 6-digit code to your <strong>***@gmail.com</strong> email. The code
63+
For added security we’ve sent a 6-digit code to your
64+
{' '}
65+
<strong>***@gmail.com</strong>
66+
{' '}
67+
email. The code
6468
expires shortly, so please enter it soon.
6569
</p>
6670
<OTPInput

src/apps/wallet/src/lib/components/payment-provider-card/PaymentProviderCard.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ const PaymentProviderCard: React.FC<PaymentProviderProps> = (props: PaymentProvi
5858

5959
<div
6060
className={`${styles.detailContainer} ${isVerified ? styles.singleRow : styles.stackedRows}`}
61-
style={detailContainerStyle}>
61+
style={detailContainerStyle}
62+
>
6263
{props.details.map((detail: Detail) => (
6364
<div key={detail.label} className={styles.detail}>
6465
<div className={styles.iconLabelContainer}>

src/apps/wallet/src/lib/components/payments-table/PaymentTable.tsx

+18-13
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* eslint-disable react/jsx-no-bind */
2+
/* eslint-disable @typescript-eslint/explicit-function-return-type */
13
import React, { useState } from 'react'
24

35
import { Button } from '~/libs/ui'
@@ -14,34 +16,33 @@ const PaymentsTable: React.FC<PaymentTableProps> = (props: PaymentTableProps) =>
1416
const [selectedPayments, setSelectedPayments] = useState<{ [paymentId: string]: boolean }>({})
1517

1618
const togglePaymentSelection = (paymentId: string) => {
17-
setSelectedPayments((prevSelected) => ({
19+
setSelectedPayments(prevSelected => ({
1820
...prevSelected,
1921
[paymentId]: !prevSelected[paymentId],
2022
}))
2123
}
2224

23-
const isAllSelected = props.payments.length > 0 && props.payments.every((payment) => selectedPayments[payment.id])
25+
const isAllSelected = props.payments.length > 0 && props.payments.every(payment => selectedPayments[payment.id])
2426

2527
const toggleAllPayments = () => {
2628
if (isAllSelected) {
2729
setSelectedPayments({})
2830
} else {
2931
const newSelections: { [paymentId: string]: boolean } = {}
30-
props.payments.forEach((payment) => {
32+
props.payments.forEach(payment => {
3133
newSelections[payment.id] = true
3234
})
3335
setSelectedPayments(newSelections)
3436
}
3537
}
3638

37-
const calculateTotal = () =>
38-
props.payments.reduce((acc: number, payment: Winning) => {
39-
if (selectedPayments[payment.id]) {
40-
return acc + parseFloat(payment.netPayment.replace(/[^0-9.-]+/g, ''))
41-
}
39+
const calculateTotal = () => props.payments.reduce((acc: number, payment: Winning) => {
40+
if (selectedPayments[payment.id]) {
41+
return acc + parseFloat(payment.netPayment.replace(/[^0-9.-]+/g, ''))
42+
}
4243

43-
return acc
44-
}, 0)
44+
return acc
45+
}, 0)
4546

4647
const total = calculateTotal()
4748

@@ -70,7 +71,7 @@ const PaymentsTable: React.FC<PaymentTableProps> = (props: PaymentTableProps) =>
7071
</tr>
7172
</thead>
7273
<tbody>
73-
{props.payments.map((payment) => (
74+
{props.payments.map(payment => (
7475
<tr key={payment.id} className={selectedPayments[payment.id] ? 'selected' : ''}>
7576
<td className='body-main'>{payment.description}</td>
7677
<td className='body-main-bold'>{payment.type}</td>
@@ -95,12 +96,16 @@ const PaymentsTable: React.FC<PaymentTableProps> = (props: PaymentTableProps) =>
9596
</table>
9697
</div>
9798
<div className={styles.paymentFooter}>
98-
<div className={styles.total}>Total: ${total.toFixed(2)}</div>
99+
<div className={styles.total}>
100+
Total: $
101+
{total.toFixed(2)}
102+
</div>
99103
<Button
100104
primary
101105
onClick={() => {
102106
props.onPayMeClick(selectedPayments)
103-
}}>
107+
}}
108+
>
104109
PAY ME
105110
</Button>
106111
</div>

src/apps/wallet/src/lib/components/tax-form-card/TaxFormCard.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ const TaxFormCard: React.FC<TaxFormCardProps> = (props: TaxFormCardProps) => (
7070
<Button
7171
secondary
7272
label={props.instructionsLabel}
73+
// eslint-disable-next-line react/jsx-no-bind
7374
onClick={() => {
7475
window.location.href = props.instructionsLink
7576
}}

src/apps/wallet/src/wallet.routes.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { AppSubdomain, EnvironmentConfig, ToolTitle } from '~/config'
44
const WalletApp: LazyLoadedComponent = lazyLoad(() => import('./WalletApp'))
55
const WalletHomePage: LazyLoadedComponent = lazyLoad(
66
() => import('./home'),
7-
'WalletHomePage'
7+
'WalletHomePage',
88
)
99

1010
// prettier-ignore

0 commit comments

Comments
 (0)