@huma-finance/widgets 0.0.78-beta.1034 → 0.0.78-beta.1042
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/dist/index.js +12130 -10899
- package/dist/src/components/Lend/solanaWithdraw/1-Option.d.ts +12 -0
- package/dist/src/components/Lend/solanaWithdraw/2-WithdrawAndDepositConfirm.d.ts +15 -0
- package/dist/src/components/Lend/solanaWithdraw/{1-ConfirmTransfer.d.ts → 3-WithdrawOnlyConfirm.d.ts} +1 -1
- package/dist/src/components/Lend/solanaWithdraw/4-TransferAndDeposit.d.ts +13 -0
- package/dist/src/components/Lend/solanaWithdraw/{3-Done.d.ts → 6-Done.d.ts} +3 -1
- package/dist/src/components/Lend/solanaWithdraw/components/Apy.d.ts +7 -0
- package/dist/src/components/Lend/solanaWithdraw/components/Benefit.d.ts +2 -0
- package/dist/src/components/Lend/solanaWithdraw/components/CommitSwitcher.d.ts +12 -0
- package/dist/src/components/Lend/solanaWithdraw/components/ModeSelector.d.ts +12 -0
- package/dist/src/components/Lend/solanaWithdraw/components/SelectModeTitle.d.ts +2 -0
- package/dist/src/components/Lend/solanaWithdraw/index.d.ts +10 -0
- package/dist/src/components/TxDoneModal.d.ts +1 -1
- package/dist/src/components/WidgetWrapper.d.ts +2 -1
- package/dist/src/components/icons/index.d.ts +7 -0
- package/dist/src/store/widgets.store.d.ts +3 -0
- package/package.json +5 -5
- package/src/components/Lend/solanaWithdraw/1-Option.tsx +180 -0
- package/src/components/Lend/solanaWithdraw/2-WithdrawAndDepositConfirm.tsx +208 -0
- package/src/components/Lend/solanaWithdraw/{1-ConfirmTransfer.tsx → 3-WithdrawOnlyConfirm.tsx} +2 -2
- package/src/components/Lend/solanaWithdraw/4-TransferAndDeposit.tsx +274 -0
- package/src/components/Lend/solanaWithdraw/{3-Done.tsx → 6-Done.tsx} +22 -2
- package/src/components/Lend/solanaWithdraw/components/Apy.tsx +126 -0
- package/src/components/Lend/solanaWithdraw/components/Benefit.tsx +63 -0
- package/src/components/Lend/solanaWithdraw/components/CommitSwitcher.tsx +198 -0
- package/src/components/Lend/solanaWithdraw/components/ModeSelector.tsx +148 -0
- package/src/components/Lend/solanaWithdraw/components/SelectModeTitle.tsx +61 -0
- package/src/components/Lend/solanaWithdraw/index.tsx +102 -12
- package/src/components/TxDoneModal.tsx +3 -3
- package/src/components/WidgetWrapper.tsx +3 -1
- package/src/components/icons/huma-no-empty-space.svg +15 -0
- package/src/components/icons/index.tsx +49 -14
- package/src/components/icons/minus-sign-inactive.svg +4 -0
- package/src/components/icons/minus-sign.svg +14 -0
- package/src/components/icons/mode-classic.svg +3 -0
- package/src/components/icons/mode-maxi.svg +3 -0
- package/src/components/icons/plus-sign-inactive.svg +4 -0
- package/src/components/icons/plus-sign.svg +14 -0
- package/src/hooks/useLogOnFirstMount.ts +1 -1
- package/src/store/widgets.store.ts +3 -0
- /package/dist/src/components/Lend/solanaWithdraw/{2-Transfer.d.ts → 5-Transfer.d.ts} +0 -0
- /package/src/components/Lend/solanaWithdraw/{2-Transfer.tsx → 5-Transfer.tsx} +0 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { PermissionlessDepositMode, toPercentage } from '@huma-finance/shared'
|
|
2
|
+
import { Box, css, useTheme } from '@mui/material'
|
|
3
|
+
import React from 'react'
|
|
4
|
+
import { ModeClassicIcon, ModeMaxiIcon } from '../../../icons'
|
|
5
|
+
|
|
6
|
+
type Props = {
|
|
7
|
+
classicModeTargetApy: number | undefined
|
|
8
|
+
maxiModeTargetApy: number | undefined
|
|
9
|
+
classicHumaRewardsApy: number | undefined
|
|
10
|
+
maxiHumaRewardsApy: number | undefined
|
|
11
|
+
selectedDepositMode: PermissionlessDepositMode
|
|
12
|
+
setSelectedDepositMode: (mode: PermissionlessDepositMode) => void
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function ModeSelector({
|
|
16
|
+
classicModeTargetApy,
|
|
17
|
+
maxiModeTargetApy,
|
|
18
|
+
classicHumaRewardsApy,
|
|
19
|
+
maxiHumaRewardsApy,
|
|
20
|
+
selectedDepositMode,
|
|
21
|
+
setSelectedDepositMode,
|
|
22
|
+
}: Props): React.ReactElement {
|
|
23
|
+
const theme = useTheme()
|
|
24
|
+
|
|
25
|
+
const styles = {
|
|
26
|
+
modes: css`
|
|
27
|
+
display: flex;
|
|
28
|
+
justify-content: space-between;
|
|
29
|
+
align-items: center;
|
|
30
|
+
margin-top: ${theme.spacing(1)};
|
|
31
|
+
gap: ${theme.spacing(1)};
|
|
32
|
+
`,
|
|
33
|
+
modeContainer: css`
|
|
34
|
+
padding: ${theme.spacing(0.125)};
|
|
35
|
+
width: 100%;
|
|
36
|
+
`,
|
|
37
|
+
modeContainerSelected: css`
|
|
38
|
+
border-radius: 8px;
|
|
39
|
+
background: linear-gradient(190deg, #d157ff 4.58%, #74deff 100%);
|
|
40
|
+
box-shadow: 2px 2px 24px 1px #272727;
|
|
41
|
+
`,
|
|
42
|
+
mode: css`
|
|
43
|
+
display: flex;
|
|
44
|
+
flex-direction: column;
|
|
45
|
+
gap: ${theme.spacing(1)};
|
|
46
|
+
padding: ${theme.spacing(2, 3)};
|
|
47
|
+
cursor: pointer;
|
|
48
|
+
background: #1b1b1b;
|
|
49
|
+
border-radius: 8px;
|
|
50
|
+
`,
|
|
51
|
+
modeSelected: css`
|
|
52
|
+
color: #ececec;
|
|
53
|
+
`,
|
|
54
|
+
modeTitle: css`
|
|
55
|
+
display: flex;
|
|
56
|
+
justify-content: flex-start;
|
|
57
|
+
align-items: center;
|
|
58
|
+
gap: ${theme.spacing(1)};
|
|
59
|
+
font-size: 16px;
|
|
60
|
+
font-weight: 500;
|
|
61
|
+
`,
|
|
62
|
+
modeTitleClassic: css`
|
|
63
|
+
color: #74deff;
|
|
64
|
+
`,
|
|
65
|
+
modeTitleMaxi: css`
|
|
66
|
+
color: #c677ff;
|
|
67
|
+
`,
|
|
68
|
+
modeApy: css`
|
|
69
|
+
font-size: 16px;
|
|
70
|
+
font-weight: 500;
|
|
71
|
+
color: #848484;
|
|
72
|
+
margin-top: ${theme.spacing(1)};
|
|
73
|
+
`,
|
|
74
|
+
modeHumaRewardsApy: css`
|
|
75
|
+
font-size: 16px;
|
|
76
|
+
font-weight: 500;
|
|
77
|
+
color: #848484;
|
|
78
|
+
margin-top: ${theme.spacing(-1)};
|
|
79
|
+
`,
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const getMode = (mode: PermissionlessDepositMode) => {
|
|
83
|
+
const modeInfos = {
|
|
84
|
+
[PermissionlessDepositMode.CLASSIC]: {
|
|
85
|
+
icon: <ModeClassicIcon />,
|
|
86
|
+
title: 'Classic',
|
|
87
|
+
apy: classicModeTargetApy,
|
|
88
|
+
humaRewardsApy: classicHumaRewardsApy,
|
|
89
|
+
},
|
|
90
|
+
[PermissionlessDepositMode.MAXI]: {
|
|
91
|
+
icon: <ModeMaxiIcon />,
|
|
92
|
+
title: 'Maxi',
|
|
93
|
+
apy: maxiModeTargetApy,
|
|
94
|
+
humaRewardsApy: maxiHumaRewardsApy,
|
|
95
|
+
},
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const modeInfo = modeInfos[mode]
|
|
99
|
+
|
|
100
|
+
return (
|
|
101
|
+
<Box
|
|
102
|
+
css={[
|
|
103
|
+
styles.modeContainer,
|
|
104
|
+
selectedDepositMode === mode && styles.modeContainerSelected,
|
|
105
|
+
]}
|
|
106
|
+
onClick={() => setSelectedDepositMode(mode)}
|
|
107
|
+
>
|
|
108
|
+
<Box css={styles.mode}>
|
|
109
|
+
<Box css={styles.modeTitle}>
|
|
110
|
+
{modeInfo.icon}
|
|
111
|
+
<Box
|
|
112
|
+
css={
|
|
113
|
+
mode === PermissionlessDepositMode.CLASSIC
|
|
114
|
+
? styles.modeTitleClassic
|
|
115
|
+
: styles.modeTitleMaxi
|
|
116
|
+
}
|
|
117
|
+
>
|
|
118
|
+
{modeInfo.title}
|
|
119
|
+
</Box>
|
|
120
|
+
</Box>
|
|
121
|
+
<Box
|
|
122
|
+
css={[
|
|
123
|
+
styles.modeApy,
|
|
124
|
+
selectedDepositMode === mode && styles.modeSelected,
|
|
125
|
+
]}
|
|
126
|
+
>
|
|
127
|
+
{toPercentage(modeInfo.apy, 1)} USDC APY
|
|
128
|
+
</Box>
|
|
129
|
+
<Box
|
|
130
|
+
css={[
|
|
131
|
+
styles.modeHumaRewardsApy,
|
|
132
|
+
selectedDepositMode === mode && styles.modeSelected,
|
|
133
|
+
]}
|
|
134
|
+
>
|
|
135
|
+
{toPercentage(modeInfo.humaRewardsApy, 1)} Est. $HUMA
|
|
136
|
+
</Box>
|
|
137
|
+
</Box>
|
|
138
|
+
</Box>
|
|
139
|
+
)
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
return (
|
|
143
|
+
<Box css={styles.modes}>
|
|
144
|
+
{getMode(PermissionlessDepositMode.CLASSIC)}
|
|
145
|
+
{getMode(PermissionlessDepositMode.MAXI)}
|
|
146
|
+
</Box>
|
|
147
|
+
)
|
|
148
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import InfoOutlineIcon from '@mui/icons-material/InfoOutlined'
|
|
2
|
+
import { Box, css, Tooltip, useTheme } from '@mui/material'
|
|
3
|
+
import React from 'react'
|
|
4
|
+
|
|
5
|
+
export function SelectModeTitle(): React.ReactElement {
|
|
6
|
+
const theme = useTheme()
|
|
7
|
+
|
|
8
|
+
const styles = {
|
|
9
|
+
selectDepositMode: css`
|
|
10
|
+
display: flex;
|
|
11
|
+
justify-content: flex-start;
|
|
12
|
+
align-items: center;
|
|
13
|
+
margin-top: ${theme.spacing(2)};
|
|
14
|
+
gap: ${theme.spacing(0.5)};
|
|
15
|
+
`,
|
|
16
|
+
selectDepositModeTitle: css`
|
|
17
|
+
font-weight: 700;
|
|
18
|
+
font-size: 16px;
|
|
19
|
+
color: #b8b8b8;
|
|
20
|
+
`,
|
|
21
|
+
infoIcon: css`
|
|
22
|
+
width: 16px;
|
|
23
|
+
height: 16px;
|
|
24
|
+
color: #686868;
|
|
25
|
+
`,
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<Box css={styles.selectDepositMode}>
|
|
30
|
+
<Box css={styles.selectDepositModeTitle}>Select deposit mode</Box>
|
|
31
|
+
<Tooltip
|
|
32
|
+
title={
|
|
33
|
+
<Box>
|
|
34
|
+
<Box>
|
|
35
|
+
Huma Permissionless offers two modes to match different LP
|
|
36
|
+
strategies. You can switch between them anytime, as often as you
|
|
37
|
+
like.
|
|
38
|
+
</Box>
|
|
39
|
+
<ul>
|
|
40
|
+
<li>
|
|
41
|
+
<strong>Classic Mode:</strong> Provides stable yield with
|
|
42
|
+
moderate Huma rewards. The current APY is 10%, updated monthly
|
|
43
|
+
based on market conditions. This mode is ideal for LPs who
|
|
44
|
+
prioritize consistent income.
|
|
45
|
+
</li>
|
|
46
|
+
<li>
|
|
47
|
+
<strong>Maxi Mode:</strong> Offers maximum Huma rewards by
|
|
48
|
+
trading away stable yield. LPs in this mode earn only Huma
|
|
49
|
+
rewards, making it the go-to choice for Huma-maximizing
|
|
50
|
+
believers—aka the Huma maxis.
|
|
51
|
+
</li>
|
|
52
|
+
</ul>
|
|
53
|
+
</Box>
|
|
54
|
+
}
|
|
55
|
+
placement='top'
|
|
56
|
+
>
|
|
57
|
+
<InfoOutlineIcon css={styles.infoIcon} />
|
|
58
|
+
</Tooltip>
|
|
59
|
+
</Box>
|
|
60
|
+
)
|
|
61
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
formatNumberFixed,
|
|
3
|
+
PermissionlessDepositCommitment,
|
|
4
|
+
PermissionlessDepositMode,
|
|
3
5
|
SolanaPoolInfo,
|
|
4
6
|
SolanaTokenUtils,
|
|
5
7
|
TrancheType,
|
|
@@ -24,9 +26,43 @@ import {
|
|
|
24
26
|
import { WIDGET_STEP } from '../../../store/widgets.store'
|
|
25
27
|
import { ErrorModal } from '../../ErrorModal'
|
|
26
28
|
import { WidgetWrapper } from '../../WidgetWrapper'
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
29
|
+
import { Option } from './1-Option'
|
|
30
|
+
import { WithdrawAndDepositConfirm } from './2-WithdrawAndDepositConfirm'
|
|
31
|
+
import { WithdrawOnlyConfirm } from './3-WithdrawOnlyConfirm'
|
|
32
|
+
import { TransferAndDeposit } from './4-TransferAndDeposit'
|
|
33
|
+
import { Transfer } from './5-Transfer'
|
|
34
|
+
import { Done } from './6-Done'
|
|
35
|
+
|
|
36
|
+
export enum WithdrawOption {
|
|
37
|
+
WITHDRAW_AND_REDEPOSIT = 'withdraw-and-redeposit',
|
|
38
|
+
WITHDRAW_ONLY = 'withdraw-only',
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export type ClaimAndStakeOption = {
|
|
42
|
+
label: string
|
|
43
|
+
description?: string[]
|
|
44
|
+
id: string
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export const ClaimAndStakeOptions: ClaimAndStakeOption[] = [
|
|
48
|
+
{
|
|
49
|
+
label: 'Withdraw and redeposit to Permissionless',
|
|
50
|
+
description: [
|
|
51
|
+
'Keep your OG status and unlock boosted yield forever',
|
|
52
|
+
'Choose your own investment lockup periods',
|
|
53
|
+
'Earn incentives for longer commitments',
|
|
54
|
+
'Earn Vanguard status',
|
|
55
|
+
],
|
|
56
|
+
id: WithdrawOption.WITHDRAW_AND_REDEPOSIT,
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
label: `Withdraw only`,
|
|
60
|
+
id: WithdrawOption.WITHDRAW_ONLY,
|
|
61
|
+
description: [
|
|
62
|
+
'You need to have at least $100 USDC in Permissionless to keep your OG status',
|
|
63
|
+
],
|
|
64
|
+
},
|
|
65
|
+
]
|
|
30
66
|
|
|
31
67
|
/**
|
|
32
68
|
* Solana lend pool withdraw props
|
|
@@ -73,6 +109,13 @@ export function SolanaLendWithdraw({
|
|
|
73
109
|
)
|
|
74
110
|
const [withdrawnAmount, setWithdrawnAmount] = useState<BN>()
|
|
75
111
|
const loggingHelper = useAppSelector(selectWidgetLoggingContext)
|
|
112
|
+
const [selectedOption, setSelectedOption] = useState(ClaimAndStakeOptions[0])
|
|
113
|
+
const [selectedDepositMode, setSelectedDepositMode] = useState(
|
|
114
|
+
PermissionlessDepositMode.CLASSIC,
|
|
115
|
+
)
|
|
116
|
+
const [selectedDepositCommitment, setSelectedDepositCommitment] = useState(
|
|
117
|
+
PermissionlessDepositCommitment.INITIAL_COMMITMENT_SIX_MONTHS,
|
|
118
|
+
)
|
|
76
119
|
|
|
77
120
|
const handleCloseFlow = () => {
|
|
78
121
|
loggingHelper.logAction('ExitFlow', {})
|
|
@@ -102,7 +145,7 @@ export function SolanaLendWithdraw({
|
|
|
102
145
|
loggingHelperInit.logAction('StartFlow', {})
|
|
103
146
|
dispatch(setLoggingContext(context))
|
|
104
147
|
|
|
105
|
-
dispatch(setStep(WIDGET_STEP.
|
|
148
|
+
dispatch(setStep(WIDGET_STEP.Option))
|
|
106
149
|
}
|
|
107
150
|
}, [dispatch, poolInfo.chainId, poolInfo.poolName, poolInfo.poolType, step])
|
|
108
151
|
|
|
@@ -128,6 +171,18 @@ export function SolanaLendWithdraw({
|
|
|
128
171
|
trancheType,
|
|
129
172
|
])
|
|
130
173
|
|
|
174
|
+
const handleConfirmOption = useCallback(() => {
|
|
175
|
+
if (selectedOption.id === WithdrawOption.WITHDRAW_AND_REDEPOSIT) {
|
|
176
|
+
dispatch(setStep(WIDGET_STEP.ConfirmWithdrawAndDeposit))
|
|
177
|
+
} else {
|
|
178
|
+
dispatch(setStep(WIDGET_STEP.ConfirmWithdrawOnly))
|
|
179
|
+
}
|
|
180
|
+
}, [dispatch, selectedOption.id])
|
|
181
|
+
|
|
182
|
+
const withdrawAndDeposit = useCallback(() => {
|
|
183
|
+
dispatch(setStep(WIDGET_STEP.Transfer))
|
|
184
|
+
}, [dispatch])
|
|
185
|
+
|
|
131
186
|
const handleWithdrawSuccess = useCallback(
|
|
132
187
|
(blockNumber: number) => {
|
|
133
188
|
if (handleSuccess) {
|
|
@@ -140,28 +195,63 @@ export function SolanaLendWithdraw({
|
|
|
140
195
|
return (
|
|
141
196
|
<WidgetWrapper
|
|
142
197
|
isOpen
|
|
198
|
+
width={step === WIDGET_STEP.ConfirmWithdrawAndDeposit ? '520px' : '480px'}
|
|
143
199
|
loadingTitle={title}
|
|
144
200
|
handleClose={handleCloseFlow}
|
|
145
201
|
handleSuccess={handleWithdrawSuccess}
|
|
146
202
|
>
|
|
147
|
-
{step === WIDGET_STEP.
|
|
148
|
-
<
|
|
203
|
+
{step === WIDGET_STEP.Option && (
|
|
204
|
+
<Option
|
|
149
205
|
poolUnderlyingToken={poolInfo.underlyingMint}
|
|
150
206
|
withdrawableAmountFormatted={withdrawableAmountFormatted ?? '--'}
|
|
151
|
-
|
|
207
|
+
selectedOption={selectedOption}
|
|
208
|
+
setSelectedOption={setSelectedOption}
|
|
209
|
+
handleConfirmOption={handleConfirmOption}
|
|
210
|
+
/>
|
|
211
|
+
)}
|
|
212
|
+
{step === WIDGET_STEP.ConfirmWithdrawAndDeposit && (
|
|
213
|
+
<WithdrawAndDepositConfirm
|
|
214
|
+
withdrawableAmount={withdrawableAmount}
|
|
215
|
+
withdrawableAmountFormatted={withdrawableAmountFormatted ?? '--'}
|
|
216
|
+
chainId={poolInfo.chainId}
|
|
217
|
+
selectedDepositMode={selectedDepositMode}
|
|
218
|
+
setSelectedDepositMode={setSelectedDepositMode}
|
|
219
|
+
selectedDepositCommitment={selectedDepositCommitment}
|
|
220
|
+
setSelectedDepositCommitment={setSelectedDepositCommitment}
|
|
221
|
+
withdrawAndDeposit={withdrawAndDeposit}
|
|
152
222
|
/>
|
|
153
223
|
)}
|
|
154
|
-
{step === WIDGET_STEP.
|
|
155
|
-
<
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
224
|
+
{step === WIDGET_STEP.ConfirmWithdrawOnly && (
|
|
225
|
+
<WithdrawOnlyConfirm
|
|
226
|
+
poolUnderlyingToken={poolInfo.underlyingMint}
|
|
227
|
+
withdrawableAmountFormatted={withdrawableAmountFormatted ?? '--'}
|
|
228
|
+
sharePrice={sharePrice}
|
|
159
229
|
/>
|
|
160
230
|
)}
|
|
231
|
+
{step === WIDGET_STEP.Transfer &&
|
|
232
|
+
selectedOption.id === WithdrawOption.WITHDRAW_AND_REDEPOSIT && (
|
|
233
|
+
<TransferAndDeposit
|
|
234
|
+
poolInfo={poolInfo}
|
|
235
|
+
selectedTranche={trancheType}
|
|
236
|
+
poolIsClosed={poolIsClosed}
|
|
237
|
+
permissionlessMode={selectedDepositMode}
|
|
238
|
+
withdrawableAmount={withdrawableAmount}
|
|
239
|
+
depositCommitment={selectedDepositCommitment}
|
|
240
|
+
/>
|
|
241
|
+
)}
|
|
242
|
+
{step === WIDGET_STEP.Transfer &&
|
|
243
|
+
selectedOption.id === WithdrawOption.WITHDRAW_ONLY && (
|
|
244
|
+
<Transfer
|
|
245
|
+
poolInfo={poolInfo}
|
|
246
|
+
selectedTranche={trancheType}
|
|
247
|
+
poolIsClosed={poolIsClosed}
|
|
248
|
+
/>
|
|
249
|
+
)}
|
|
161
250
|
{step === WIDGET_STEP.Done && withdrawnAmount && (
|
|
162
251
|
<Done
|
|
163
252
|
poolUnderlyingToken={poolInfo.underlyingMint}
|
|
164
253
|
withdrawAmount={withdrawnAmount}
|
|
254
|
+
option={selectedOption}
|
|
165
255
|
handleAction={handleCloseFlow}
|
|
166
256
|
/>
|
|
167
257
|
)}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Box, Button, css, Typography, useTheme } from '@mui/material'
|
|
2
1
|
import { txAtom } from '@huma-finance/web-shared'
|
|
2
|
+
import { Box, Button, css, Typography, useTheme } from '@mui/material'
|
|
3
3
|
import { useResetAtom } from 'jotai/utils'
|
|
4
4
|
import React, { useCallback } from 'react'
|
|
5
5
|
|
|
@@ -8,7 +8,7 @@ import { resetState } from '../store/widgets.reducers'
|
|
|
8
8
|
import { CheckIcon } from './icons'
|
|
9
9
|
|
|
10
10
|
type Props = {
|
|
11
|
-
content: string[]
|
|
11
|
+
content: (string | React.ReactNode)[]
|
|
12
12
|
subContent?: string[]
|
|
13
13
|
buttonText?: string
|
|
14
14
|
handleAction: () => void
|
|
@@ -77,7 +77,7 @@ export function TxDoneModal({
|
|
|
77
77
|
</Box>
|
|
78
78
|
<Box css={styles.content}>
|
|
79
79
|
{content.map((item) => (
|
|
80
|
-
<Box sx={{ marginTop: theme.spacing(1) }} key={item}>
|
|
80
|
+
<Box sx={{ marginTop: theme.spacing(1) }} key={item?.toString()}>
|
|
81
81
|
{item}
|
|
82
82
|
</Box>
|
|
83
83
|
))}
|
|
@@ -17,6 +17,7 @@ type Props = {
|
|
|
17
17
|
isOpen: boolean
|
|
18
18
|
isLoading?: boolean
|
|
19
19
|
loadingTitle?: string
|
|
20
|
+
width?: string
|
|
20
21
|
handleClose: () => void
|
|
21
22
|
handleSuccess?: (blockNumber: number) => void
|
|
22
23
|
}
|
|
@@ -25,6 +26,7 @@ export function WidgetWrapper({
|
|
|
25
26
|
isOpen,
|
|
26
27
|
isLoading = false,
|
|
27
28
|
loadingTitle = '',
|
|
29
|
+
width = '480px',
|
|
28
30
|
handleClose,
|
|
29
31
|
handleSuccess,
|
|
30
32
|
children,
|
|
@@ -67,7 +69,7 @@ export function WidgetWrapper({
|
|
|
67
69
|
isOpen={isOpen}
|
|
68
70
|
overflowY='auto'
|
|
69
71
|
onClose={handleCloseModal}
|
|
70
|
-
width=
|
|
72
|
+
width={width}
|
|
71
73
|
padding={theme.spacing(4, 5)}
|
|
72
74
|
disableBackdropClick
|
|
73
75
|
>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<svg viewBox="2.5 4.3 27 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<rect x="11.2676" y="14.5305" width="11.2329" height="3.7961" fill="#B246FF"/>
|
|
3
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M19.5496 4.36143C13.8705 2.70849 7.6775 5.39263 5.09814 10.9144C2.51877 16.4362 4.43722 22.9028 9.35286 26.1903L15.2227 13.6244L19.5496 4.36143Z" fill="url(#paint0_linear_623_5197)"/>
|
|
4
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M22.7575 5.80971C27.6731 9.09723 29.5916 15.5638 27.0122 21.0856C24.4328 26.6074 18.2399 29.2915 12.5607 27.6386L18.4305 15.0727L22.7575 5.80971Z" fill="url(#paint1_linear_623_5197)"/>
|
|
5
|
+
<defs>
|
|
6
|
+
<linearGradient id="paint0_linear_623_5197" x1="18.5668" y1="6.46542" x2="-11.3801" y2="2.80595" gradientUnits="userSpaceOnUse">
|
|
7
|
+
<stop stop-color="#B246FF"/>
|
|
8
|
+
<stop offset="1" stop-color="#FF6A8A"/>
|
|
9
|
+
</linearGradient>
|
|
10
|
+
<linearGradient id="paint1_linear_623_5197" x1="21.7747" y1="7.9137" x2="43.7938" y2="28.5207" gradientUnits="userSpaceOnUse">
|
|
11
|
+
<stop stop-color="#B246FF"/>
|
|
12
|
+
<stop offset="1" stop-color="#FF6A8A"/>
|
|
13
|
+
</linearGradient>
|
|
14
|
+
</defs>
|
|
15
|
+
</svg>
|
|
@@ -1,25 +1,32 @@
|
|
|
1
1
|
import { SvgIconProps } from '@mui/material'
|
|
2
|
-
import
|
|
2
|
+
import ApproveLenderSvg from './approve-lender.svg?react'
|
|
3
|
+
import AutoPaybackSvg from './auto-payback.svg?react'
|
|
4
|
+
import CeloSvg from './celo.svg?react'
|
|
5
|
+
import CheckCircleSvg from './check-circle.svg?react'
|
|
6
|
+
import CheckGreenSvg from './check-green.svg?react'
|
|
7
|
+
import CheckSvg from './check.svg?react'
|
|
8
|
+
import CongratulationsSvg from './congratulations.svg?react'
|
|
9
|
+
import DonutSvg from './donut.svg?react'
|
|
10
|
+
import EthereumSvg from './ethereum.svg?react'
|
|
3
11
|
import HumaFullLogoSvg from './huma-full.svg?react'
|
|
12
|
+
import HumaNoEmptySpaceSvg from './huma-no-empty-space.svg?react'
|
|
13
|
+
import HumaPointsSvg from './huma-points.svg?react'
|
|
14
|
+
import HumaLogoSvg from './huma.svg?react'
|
|
15
|
+
import LoaderSvg from './loader.svg?react'
|
|
4
16
|
import MetamaskSvg from './metamask.svg?react'
|
|
5
|
-
import
|
|
6
|
-
import
|
|
17
|
+
import MinusSignInactiveSvg from './minus-sign-inactive.svg?react'
|
|
18
|
+
import MinusSignSvg from './minus-sign.svg?react'
|
|
19
|
+
import ModeClassicSvg from './mode-classic.svg?react'
|
|
20
|
+
import ModeMaxiSvg from './mode-maxi.svg?react'
|
|
21
|
+
import PlusSignInactiveSvg from './plus-sign-inactive.svg?react'
|
|
22
|
+
import PlusSignSvg from './plus-sign.svg?react'
|
|
7
23
|
import PolygonSvg from './polygon.svg?react'
|
|
8
24
|
import ReceiptSvg from './receipt.svg?react'
|
|
25
|
+
import RibbonSvg from './ribbon.svg?react'
|
|
9
26
|
import SeparatorSvg from './separator.svg?react'
|
|
10
|
-
import LoaderSvg from './loader.svg?react'
|
|
11
27
|
import SorrySvg from './sorry.svg?react'
|
|
12
|
-
import CheckSvg from './check.svg?react'
|
|
13
|
-
import CheckGreenSvg from './check-green.svg?react'
|
|
14
|
-
import CheckCircleSvg from './check-circle.svg?react'
|
|
15
|
-
import AutoPaybackSvg from './auto-payback.svg?react'
|
|
16
|
-
import ApproveLenderSvg from './approve-lender.svg?react'
|
|
17
|
-
import DonutSvg from './donut.svg?react'
|
|
18
28
|
import UsdcSvg from './usdc.svg?react'
|
|
19
|
-
import
|
|
20
|
-
import CongratulationsSvg from './congratulations.svg?react'
|
|
21
|
-
import RibbonSvg from './ribbon.svg?react'
|
|
22
|
-
import HumaPointsSvg from './huma-points.svg?react'
|
|
29
|
+
import WalletConnectSvg from './wallet-connect.svg?react'
|
|
23
30
|
|
|
24
31
|
export function HumaIcon(props: SvgIconProps): React.ReactElement {
|
|
25
32
|
return <HumaLogoSvg {...props} />
|
|
@@ -29,6 +36,10 @@ export function HumaFullIcon(props: SvgIconProps): React.ReactElement {
|
|
|
29
36
|
return <HumaFullLogoSvg {...props} />
|
|
30
37
|
}
|
|
31
38
|
|
|
39
|
+
export function HumaNoEmptySpaceIcon(props: SvgIconProps): React.ReactElement {
|
|
40
|
+
return <HumaNoEmptySpaceSvg {...props} />
|
|
41
|
+
}
|
|
42
|
+
|
|
32
43
|
export function MetamaskIcon(props: SvgIconProps): React.ReactElement {
|
|
33
44
|
return <MetamaskSvg {...props} />
|
|
34
45
|
}
|
|
@@ -105,6 +116,30 @@ export function HumaPointsIcon(props: SvgIconProps): React.ReactElement {
|
|
|
105
116
|
return <HumaPointsSvg {...props} />
|
|
106
117
|
}
|
|
107
118
|
|
|
119
|
+
export function ModeClassicIcon(props: SvgIconProps): React.ReactElement {
|
|
120
|
+
return <ModeClassicSvg {...props} />
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export function ModeMaxiIcon(props: SvgIconProps): React.ReactElement {
|
|
124
|
+
return <ModeMaxiSvg {...props} />
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export function MinusSignIcon(props: SvgIconProps): React.ReactElement {
|
|
128
|
+
return <MinusSignSvg {...props} />
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export function PlusSignIcon(props: SvgIconProps): React.ReactElement {
|
|
132
|
+
return <PlusSignSvg {...props} />
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export function MinusSignInactiveIcon(props: SvgIconProps): React.ReactElement {
|
|
136
|
+
return <MinusSignInactiveSvg {...props} />
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export function PlusSignInactiveIcon(props: SvgIconProps): React.ReactElement {
|
|
140
|
+
return <PlusSignInactiveSvg {...props} />
|
|
141
|
+
}
|
|
142
|
+
|
|
108
143
|
export function getIcon(icon: string) {
|
|
109
144
|
if (!icon) return null
|
|
110
145
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<svg width="60" height="60" viewBox="0 0 60 60" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<circle cx="30" cy="30" r="29.5" fill="white" fill-opacity="0.05" stroke="url(#paint0_linear_9564_1347)"/>
|
|
3
|
+
<path d="M21 32V28H39V32H21Z" fill="white"/>
|
|
4
|
+
<defs>
|
|
5
|
+
<linearGradient id="paint0_linear_9564_1347" x1="60" y1="5.78314" x2="3.23158e-06" y2="60" gradientUnits="userSpaceOnUse">
|
|
6
|
+
<stop stop-color="#C733FF"/>
|
|
7
|
+
<stop offset="1" stop-color="#74DEFF"/>
|
|
8
|
+
<linearGradient id="paint1_linear_11507_28492" x1="39" y1="28.3855" x2="37.1353" y2="35.9681" gradientUnits="userSpaceOnUse">
|
|
9
|
+
<stop stop-color="#C733FF"/>
|
|
10
|
+
<stop offset="1" stop-color="#74DEFF"/>
|
|
11
|
+
</linearGradient>
|
|
12
|
+
</linearGradient>
|
|
13
|
+
</defs>
|
|
14
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
2
|
+
<path d="M22.29 21.355C22.29 21.7112 22.0013 22 21.645 22H1.64502C1.28879 22 1 21.7112 1 21.355C1 20.9987 1.28879 20.71 1.64502 20.71H21.645C22.0013 20.71 22.29 20.9987 22.29 21.355ZM5.5166 17.1289C5.5166 17.6812 5.06889 18.1289 4.5166 18.1289H2C1.44772 18.1289 1 17.6812 1 17.1289V8.80664C1 8.25436 1.44772 7.80664 2 7.80664H4.5166C5.06889 7.80664 5.5166 8.25436 5.5166 8.80664V17.1289ZM13.9033 17.1289C13.9033 17.6812 13.4556 18.1289 12.9033 18.1289H10.3867C9.83443 18.1289 9.38672 17.6812 9.38672 17.1289V6.22559C9.38672 5.6733 9.83443 5.22559 10.3867 5.22559H12.9033C13.4556 5.22559 13.9033 5.6733 13.9033 6.22559V17.1289ZM22.29 17.1289C22.29 17.6812 21.8423 18.1289 21.29 18.1289H18.7744C18.2221 18.1289 17.7744 17.6812 17.7744 17.1289V3C17.7744 2.44772 18.2221 2 18.7744 2H21.29C21.8423 2 22.29 2.44772 22.29 3V17.1289Z" fill="#74DEFF"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
2
|
+
<path d="M7.20774 19.856C6.41674 20.647 3.66272 21.3501 3.11872 21.4831C3.07872 21.4931 3.03974 21.4971 2.99974 21.4971C2.86674 21.4971 2.73774 21.444 2.64274 21.347C2.51874 21.221 2.47173 21.0391 2.51673 20.8681C2.66773 20.3011 3.45874 17.4301 4.24574 16.6431C4.68874 16.2001 5.26375 15.9721 5.84175 15.9781C6.40075 15.9911 6.93773 16.2281 7.35273 16.6431C8.19873 17.4901 8.13374 18.931 7.20774 19.856ZM17.2077 14.7291L16.9497 16.3C16.6497 18.19 15.3497 19.8001 13.5697 20.5101L11.1897 21.4601C11.1297 21.4901 11.0597 21.5001 10.9997 21.5001C10.8897 21.5001 10.7697 21.4601 10.6797 21.3801C10.5397 21.2701 10.4697 21.0801 10.5097 20.9001L11.1727 17.5641C11.0757 17.5831 10.9837 17.6091 10.8847 17.6261C10.7627 17.6471 10.6397 17.6571 10.5177 17.6571C9.93374 17.6571 9.35973 17.4201 8.92973 16.9911L7.00773 15.0681C6.48773 14.5481 6.25072 13.8181 6.37272 13.1131C6.38972 13.0161 6.41573 12.9251 6.43373 12.8291L3.11872 13.4881C3.08872 13.4981 3.04875 13.498 3.01875 13.498C2.86875 13.498 2.72874 13.4381 2.63874 13.3181C2.51874 13.1781 2.48873 12.9781 2.55873 12.8081L3.51875 10.4181C4.21875 8.64806 5.82873 7.34807 7.71873 7.04807L9.26972 6.78906C11.8307 3.85206 15.8527 2.24707 20.9977 2.24707C21.4117 2.24707 21.7477 2.58307 21.7477 2.99707C21.7497 8.14607 20.1457 12.1681 17.2077 14.7291ZM18.9687 9.69507C18.8147 7.18507 16.8137 5.18506 14.3037 5.03006C11.4047 6.27906 8.66075 8.70106 7.85075 13.3701C7.81275 13.5911 7.89574 13.835 8.06874 14.007L9.99073 15.9301C10.1627 16.1021 10.4077 16.1841 10.6287 16.1471C15.2987 15.3381 17.7207 12.5951 18.9687 9.69507ZM13.4997 8.25006C12.2567 8.25006 11.2497 9.25706 11.2497 10.5001C11.2497 11.7431 12.2567 12.7501 13.4997 12.7501C14.7427 12.7501 15.7497 11.7431 15.7497 10.5001C15.7497 9.25706 14.7427 8.25006 13.4997 8.25006Z" fill="#C677FF"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="60" height="61" viewBox="0 0 60 61" fill="none">
|
|
2
|
+
<circle cx="30" cy="30.8257" r="30" fill="white" fill-opacity="0.05"/>
|
|
3
|
+
<path d="M28.576 37.47V31.486H23V27.984H28.576V22H32.18V27.984H37.756V31.486H32.18V37.47H28.576Z" fill="#464646"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<svg width="60" height="60" viewBox="0 0 60 60" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<circle cx="30" cy="30" r="29.5" fill="white" fill-opacity="0.05" stroke="url(#paint0_linear_9564_1363)"/>
|
|
3
|
+
<path d="M28.576 37.47V31.486H23V27.984H28.576V22H32.18V27.984H37.756V31.486H32.18V37.47H28.576Z" fill="white"/>
|
|
4
|
+
<defs>
|
|
5
|
+
<linearGradient id="paint0_linear_9564_1363" x1="60" y1="5.78314" x2="3.23158e-06" y2="60" gradientUnits="userSpaceOnUse">
|
|
6
|
+
<stop stop-color="#C733FF"/>
|
|
7
|
+
<stop offset="1" stop-color="#74DEFF"/>
|
|
8
|
+
</linearGradient>
|
|
9
|
+
<linearGradient id="paint1_linear_11507_28493" x1="37.756" y1="23.4911" x2="22.3766" y2="36.7467" gradientUnits="userSpaceOnUse">
|
|
10
|
+
<stop stop-color="#C733FF"/>
|
|
11
|
+
<stop offset="1" stop-color="#74DEFF"/>
|
|
12
|
+
</linearGradient>
|
|
13
|
+
</defs>
|
|
14
|
+
</svg>
|
|
@@ -17,6 +17,9 @@ export enum WIDGET_STEP {
|
|
|
17
17
|
Permit = 'Permit',
|
|
18
18
|
ApproveAllowance = 'ApproveAllowance',
|
|
19
19
|
MintNFT = 'MintNFT',
|
|
20
|
+
Option = 'Option',
|
|
21
|
+
ConfirmWithdrawAndDeposit = 'ConfirmWithdrawAndDeposit',
|
|
22
|
+
ConfirmWithdrawOnly = 'ConfirmWithdrawOnly',
|
|
20
23
|
ConfirmTransfer = 'ConfirmTransfer',
|
|
21
24
|
ApproveNFT = 'ApproveNFT',
|
|
22
25
|
Transfer = 'Transfer',
|
|
File without changes
|
|
File without changes
|