@huma-finance/widgets 0.0.61-beta.544 → 0.0.61-beta.547
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@huma-finance/widgets",
|
|
3
|
-
"version": "0.0.61-beta.
|
|
3
|
+
"version": "0.0.61-beta.547+6149dac",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
"@ethersproject/experimental": "^5.7.0",
|
|
31
31
|
"@ethersproject/providers": "^5.6.0",
|
|
32
32
|
"@ethersproject/units": "^5.6.0",
|
|
33
|
-
"@huma-finance/sdk": "^0.0.61-beta.
|
|
34
|
-
"@huma-finance/shared": "^0.0.61-beta.
|
|
35
|
-
"@huma-finance/web-shared": "^0.0.
|
|
33
|
+
"@huma-finance/sdk": "^0.0.61-beta.547+6149dac",
|
|
34
|
+
"@huma-finance/shared": "^0.0.61-beta.547+6149dac",
|
|
35
|
+
"@huma-finance/web-shared": "^0.0.60",
|
|
36
36
|
"@mui/icons-material": "^5.3.0",
|
|
37
37
|
"@mui/material": "^5.0.6",
|
|
38
38
|
"@mui/styles": "^5.0.2",
|
|
@@ -195,5 +195,5 @@
|
|
|
195
195
|
"optionalDependencies": {
|
|
196
196
|
"encoding": "^0.1.13"
|
|
197
197
|
},
|
|
198
|
-
"gitHead": "
|
|
198
|
+
"gitHead": "6149dac817ff6d309715e19d071943bbdb06ad56"
|
|
199
199
|
}
|
|
@@ -4,13 +4,14 @@ import {
|
|
|
4
4
|
formatNumber,
|
|
5
5
|
isEmpty,
|
|
6
6
|
} from '@huma-finance/shared'
|
|
7
|
-
import { useAuthErrorHandling } from '@huma-finance/web-shared'
|
|
7
|
+
import { txAtom, useAuthErrorHandling } from '@huma-finance/web-shared'
|
|
8
8
|
import { Box, css, useTheme } from '@mui/material'
|
|
9
9
|
import { useWeb3React } from '@web3-react/core'
|
|
10
|
-
import
|
|
10
|
+
import { useResetAtom } from 'jotai/utils'
|
|
11
|
+
import React, { useCallback, useEffect, useState } from 'react'
|
|
11
12
|
import { useDispatch } from 'react-redux'
|
|
12
13
|
|
|
13
|
-
import { setError } from '../../../store/widgets.reducers'
|
|
14
|
+
import { resetState, setError } from '../../../store/widgets.reducers'
|
|
14
15
|
import { BottomButton } from '../../BottomButton'
|
|
15
16
|
import { CongratulationsIcon, HumaPointsIcon, RibbonIcon } from '../../icons'
|
|
16
17
|
import { LoadingModal } from '../../LoadingModal'
|
|
@@ -41,6 +42,7 @@ export function PointsEarned({
|
|
|
41
42
|
const theme = useTheme()
|
|
42
43
|
const isDev = checkIsDev()
|
|
43
44
|
const dispatch = useDispatch()
|
|
45
|
+
const reset = useResetAtom(txAtom)
|
|
44
46
|
const { account, chainId } = useWeb3React()
|
|
45
47
|
const [pointsAccumulated, setPointsAccumulated] = useState<
|
|
46
48
|
number | undefined
|
|
@@ -134,6 +136,12 @@ export function PointsEarned({
|
|
|
134
136
|
walletOwnership,
|
|
135
137
|
])
|
|
136
138
|
|
|
139
|
+
const handleCloseModal = useCallback(() => {
|
|
140
|
+
reset()
|
|
141
|
+
dispatch(resetState())
|
|
142
|
+
handleAction()
|
|
143
|
+
}, [dispatch, handleAction, reset])
|
|
144
|
+
|
|
137
145
|
const styles = {
|
|
138
146
|
wrapper: css`
|
|
139
147
|
height: 518px;
|
|
@@ -222,7 +230,7 @@ export function PointsEarned({
|
|
|
222
230
|
{monthText} straight. Plus, If you keep your investment till after{' '}
|
|
223
231
|
{monthText}, you’ll gain extra points daily.
|
|
224
232
|
</Box>
|
|
225
|
-
<BottomButton variant='contained' onClick={
|
|
233
|
+
<BottomButton variant='contained' onClick={handleCloseModal}>
|
|
226
234
|
GREAT
|
|
227
235
|
</BottomButton>
|
|
228
236
|
</Box>
|