@lifi/widget 3.23.0 → 3.23.2-beta.0
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/esm/AppDrawer.style.d.ts +1 -1
- package/dist/esm/components/ActiveTransactions/ActiveTransactions.js +2 -5
- package/dist/esm/components/ActiveTransactions/ActiveTransactions.js.map +1 -1
- package/dist/esm/components/ActiveTransactions/ActiveTransactions.style.d.ts +0 -1
- package/dist/esm/components/ActiveTransactions/ActiveTransactions.style.js +2 -10
- package/dist/esm/components/ActiveTransactions/ActiveTransactions.style.js.map +1 -1
- package/dist/esm/components/AmountInput/AmountInputAdornment.style.d.ts +1 -1
- package/dist/esm/components/ButtonTertiary.d.ts +1 -1
- package/dist/esm/components/Card/CardIconButton.d.ts +1 -1
- package/dist/esm/components/Header/Header.style.d.ts +1 -1
- package/dist/esm/components/Header/SettingsButton.style.d.ts +1 -1
- package/dist/esm/components/Messages/AccountDeployedMessage.d.ts +2 -0
- package/dist/esm/components/Messages/AccountDeployedMessage.js +13 -0
- package/dist/esm/components/Messages/AccountDeployedMessage.js.map +1 -0
- package/dist/esm/components/Messages/WarningMessages.js +3 -0
- package/dist/esm/components/Messages/WarningMessages.js.map +1 -1
- package/dist/esm/components/Messages/useMessageQueue.js +8 -1
- package/dist/esm/components/Messages/useMessageQueue.js.map +1 -1
- package/dist/esm/components/Skeleton/WidgetSkeleton.style.d.ts +2 -2
- package/dist/esm/components/TokenList/TokenList.style.d.ts +1 -1
- package/dist/esm/config/version.d.ts +1 -1
- package/dist/esm/config/version.js +1 -1
- package/dist/esm/config/version.js.map +1 -1
- package/dist/esm/hooks/useToAddressRequirements.d.ts +1 -0
- package/dist/esm/hooks/useToAddressRequirements.js +5 -0
- package/dist/esm/hooks/useToAddressRequirements.js.map +1 -1
- package/dist/esm/i18n/bn.json +12 -5
- package/dist/esm/i18n/de.json +16 -9
- package/dist/esm/i18n/en.json +1 -0
- package/dist/esm/i18n/es.json +13 -6
- package/dist/esm/i18n/fr.json +13 -6
- package/dist/esm/i18n/hi.json +32 -25
- package/dist/esm/i18n/id.json +15 -8
- package/dist/esm/i18n/it.json +14 -7
- package/dist/esm/i18n/ja.json +12 -5
- package/dist/esm/i18n/ko.json +12 -5
- package/dist/esm/i18n/pt.json +16 -9
- package/dist/esm/i18n/th.json +12 -5
- package/dist/esm/i18n/tr.json +13 -6
- package/dist/esm/i18n/uk.json +12 -5
- package/dist/esm/i18n/vi.json +13 -6
- package/dist/esm/i18n/zh.json +12 -5
- package/dist/esm/pages/SendToWallet/SendToWalletPage.js +10 -5
- package/dist/esm/pages/SendToWallet/SendToWalletPage.js.map +1 -1
- package/dist/esm/pages/SendToWallet/SendToWalletPage.style.d.ts +2 -2
- package/dist/esm/types/widget.d.ts +4 -2
- package/dist/esm/types/widget.js +2 -0
- package/dist/esm/types/widget.js.map +1 -1
- package/package.json +1 -1
- package/package.json.tmp +1 -1
- package/src/components/ActiveTransactions/ActiveTransactions.style.ts +1 -11
- package/src/components/ActiveTransactions/ActiveTransactions.tsx +12 -13
- package/src/components/Messages/AccountDeployedMessage.tsx +28 -0
- package/src/components/Messages/WarningMessages.tsx +3 -0
- package/src/components/Messages/useMessageQueue.ts +9 -0
- package/src/config/version.ts +1 -1
- package/src/hooks/useToAddressRequirements.ts +7 -0
- package/src/i18n/bn.json +12 -5
- package/src/i18n/de.json +16 -9
- package/src/i18n/en.json +1 -0
- package/src/i18n/es.json +13 -6
- package/src/i18n/fr.json +13 -6
- package/src/i18n/hi.json +32 -25
- package/src/i18n/id.json +15 -8
- package/src/i18n/it.json +14 -7
- package/src/i18n/ja.json +12 -5
- package/src/i18n/ko.json +12 -5
- package/src/i18n/pt.json +16 -9
- package/src/i18n/th.json +12 -5
- package/src/i18n/tr.json +13 -6
- package/src/i18n/uk.json +12 -5
- package/src/i18n/vi.json +13 -6
- package/src/i18n/zh.json +12 -5
- package/src/pages/SendToWallet/SendToWalletPage.tsx +77 -66
- package/src/types/widget.ts +2 -0
|
@@ -11,6 +11,7 @@ import { useNavigate } from 'react-router-dom'
|
|
|
11
11
|
import type { BottomSheetBase } from '../../components/BottomSheet/types.js'
|
|
12
12
|
import { ButtonTertiary } from '../../components/ButtonTertiary.js'
|
|
13
13
|
import { CardButton } from '../../components/Card/CardButton.js'
|
|
14
|
+
import { AccountDeployedMessage } from '../../components/Messages/AccountDeployedMessage.js'
|
|
14
15
|
import {
|
|
15
16
|
AddressType,
|
|
16
17
|
useAddressValidation,
|
|
@@ -24,6 +25,7 @@ import { useBookmarkActions } from '../../stores/bookmarks/useBookmarkActions.js
|
|
|
24
25
|
import { useBookmarks } from '../../stores/bookmarks/useBookmarks.js'
|
|
25
26
|
import { useFieldActions } from '../../stores/form/useFieldActions.js'
|
|
26
27
|
import { useFieldValues } from '../../stores/form/useFieldValues.js'
|
|
28
|
+
import { HiddenUI, RequiredUI } from '../../types/widget.js'
|
|
27
29
|
import { navigationRoutes } from '../../utils/navigationRoutes.js'
|
|
28
30
|
import { BookmarkAddressSheet } from './BookmarkAddressSheet.js'
|
|
29
31
|
import { ConfirmAddressSheet } from './ConfirmAddressSheet.js'
|
|
@@ -61,7 +63,7 @@ export const SendToWalletPage = () => {
|
|
|
61
63
|
const { chain: toChain } = useChain(toChainId)
|
|
62
64
|
const [isDoneButtonLoading, setIsDoneButtonLoading] = useState(false)
|
|
63
65
|
const [isBookmarkButtonLoading, setIsBookmarkButtonLoading] = useState(false)
|
|
64
|
-
const { variant } = useWidgetConfig()
|
|
66
|
+
const { variant, hiddenUI, requiredUI } = useWidgetConfig()
|
|
65
67
|
|
|
66
68
|
const { accounts } = useAccount()
|
|
67
69
|
const connectedWallets = accounts.filter((account) => account.isConnected)
|
|
@@ -191,62 +193,69 @@ export const SendToWalletPage = () => {
|
|
|
191
193
|
bottomGutters
|
|
192
194
|
enableFullHeight={variant !== 'drawer'}
|
|
193
195
|
>
|
|
194
|
-
<
|
|
195
|
-
type={errorMessage ? 'error' : 'default'}
|
|
196
|
+
<Box
|
|
196
197
|
sx={{
|
|
198
|
+
display: 'flex',
|
|
199
|
+
flexDirection: 'column',
|
|
200
|
+
gap: 2,
|
|
197
201
|
marginBottom: 6,
|
|
198
202
|
}}
|
|
199
203
|
>
|
|
200
|
-
<
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
{
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
<
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
sx={{ flexGrow: 1 }}
|
|
226
|
-
>
|
|
227
|
-
{t('button.done')}
|
|
228
|
-
</ButtonTertiary>
|
|
229
|
-
<Tooltip title={t('button.bookmark')}>
|
|
230
|
-
<SendToWalletIconButton
|
|
231
|
-
onClick={handleBookmarkAddress}
|
|
232
|
-
loading={isBookmarkButtonLoading}
|
|
204
|
+
<SendToWalletCard type={errorMessage ? 'error' : 'default'}>
|
|
205
|
+
<AddressInput
|
|
206
|
+
size="small"
|
|
207
|
+
autoComplete="off"
|
|
208
|
+
autoCorrect="off"
|
|
209
|
+
autoCapitalize="off"
|
|
210
|
+
spellCheck="false"
|
|
211
|
+
onChange={handleInputChange}
|
|
212
|
+
value={inputAddressValue}
|
|
213
|
+
placeholder={placeholder}
|
|
214
|
+
aria-label={placeholder}
|
|
215
|
+
maxRows={2}
|
|
216
|
+
inputProps={{ maxLength: 128 }}
|
|
217
|
+
multiline
|
|
218
|
+
/>
|
|
219
|
+
{errorMessage ? (
|
|
220
|
+
<ValidationAlert icon={<ErrorIcon />} sx={{ pb: 2, paddingX: 2 }}>
|
|
221
|
+
{errorMessage}
|
|
222
|
+
</ValidationAlert>
|
|
223
|
+
) : null}
|
|
224
|
+
<SendToWalletButtonRow sx={{ paddingX: 2, paddingBottom: 2 }}>
|
|
225
|
+
<ButtonTertiary
|
|
226
|
+
variant="text"
|
|
227
|
+
onClick={handleDone}
|
|
228
|
+
loading={isDoneButtonLoading}
|
|
233
229
|
loadingPosition="center"
|
|
230
|
+
sx={{ flexGrow: 1 }}
|
|
234
231
|
>
|
|
235
|
-
|
|
236
|
-
</
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
232
|
+
{t('button.done')}
|
|
233
|
+
</ButtonTertiary>
|
|
234
|
+
<Tooltip title={t('button.bookmark')}>
|
|
235
|
+
<SendToWalletIconButton
|
|
236
|
+
onClick={handleBookmarkAddress}
|
|
237
|
+
loading={isBookmarkButtonLoading}
|
|
238
|
+
loadingPosition="center"
|
|
239
|
+
>
|
|
240
|
+
<TurnedIn fontSize="small" />
|
|
241
|
+
</SendToWalletIconButton>
|
|
242
|
+
</Tooltip>
|
|
243
|
+
</SendToWalletButtonRow>
|
|
244
|
+
<ConfirmAddressSheet
|
|
245
|
+
ref={confirmAddressSheetRef}
|
|
246
|
+
validatedBookmark={validatedWallet}
|
|
247
|
+
onConfirm={handleOnConfirm}
|
|
248
|
+
/>
|
|
249
|
+
<BookmarkAddressSheet
|
|
250
|
+
ref={bookmarkAddressSheetRef}
|
|
251
|
+
validatedWallet={validatedWallet}
|
|
252
|
+
onAddBookmark={handleAddBookmark}
|
|
253
|
+
/>
|
|
254
|
+
</SendToWalletCard>
|
|
255
|
+
{requiredUI?.includes(RequiredUI.AccountDeployedMessage) && (
|
|
256
|
+
<AccountDeployedMessage />
|
|
257
|
+
)}
|
|
258
|
+
</Box>
|
|
250
259
|
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 1 }}>
|
|
251
260
|
<CardButton
|
|
252
261
|
title={t('header.recentWallets')}
|
|
@@ -263,21 +272,23 @@ export const SendToWalletPage = () => {
|
|
|
263
272
|
</Typography>
|
|
264
273
|
)}
|
|
265
274
|
</CardButton>
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
275
|
+
{!hiddenUI?.includes(HiddenUI.AddressBookConnectedWallets) && (
|
|
276
|
+
<CardButton
|
|
277
|
+
title={t('sendToWallet.connectedWallets')}
|
|
278
|
+
icon={<Wallet />}
|
|
279
|
+
onClick={handleConnectedWalletsClick}
|
|
280
|
+
>
|
|
281
|
+
{!!connectedWallets.length && (
|
|
282
|
+
<Typography
|
|
283
|
+
sx={{
|
|
284
|
+
color: 'text.secondary',
|
|
285
|
+
}}
|
|
286
|
+
>
|
|
287
|
+
{connectedWallets.length}
|
|
288
|
+
</Typography>
|
|
289
|
+
)}
|
|
290
|
+
</CardButton>
|
|
291
|
+
)}
|
|
281
292
|
<CardButton
|
|
282
293
|
title={t('header.bookmarkedWallets')}
|
|
283
294
|
icon={<TurnedIn />}
|
package/src/types/widget.ts
CHANGED
|
@@ -104,11 +104,13 @@ export enum HiddenUI {
|
|
|
104
104
|
RouteTokenDescription = 'routeTokenDescription',
|
|
105
105
|
ChainSelect = 'chainSelect',
|
|
106
106
|
BridgesSettings = 'bridgesSettings',
|
|
107
|
+
AddressBookConnectedWallets = 'addressBookConnectedWallets',
|
|
107
108
|
}
|
|
108
109
|
export type HiddenUIType = `${HiddenUI}`
|
|
109
110
|
|
|
110
111
|
export enum RequiredUI {
|
|
111
112
|
ToAddress = 'toAddress',
|
|
113
|
+
AccountDeployedMessage = 'accountDeployedMessage',
|
|
112
114
|
}
|
|
113
115
|
export type RequiredUIType = `${RequiredUI}`
|
|
114
116
|
|