@lifi/widget 3.29.0-beta.0 → 3.29.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.
Files changed (89) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/esm/components/BaseTransactionButton/BaseTransactionButton.js +2 -1
  3. package/dist/esm/components/BaseTransactionButton/BaseTransactionButton.js.map +1 -1
  4. package/dist/esm/components/ChainSelect/ChainSelect.d.ts +1 -1
  5. package/dist/esm/components/ChainSelect/ChainSelect.js +20 -24
  6. package/dist/esm/components/ChainSelect/ChainSelect.js.map +1 -1
  7. package/dist/esm/components/ChainSelect/ChainSelect.style.d.ts +3 -0
  8. package/dist/esm/components/ChainSelect/ChainSelect.style.js +40 -3
  9. package/dist/esm/components/ChainSelect/ChainSelect.style.js.map +1 -1
  10. package/dist/esm/components/Header/WalletHeader.js +3 -1
  11. package/dist/esm/components/Header/WalletHeader.js.map +1 -1
  12. package/dist/esm/components/Search/SearchInput.style.js +3 -0
  13. package/dist/esm/components/Search/SearchInput.style.js.map +1 -1
  14. package/dist/esm/components/SelectTokenButton/SelectTokenButton.style.js +7 -0
  15. package/dist/esm/components/SelectTokenButton/SelectTokenButton.style.js.map +1 -1
  16. package/dist/esm/config/version.d.ts +1 -1
  17. package/dist/esm/config/version.js +1 -1
  18. package/dist/esm/config/version.js.map +1 -1
  19. package/dist/esm/hooks/useInternalWalletProvider.d.ts +1 -0
  20. package/dist/esm/hooks/useInternalWalletProvider.js +6 -0
  21. package/dist/esm/hooks/useInternalWalletProvider.js.map +1 -0
  22. package/dist/esm/i18n/bn.json +2 -4
  23. package/dist/esm/i18n/de.json +2 -4
  24. package/dist/esm/i18n/es.json +2 -4
  25. package/dist/esm/i18n/fr.json +2 -4
  26. package/dist/esm/i18n/hi.json +2 -4
  27. package/dist/esm/i18n/id.json +2 -4
  28. package/dist/esm/i18n/it.json +2 -4
  29. package/dist/esm/i18n/ja.json +2 -4
  30. package/dist/esm/i18n/ko.json +2 -4
  31. package/dist/esm/i18n/pl.json +2 -4
  32. package/dist/esm/i18n/pt.json +2 -4
  33. package/dist/esm/i18n/th.json +2 -4
  34. package/dist/esm/i18n/tr.json +2 -4
  35. package/dist/esm/i18n/uk.json +2 -4
  36. package/dist/esm/i18n/vi.json +2 -4
  37. package/dist/esm/i18n/zh.json +2 -4
  38. package/dist/esm/pages/SelectTokenPage/SelectTokenPage.js +12 -5
  39. package/dist/esm/pages/SelectTokenPage/SelectTokenPage.js.map +1 -1
  40. package/dist/esm/providers/WalletProvider/EVMProvider.js +3 -1
  41. package/dist/esm/providers/WalletProvider/EVMProvider.js.map +1 -1
  42. package/dist/esm/providers/WalletProvider/SVMBaseProvider.d.ts +1 -1
  43. package/dist/esm/providers/WalletProvider/SVMBaseProvider.js +18 -14
  44. package/dist/esm/providers/WalletProvider/SVMBaseProvider.js.map +1 -1
  45. package/dist/esm/providers/WalletProvider/SVMProvider.js +3 -1
  46. package/dist/esm/providers/WalletProvider/SVMProvider.js.map +1 -1
  47. package/dist/esm/providers/WalletProvider/SuiProvider.js +3 -1
  48. package/dist/esm/providers/WalletProvider/SuiProvider.js.map +1 -1
  49. package/dist/esm/providers/WalletProvider/UTXOProvider.js +3 -1
  50. package/dist/esm/providers/WalletProvider/UTXOProvider.js.map +1 -1
  51. package/dist/esm/providers/WalletProvider/useExternalWalletProvider.js +4 -1
  52. package/dist/esm/providers/WalletProvider/useExternalWalletProvider.js.map +1 -1
  53. package/dist/esm/types/widget.d.ts +7 -1
  54. package/dist/esm/types/widget.js +1 -0
  55. package/dist/esm/types/widget.js.map +1 -1
  56. package/package.json +10 -10
  57. package/package.json.tmp +9 -9
  58. package/src/components/BaseTransactionButton/BaseTransactionButton.tsx +4 -1
  59. package/src/components/ChainSelect/ChainSelect.style.tsx +43 -3
  60. package/src/components/ChainSelect/ChainSelect.tsx +32 -39
  61. package/src/components/Header/WalletHeader.tsx +5 -1
  62. package/src/components/Search/SearchInput.style.tsx +3 -0
  63. package/src/components/SelectTokenButton/SelectTokenButton.style.tsx +7 -0
  64. package/src/config/version.ts +1 -1
  65. package/src/hooks/useInternalWalletProvider.ts +6 -0
  66. package/src/i18n/bn.json +2 -4
  67. package/src/i18n/de.json +2 -4
  68. package/src/i18n/es.json +2 -4
  69. package/src/i18n/fr.json +2 -4
  70. package/src/i18n/hi.json +2 -4
  71. package/src/i18n/id.json +2 -4
  72. package/src/i18n/it.json +2 -4
  73. package/src/i18n/ja.json +2 -4
  74. package/src/i18n/ko.json +2 -4
  75. package/src/i18n/pl.json +2 -4
  76. package/src/i18n/pt.json +2 -4
  77. package/src/i18n/th.json +2 -4
  78. package/src/i18n/tr.json +2 -4
  79. package/src/i18n/uk.json +2 -4
  80. package/src/i18n/vi.json +2 -4
  81. package/src/i18n/zh.json +2 -4
  82. package/src/pages/SelectTokenPage/SelectTokenPage.tsx +25 -10
  83. package/src/providers/WalletProvider/EVMProvider.tsx +5 -3
  84. package/src/providers/WalletProvider/SVMBaseProvider.tsx +19 -16
  85. package/src/providers/WalletProvider/SVMProvider.tsx +5 -3
  86. package/src/providers/WalletProvider/SuiProvider.tsx +5 -3
  87. package/src/providers/WalletProvider/UTXOProvider.tsx +5 -3
  88. package/src/providers/WalletProvider/useExternalWalletProvider.ts +4 -1
  89. package/src/types/widget.ts +6 -0
