@huma-finance/widgets 0.0.12 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/API.md +6 -5
- package/dist/cjs/index.cjs +5058 -5968
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/index.d.ts +9 -6
- package/dist/index.js +5059 -5969
- package/dist/index.js.map +1 -1
- package/package.json +16 -16
- package/src/components/ApproveAllowanceModal.tsx +5 -2
- package/src/components/ChainNotSupportedModal.tsx +33 -0
- package/src/components/ChooseAmountModal.tsx +322 -322
- package/src/components/ConfirmTransferModal.tsx +153 -0
- package/src/components/CreditLine/borrow/1-Evaluation.tsx +1 -2
- package/src/components/CreditLine/borrow/index.tsx +4 -6
- package/src/components/Factoring/FactoredList.tsx +1 -1
- package/src/components/InvoiceFactoring/borrow/1-Evaluation.tsx +1 -4
- package/src/components/InvoiceFactoring/borrow/{3-ChooseAmount.tsx → 2-ChooseAmount.tsx} +5 -3
- package/src/components/InvoiceFactoring/borrow/3-ConfirmTransfer.tsx +37 -0
- package/src/components/InvoiceFactoring/borrow/index.tsx +5 -7
- package/src/components/StreamFactoring/borrow/1-Evaluation.tsx +12 -4
- package/src/components/StreamFactoring/borrow/2-ChooseAmount.tsx +4 -1
- package/src/components/StreamFactoring/borrow/3-ConfirmTransfer.tsx +18 -80
- package/src/components/StreamFactoring/borrow/4-ApproveAllowance.tsx +4 -36
- package/src/components/StreamFactoring/borrow/5-Permit.tsx +14 -14
- package/src/components/SuperfluidFactoring/SuperfluidFactoredList.tsx +10 -1
- package/src/components/SuperfluidFactoring/SuperfluidUpcomingList.tsx +4 -22
- package/src/cosmos/CreditLineBorrow.fixture.tsx +1 -0
- package/src/cosmos/CreditLinePayment.fixture.tsx +1 -0
- package/src/cosmos/SDKTesting.fixture.tsx +615 -615
- package/src/cosmos/SuperfluidFactoringBorrow.fixture.tsx +3 -0
- package/src/cosmos/utils/env.ts +6 -0
- package/src/hooks/useEA.ts +10 -29
- package/src/index.tsx +88 -7
- package/src/reportWebVitals.ts +9 -9
- package/src/store/widgets.store.ts +0 -1
- package/src/utilTypes.d.ts +2 -0
- package/webpack.cosmos.js +9 -9
- package/src/components/AllowListModal.tsx +0 -113
- package/src/components/CreditLine/borrow/2-AllowList.tsx +0 -34
- package/src/components/InvoiceFactoring/borrow/2-AllowList.tsx +0 -34
- package/src/components/InvoiceFactoring/borrow/4-ConfirmTransfer.tsx +0 -104
- /package/src/components/CreditLine/borrow/{3-ChooseAmount.tsx → 2-ChooseAmount.tsx} +0 -0
- /package/src/components/CreditLine/borrow/{4-Transfer.tsx → 3-Transfer.tsx} +0 -0
- /package/src/components/CreditLine/borrow/{5-ApproveAllowance.tsx → 4-ApproveAllowance.tsx} +0 -0
- /package/src/components/CreditLine/borrow/{6-Success.tsx → 5-Success.tsx} +0 -0
- /package/src/components/InvoiceFactoring/borrow/{5-ApproveNFT.tsx → 4-ApproveNFT.tsx} +0 -0
- /package/src/components/InvoiceFactoring/borrow/{6-Transfer.tsx → 5-Transfer.tsx} +0 -0
- /package/src/components/InvoiceFactoring/borrow/{7-Success.tsx → 6-Success.tsx} +0 -0
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { gql, useQuery } from '@apollo/client'
|
|
2
2
|
import { EmotionJSX } from '@emotion/react/types/jsx-namespace'
|
|
3
|
-
import { Button } from '@mui/material'
|
|
4
|
-
import { useWeb3React } from '@web3-react/core'
|
|
5
|
-
import { History } from 'history'
|
|
6
3
|
import {
|
|
7
4
|
downScale,
|
|
8
5
|
getWalletAddressAbbr,
|
|
9
6
|
PoolInfoType,
|
|
10
7
|
toBigNumber,
|
|
11
8
|
} from '@huma-finance/shared'
|
|
9
|
+
import { Button } from '@mui/material'
|
|
10
|
+
import { useWeb3React } from '@web3-react/core'
|
|
12
11
|
import React, { useCallback, useEffect, useState } from 'react'
|
|
13
|
-
import { useHistory } from 'react-router'
|
|
14
12
|
|
|
15
13
|
import { ColumnType } from '../../utilTypes'
|
|
16
14
|
import { TableActionButton } from '../buttons'
|
|
@@ -71,7 +69,6 @@ type Props = {
|
|
|
71
69
|
const getUpcomingColumns = (
|
|
72
70
|
userHasActiveLoan: boolean,
|
|
73
71
|
handleGetPaid: (id: StreamItem) => void,
|
|
74
|
-
history: History,
|
|
75
72
|
): ColumnType<StreamItem>[] => [
|
|
76
73
|
{
|
|
77
74
|
title: '',
|
|
@@ -86,20 +83,6 @@ const getUpcomingColumns = (
|
|
|
86
83
|
dataIndex: 'payerAbbr',
|
|
87
84
|
},
|
|
88
85
|
{ title: 'Flow rate', dataIndex: 'flowrateMonth' },
|
|
89
|
-
{
|
|
90
|
-
title: 'Payer Approve',
|
|
91
|
-
action: (record) => (
|
|
92
|
-
<TableActionButton
|
|
93
|
-
title='Go To Approve'
|
|
94
|
-
handleClick={() =>
|
|
95
|
-
history.push(
|
|
96
|
-
`/superfluid?payer=${record.payer}&superToken=${record.tokenId}`,
|
|
97
|
-
)
|
|
98
|
-
}
|
|
99
|
-
disabled={userHasActiveLoan}
|
|
100
|
-
/>
|
|
101
|
-
),
|
|
102
|
-
},
|
|
103
86
|
{
|
|
104
87
|
title: 'Get Paid',
|
|
105
88
|
action: (record) => (
|
|
@@ -118,7 +101,6 @@ export function SuperfluidUpcomingList({
|
|
|
118
101
|
loading,
|
|
119
102
|
handleGetPaid,
|
|
120
103
|
}: Props): React.ReactElement {
|
|
121
|
-
const history = useHistory()
|
|
122
104
|
const { account, isActive } = useWeb3React()
|
|
123
105
|
const [streams, setStreams] = useState<StreamItem[] | undefined>()
|
|
124
106
|
const { data } = useQuery<{ streams: Stream[] }>(GET_RECEIVED_STREAMS, {
|
|
@@ -139,7 +121,7 @@ export function SuperfluidUpcomingList({
|
|
|
139
121
|
if (Number(Number(flowrateMonth).toFixed(0)) > 0) {
|
|
140
122
|
return {
|
|
141
123
|
id: item.id,
|
|
142
|
-
icon: <ReceiptIcon css={{ width: '
|
|
124
|
+
icon: <ReceiptIcon css={{ width: '24px' }} />,
|
|
143
125
|
token: item.token.symbol,
|
|
144
126
|
tokenId: item.token.id,
|
|
145
127
|
payer: item.sender.id,
|
|
@@ -161,7 +143,7 @@ export function SuperfluidUpcomingList({
|
|
|
161
143
|
<UpcomingList<StreamItem>
|
|
162
144
|
items={streams}
|
|
163
145
|
loading={loading}
|
|
164
|
-
columns={getUpcomingColumns(hasActiveLoan, handleGetPaid
|
|
146
|
+
columns={getUpcomingColumns(hasActiveLoan, handleGetPaid)}
|
|
165
147
|
title='Ongoing Streams'
|
|
166
148
|
connectWalletDesc='Please connect wallet to check your ongoing streams.'
|
|
167
149
|
noItemDesc='You don’t have any ongoing streams eligible for factoring. For now, you can click the button
|