@@ -1,6 +1,6 @@
1
1
  import type { EVMChain } from '@lifi/sdk'
2
- import { Avatar, Box, Skeleton, Tooltip, Typography } from '@mui/material'
3
- import { useEffect } from 'react'
2
+ import { Skeleton, Tooltip } from '@mui/material'
3
+ import { memo, useCallback, useEffect, useMemo } from 'react'
4
4
  import { useNavigate } from 'react-router-dom'
5
5
  import {
6
6
  maxChainsToOrder,
@@ -10,10 +10,16 @@ import type { FormTypeProps } from '../../stores/form/types.js'
10
10
  import { FormKeyHelper } from '../../stores/form/types.js'
11
11
  import { useFieldValues } from '../../stores/form/useFieldValues.js'
12
12
  import { navigationRoutes } from '../../utils/navigationRoutes.js'
13
- import { ChainCard, ChainContainer } from './ChainSelect.style.js'
13
+ import {
14
+ ChainAvatar,
15
+ ChainCard,
16
+ ChainContainer,
17
+ MoreChainsBox,
18
+ MoreChainsText,
19
+ } from './ChainSelect.style.js'
14
20
  import { useChainSelect } from './useChainSelect.js'
15
21
 
16
- export const ChainSelect = ({ formType }: FormTypeProps) => {
22
+ export const ChainSelect = memo(({ formType }: FormTypeProps) => {
17
23
  const navigate = useNavigate()
18
24
  const {
19
25
  chainOrder,
@@ -36,22 +42,26 @@ export const ChainSelect = ({ formType }: FormTypeProps) => {
36
42
  }
37
43
  }, [chainId, chainOrder, formType, setChainOrder])
38
44
 
39
- const showAllChains = () => {
45
+ const showAllChains = useCallback(() => {
40
46
  navigate(navigationRoutes[`${formType}Chain`])
41
- }
47
+ }, [navigate, formType])
48
+
49
+ const { chainsToHide, chainsToShow, tilesCount } = useMemo(() => {
50
+ // We check if we can accommodate all the chains on the grid
51
+ // If there are more than 10 chains we show the number of hidden chains as the last one tile
52
+ const chainsToHide =
53
+ chains?.length === maxChainsToShow
54
+ ? 0
55
+ : (chains?.length ?? 0) - maxChainsToOrder
42
56
 
43
- // We check if we can accommodate all the chains on the grid
44
- // If there are more than 10 chains we show the number of hidden chains as the last one tile
45
- const chainsToHide =
46
- chains?.length === maxChainsToShow
47
- ? 0
48
- : (chains?.length ?? 0) - maxChainsToOrder
57
+ // When there is less than 10 chains we don't care about the order
58
+ const chainsToShow = chainsToHide > 0 ? getChains() : chains
49
59
 
50
- // When there is less than 10 chains we don't care about the order
51
- const chainsToShow = chainsToHide > 0 ? getChains() : chains
60
+ // Number of tiles to show in the grid
61
+ const tilesCount = (chainsToShow?.length ?? 0) + (chainsToHide > 0 ? 1 : 0)
52
62
 
53
- // Number of tiles to show in the grid
54
- const tilesCount = (chainsToShow?.length ?? 0) + (chainsToHide > 0 ? 1 : 0)
63
+ return { chainsToHide, chainsToShow, tilesCount }
64
+ }, [chains, getChains])
55
65
 
56
66
  return (
57
67
  <ChainContainer itemCount={tilesCount}>
@@ -73,36 +83,19 @@ export const ChainSelect = ({ formType }: FormTypeProps) => {
73
83
  type={chainId === chain.id ? 'selected' : 'default'}
74
84
  selectionColor="secondary"
75
85
  >
76
- <Avatar
77
- src={chain.logoURI}
78
- alt={chain.key}
79
- sx={{ width: 40, height: 40 }}
80
- >
86
+ <ChainAvatar src={chain.logoURI} alt={chain.key}>
81
87
  {chain.name[0]}
82
- </Avatar>
88
+ </ChainAvatar>
83
89
  </ChainCard>
84
90
  </Tooltip>
85
91
  ))}
86
92
  {chainsToHide > 0 ? (
87
93
  <ChainCard component="button" onClick={showAllChains}>
88
- <Box
89
- sx={{
90
- width: 40,
91
- height: 40,
92
- display: 'grid',
93
- placeItems: 'center',
94
- }}
95
- >
96
- <Typography
97
- sx={{
98
- fontWeight: 500,
99
- }}
100
- >
101
- +{chainsToHide}
102
- </Typography>
103
- </Box>
94
+ <MoreChainsBox>
95
+ <MoreChainsText>+{chainsToHide}</MoreChainsText>
96
+ </MoreChainsBox>
104
97
  </ChainCard>
105
98
  ) : null}
106
99
  </ChainContainer>
107
100
  )
108
- }
101
+ })
@@ -88,7 +88,11 @@ const ConnectButton = () => {
88
88
  const { walletConfig, variant } = useWidgetConfig()
89
89
  const { openWalletMenu } = useWalletMenu()
90
90
  const connect = async (event: React.MouseEvent<HTMLElement>) => {
91
- if (!walletConfig?.usePartialWalletManagement && walletConfig?.onConnect) {
91
+ if (
92
+ !walletConfig?.usePartialWalletManagement &&
93
+ !walletConfig?.forceInternalWalletManagement &&
94
+ walletConfig?.onConnect
95
+ ) {
92
96
  walletConfig.onConnect()
93
97
  return
94
98
  }
@@ -19,6 +19,9 @@ export const Input = styled(InputBase, {
19
19
  paddingLeft: theme.spacing(1.25),
20
20
  fontSize: size === 'small' ? '0.875rem' : '1rem',
21
21
  borderRadius: theme.vars.shape.borderRadius,
22
+ [theme.breakpoints.down(theme.breakpoints.values.xs)]: {
23
+ paddingRight: theme.spacing(1.25),
24
+ },
22
25
  [`& .${inputBaseClasses.input}`]: {
23
26
  padding: theme.spacing(1),
24
27
  },
@@ -24,6 +24,10 @@ export const SelectTokenCardHeader = styled(CardHeader, {
24
24
  [theme.breakpoints.down(theme.breakpoints.values.sm)]: {
25
25
  width: 224,
26
26
  },
27
+ [theme.breakpoints.down(theme.breakpoints.values.xs)]: {
28
+ width: 180,
29
+ fontSize: 16,
30
+ },
27
31
  },
28
32
  [`.${cardHeaderClasses.subheader}`]: {
29
33
  textOverflow: 'ellipsis',
@@ -33,6 +37,9 @@ export const SelectTokenCardHeader = styled(CardHeader, {
33
37
  [theme.breakpoints.down(theme.breakpoints.values.sm)]: {
34
38
  width: 224,
35
39
  },
40
+ [theme.breakpoints.down(theme.breakpoints.values.xs)]: {
41
+ width: 180,
42
+ },
36
43
  },
37
44
  variants: [
38
45
  {
@@ -1,2 +1,2 @@
1
1
  export const name = '@lifi/widget'
2
- export const version = '3.29.0-beta.0'
2
+ export const version = '3.29.0'
@@ -0,0 +1,6 @@
1
+ import { useWidgetConfig } from '../providers/WidgetProvider/WidgetProvider.js'
2
+
3
+ export function useInternalWalletProvider(hasExternalContext: boolean) {
4
+ const { walletConfig } = useWidgetConfig()
5
+ return walletConfig?.forceInternalWalletManagement || !hasExternalContext
6
+ }
package/src/i18n/bn.json CHANGED
@@ -240,6 +240,7 @@
240
240
  "process": {
241
241
  "bridge": {
242
242
  "actionRequired": "",
243
+ "messageRequired": "",
243
244
  "done": "",
244
245
  "pending": "",
245
246
  "started": ""
@@ -258,14 +259,11 @@
258
259
  },
259
260
  "swap": {
260
261
  "actionRequired": "",
262
+ "messageRequired": "",
261
263
  "done": "সোওয়াপ সম্পন্ন হয়েছে",
262
264
  "pending": "",
263
265
  "started": "সোয়াপ লেনদেন প্রস্তুত করা হচ্ছে"
264
266
  },
265
- "switchChain": {
266
- "actionRequired": "",
267
- "done": ""
268
- },
269
267
  "permit": {
270
268
  "actionRequired": "",
271
269
  "done": "",
package/src/i18n/de.json CHANGED
@@ -240,6 +240,7 @@
240
240
  "process": {
241
241
  "bridge": {
242
242
  "actionRequired": "",
243
+ "messageRequired": "",
243
244
  "done": "",
244
245
  "pending": "",
245
246
  "started": ""
@@ -258,14 +259,11 @@
258
259
  },
259
260
  "swap": {
260
261
  "actionRequired": "",
262
+ "messageRequired": "",
261
263
  "done": "Swap abgeschlossen",
262
264
  "pending": "",
263
265
  "started": "Swap vorbereiten"
264
266
  },
265
- "switchChain": {
266
- "actionRequired": "",
267
- "done": ""
268
- },
269
267
  "permit": {
270
268
  "actionRequired": "",
271
269
  "done": "",
package/src/i18n/es.json CHANGED
@@ -240,6 +240,7 @@
240
240
  "process": {
241
241
  "bridge": {
242
242
  "actionRequired": "",
243
+ "messageRequired": "",
243
244
  "done": "Transacción de puente confirmada",
244
245
  "pending": "",
245
246
  "started": "Preparando transacción de puente"
@@ -258,14 +259,11 @@
258
259
  },
259
260
  "swap": {
260
261
  "actionRequired": "",
262
+ "messageRequired": "",
261
263
  "done": "Swap completado.",
262
264
  "pending": "",
263
265
  "started": "Preparando transacción de intercambio"
264
266
  },
265
- "switchChain": {
266
- "actionRequired": "",
267
- "done": ""
268
- },
269
267
  "permit": {
270
268
  "actionRequired": "",
271
269
  "done": "",
package/src/i18n/fr.json CHANGED
@@ -240,6 +240,7 @@
240
240
  "process": {
241
241
  "bridge": {
242
242
  "actionRequired": "",
243
+ "messageRequired": "",
243
244
  "done": "Transaction Bridge confirmée",
244
245
  "pending": "",
245
246
  "started": "Préparation de la transaction bridge"
@@ -258,14 +259,11 @@
258
259
  },
259
260
  "swap": {
260
261
  "actionRequired": "",
262
+ "messageRequired": "",
261
263
  "done": "Échange terminé.",
262
264
  "pending": "",
263
265
  "started": "Préparation de la transaction d'échange"
264
266
  },
265
- "switchChain": {
266
- "actionRequired": "",
267
- "done": ""
268
- },
269
267
  "permit": {
270
268
  "actionRequired": "",
271
269
  "done": "",
package/src/i18n/hi.json CHANGED
@@ -240,6 +240,7 @@
240
240
  "process": {
241
241
  "bridge": {
242
242
  "actionRequired": "",
243
+ "messageRequired": "",
243
244
  "done": "",
244
245
  "pending": "",
245
246
  "started": ""
@@ -258,14 +259,11 @@
258
259
  },
259
260
  "swap": {
260
261
  "actionRequired": "",
262
+ "messageRequired": "",
261
263
  "done": "",
262
264
  "pending": "",
263
265
  "started": ""
264
266
  },
265
- "switchChain": {
266
- "actionRequired": "",
267
- "done": ""
268
- },
269
267
  "permit": {
270
268
  "actionRequired": "",
271
269
  "done": "",
package/src/i18n/id.json CHANGED
@@ -240,6 +240,7 @@
240
240
  "process": {
241
241
  "bridge": {
242
242
  "actionRequired": "Mempersiapkan transaksi bridge",
243
+ "messageRequired": "",
243
244
  "done": "Tranksaksi bridge dikonfirmasi",
244
245
  "pending": "Transaksi bridge tertunda",
245
246
  "started": "Mempersiapkan transaksi bridge"
@@ -258,14 +259,11 @@
258
259
  },
259
260
  "swap": {
260
261
  "actionRequired": "Mempersiapkan transaksi bridge",
262
+ "messageRequired": "",
261
263
  "done": "Swap selesai",
262
264
  "pending": "Transaksi swap tertunda",
263
265
  "started": "Mempersiapkan transaksi swap"
264
266
  },
265
- "switchChain": {
266
- "actionRequired": "Konfirmasikan pergantian rantai",
267
- "done": "Rantai beralih"
268
- },
269
267
  "permit": {
270
268
  "actionRequired": "Tanda tangani pesan izin",
271
269
  "done": "Permit tertandatangani",
package/src/i18n/it.json CHANGED
@@ -240,6 +240,7 @@
240
240
  "process": {
241
241
  "bridge": {
242
242
  "actionRequired": "",
243
+ "messageRequired": "",
243
244
  "done": "",
244
245
  "pending": "",
245
246
  "started": ""
@@ -258,14 +259,11 @@
258
259
  },
259
260
  "swap": {
260
261
  "actionRequired": "",
262
+ "messageRequired": "",
261
263
  "done": "Scambio completato",
262
264
  "pending": "",
263
265
  "started": "Preparazione dello scambio"
264
266
  },
265
- "switchChain": {
266
- "actionRequired": "",
267
- "done": ""
268
- },
269
267
  "permit": {
270
268
  "actionRequired": "",
271
269
  "done": "",
package/src/i18n/ja.json CHANGED
@@ -240,6 +240,7 @@
240
240
  "process": {
241
241
  "bridge": {
242
242
  "actionRequired": "",
243
+ "messageRequired": "",
243
244
  "done": "ブリッジのトランザクションが確認されました",
244
245
  "pending": "",
245
246
  "started": "ブリッジのトランザクションを準備中"
@@ -258,14 +259,11 @@
258
259
  },
259
260
  "swap": {
260
261
  "actionRequired": "",
262
+ "messageRequired": "",
261
263
  "done": "スワップ完了",
262
264
  "pending": "",
263
265
  "started": "スワップのトランザクションを準備中"
264
266
  },
265
- "switchChain": {
266
- "actionRequired": "",
267
- "done": ""
268
- },
269
267
  "permit": {
270
268
  "actionRequired": "",
271
269
  "done": "",
package/src/i18n/ko.json CHANGED
@@ -240,6 +240,7 @@
240
240
  "process": {
241
241
  "bridge": {
242
242
  "actionRequired": "",
243
+ "messageRequired": "",
243
244
  "done": "",
244
245
  "pending": "",
245
246
  "started": ""
@@ -258,14 +259,11 @@
258
259
  },
259
260
  "swap": {
260
261
  "actionRequired": "",
262
+ "messageRequired": "",
261
263
  "done": "스왑 완료",
262
264
  "pending": "",
263
265
  "started": "스왑 트랜잭션 준비 중"
264
266
  },
265
- "switchChain": {
266
- "actionRequired": "",
267
- "done": ""
268
- },
269
267
  "permit": {
270
268
  "actionRequired": "",
271
269
  "done": "",
package/src/i18n/pl.json CHANGED
@@ -240,6 +240,7 @@
240
240
  "process": {
241
241
  "bridge": {
242
242
  "actionRequired": "",
243
+ "messageRequired": "",
243
244
  "done": "",
244
245
  "pending": "",
245
246
  "started": ""
@@ -258,14 +259,11 @@
258
259
  },
259
260
  "swap": {
260
261
  "actionRequired": "",
262
+ "messageRequired": "",
261
263
  "done": "",
262
264
  "pending": "",
263
265
  "started": ""
264
266
  },
265
- "switchChain": {
266
- "actionRequired": "",
267
- "done": ""
268
- },
269
267
  "permit": {
270
268
  "actionRequired": "",
271
269
  "done": "",
package/src/i18n/pt.json CHANGED
@@ -240,6 +240,7 @@
240
240
  "process": {
241
241
  "bridge": {
242
242
  "actionRequired": "Assinar a transação de transferência de fundos entre redes",
243
+ "messageRequired": "",
243
244
  "done": "Transação da ponte confirmada",
244
245
  "pending": "Transação de transferência de fundos entre redes, pendente",
245
246
  "started": "Preparando a transação da ponte"
@@ -258,14 +259,11 @@
258
259
  },
259
260
  "swap": {
260
261
  "actionRequired": "Assinar transação de troca",
262
+ "messageRequired": "",
261
263
  "done": "Conversão concluída",
262
264
  "pending": "Transação de troca pendente",
263
265
  "started": "Preparando a transação de conversão"
264
266
  },
265
- "switchChain": {
266
- "actionRequired": "Confirmar troca de rede",
267
- "done": "Rede alterada"
268
- },
269
267
  "permit": {
270
268
  "actionRequired": "Assinar mensagem de permissão",
271
269
  "done": "Mensagem de permissão assinada",
package/src/i18n/th.json CHANGED
@@ -240,6 +240,7 @@
240
240
  "process": {
241
241
  "bridge": {
242
242
  "actionRequired": "",
243
+ "messageRequired": "",
243
244
  "done": "ธุรกรรมข้ามเชนได้รับการยืนยันแล้ว",
244
245
  "pending": "",
245
246
  "started": "เตรียมการทำรายการบริดจ์"
@@ -258,14 +259,11 @@
258
259
  },
259
260
  "swap": {
260
261
  "actionRequired": "",
262
+ "messageRequired": "",
261
263
  "done": "การแลกเปลี่ยนเสร็จสมบูรณ์",
262
264
  "pending": "",
263
265
  "started": "กำลังเตรียมการแลกเปลี่ยนธุรกรรม"
264
266
  },
265
- "switchChain": {
266
- "actionRequired": "",
267
- "done": ""
268
- },
269
267
  "permit": {
270
268
  "actionRequired": "",
271
269
  "done": "",
package/src/i18n/tr.json CHANGED
@@ -240,6 +240,7 @@
240
240
  "process": {
241
241
  "bridge": {
242
242
  "actionRequired": "",
243
+ "messageRequired": "",
243
244
  "done": "Köprü işlemi teyit edildi",
244
245
  "pending": "",
245
246
  "started": "Köprü işlemi hazırlanıyor"
@@ -258,14 +259,11 @@
258
259
  },
259
260
  "swap": {
260
261
  "actionRequired": "",
262
+ "messageRequired": "",
261
263
  "done": "Takas işlemi tamamlandı",
262
264
  "pending": "",
263
265
  "started": "Takas işlemi hazırlanıyor"
264
266
  },
265
- "switchChain": {
266
- "actionRequired": "",
267
- "done": ""
268
- },
269
267
  "permit": {
270
268
  "actionRequired": "",
271
269
  "done": "",
package/src/i18n/uk.json CHANGED
@@ -240,6 +240,7 @@
240
240
  "process": {
241
241
  "bridge": {
242
242
  "actionRequired": "Підпишіть бридж транзакцію",
243
+ "messageRequired": "",
243
244
  "done": "Бридж транзакцію схвалено",
244
245
  "pending": "Очікування бридж операції",
245
246
  "started": "Підготовка бридж транзакції"
@@ -258,14 +259,11 @@
258
259
  },
259
260
  "swap": {
260
261
  "actionRequired": "Підпишіть своп транзакцію",
262
+ "messageRequired": "",
261
263
  "done": "Своп завершено",
262
264
  "pending": "Очікування своп операції",
263
265
  "started": "Підготовка своп транзакції"
264
266
  },
265
- "switchChain": {
266
- "actionRequired": "Підтвердіть перемикання чейна",
267
- "done": "Чейн перемкнено"
268
- },
269
267
  "permit": {
270
268
  "actionRequired": "Підпишіть дозвіл на витрати",
271
269
  "done": "Дозвіл на витрати підписано",
package/src/i18n/vi.json CHANGED
@@ -240,6 +240,7 @@
240
240
  "process": {
241
241
  "bridge": {
242
242
  "actionRequired": "",
243
+ "messageRequired": "",
243
244
  "done": "Giao dịch cầu đã được xác nhận",
244
245
  "pending": "",
245
246
  "started": "Chuẩn bị giao dịch cầu"
@@ -258,14 +259,11 @@
258
259
  },
259
260
  "swap": {
260
261
  "actionRequired": "",
262
+ "messageRequired": "",
261
263
  "done": "Lệnh swap đã hoàn tất",
262
264
  "pending": "",
263
265
  "started": "Đang chuẩn bị giao dịch Swap"
264
266
  },
265
- "switchChain": {
266
- "actionRequired": "",
267
- "done": ""
268
- },
269
267
  "permit": {
270
268
  "actionRequired": "",
271
269
  "done": "",
package/src/i18n/zh.json CHANGED
@@ -240,6 +240,7 @@
240
240
  "process": {
241
241
  "bridge": {
242
242
  "actionRequired": "",
243
+ "messageRequired": "",
243
244
  "done": "跨链交易已确认",
244
245
  "pending": "",
245
246
  "started": "准备执行跨链交易"
@@ -258,14 +259,11 @@
258
259
  },
259
260
  "swap": {
260
261
  "actionRequired": "",
262
+ "messageRequired": "",
261
263
  "done": "兑换完成",
262
264
  "pending": "",
263
265
  "started": "准备兑换"
264
266
  },
265
- "switchChain": {
266
- "actionRequired": "",
267
- "done": ""
268
- },
269
267
  "permit": {
270
268
  "actionRequired": "",
271
269
  "done": "",
@@ -1,4 +1,4 @@
1
- import { Box } from '@mui/material'
1
+ import { Box, type Theme, useMediaQuery } from '@mui/material'
2
2
  import type { FC, RefObject } from 'react'
3
3
  import { useRef } from 'react'
4
4
  import { useTranslation } from 'react-i18next'
@@ -41,27 +41,42 @@ export const SelectTokenPage: FC<FormTypeProps> = ({ formType }) => {
41
41
  (swapOnly && formType === 'to') ||
42
42
  hiddenUI?.includes(HiddenUI.ChainSelect)
43
43
 
44
+ const isMobile = useMediaQuery((theme: Theme) =>
45
+ theme.breakpoints.down(theme.breakpoints.values.xs)
46
+ )
47
+ const hideSearchTokenInput = hiddenUI?.includes(HiddenUI.SearchTokenInput)
48
+
49
+ const hasHeader = !hideChainSelect || !hideSearchTokenInput
50
+
44
51
  return (
45
52
  <FullPageContainer disableGutters>
46
53
  <Box
47
54
  ref={headerRef}
48
55
  sx={{
49
- pb: 2,
56
+ pb: hasHeader ? 2 : 0,
50
57
  px: 3,
51
58
  }}
52
59
  >
53
60
  {!hideChainSelect ? <ChainSelect formType={formType} /> : null}
54
- <Box
55
- sx={{
56
- mt: !hideChainSelect ? 2 : 0,
57
- }}
58
- >
59
- <SearchTokenInput />
60
- </Box>
61
+ {!hideSearchTokenInput && (
62
+ <Box
63
+ sx={{
64
+ mt: !hideChainSelect ? 2 : 0,
65
+ }}
66
+ >
67
+ <SearchTokenInput />
68
+ </Box>
69
+ )}
61
70
  </Box>
62
71
  <WrappedTokenList
63
72
  // Rerender component if variant changes (since chains tiles change height)
64
- key={hideChainSelect ? 'without-offset' : 'with-offset'}
73
+ key={
74
+ hideChainSelect
75
+ ? 'without-offset'
76
+ : isMobile
77
+ ? 'with-offset-mobile'
78
+ : 'with-offset'
79
+ }
65
80
  headerRef={headerRef}
66
81
  formType={formType}
67
82
  />
@@ -1,6 +1,7 @@
1
1
  import { ChainType } from '@lifi/sdk'
2
2
  import { type FC, type PropsWithChildren, useContext } from 'react'
3
3
  import { WagmiContext } from 'wagmi'
4
+ import { useInternalWalletProvider } from '../../hooks/useInternalWalletProvider.js'
4
5
  import { isItemAllowed } from '../../utils/item.js'
5
6
  import { useWidgetConfig } from '../WidgetProvider/WidgetProvider.js'
6
7
  import { EVMBaseProvider } from './EVMBaseProvider.js'
@@ -15,12 +16,13 @@ export function useInWagmiContext(): boolean {
15
16
 
16
17
  export const EVMProvider: FC<PropsWithChildren> = ({ children }) => {
17
18
  const inWagmiContext = useInWagmiContext()
19
+ const useInternalWallet = useInternalWalletProvider(inWagmiContext)
18
20
 
19
- return inWagmiContext ? (
21
+ return useInternalWallet ? (
22
+ <EVMBaseProvider>{children}</EVMBaseProvider>
23
+ ) : (
20
24
  <EVMExternalContext.Provider value={inWagmiContext}>
21
25
  {children}
22
26
  </EVMExternalContext.Provider>
23
- ) : (
24
- <EVMBaseProvider>{children}</EVMBaseProvider>
25
27
  )
26
28
  }