@lifi/widget 4.0.0-beta.13 → 4.0.0-beta.17
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/AppDefault.js +31 -29
- package/dist/esm/AppDefault.js.map +1 -1
- package/dist/esm/AppLayout.js +2 -2
- package/dist/esm/AppLayout.js.map +1 -1
- package/dist/esm/components/AmountInput/AmountInput.js +2 -2
- package/dist/esm/components/AmountInput/AmountInput.js.map +1 -1
- package/dist/esm/components/AmountInput/PriceFormHelperText.style.js +2 -2
- package/dist/esm/components/AmountInput/PriceFormHelperText.style.js.map +1 -1
- package/dist/esm/components/AppContainer.js +3 -3
- package/dist/esm/components/AppContainer.js.map +1 -1
- package/dist/esm/components/ButtonTertiary.js +6 -6
- package/dist/esm/components/ButtonTertiary.js.map +1 -1
- package/dist/esm/components/Card/Card.js +2 -2
- package/dist/esm/components/Card/Card.js.map +1 -1
- package/dist/esm/components/Card/CardIconButton.js +2 -2
- package/dist/esm/components/Card/CardIconButton.js.map +1 -1
- package/dist/esm/components/Card/CardLabel.js +2 -2
- package/dist/esm/components/Card/CardLabel.js.map +1 -1
- package/dist/esm/components/Chains/AllChainsAvatar.js +6 -0
- package/dist/esm/components/Chains/AllChainsAvatar.js.map +1 -1
- package/dist/esm/components/ContextMenu.style.js +1 -1
- package/dist/esm/components/ContextMenu.style.js.map +1 -1
- package/dist/esm/components/ContractComponent/ItemPrice.js +1 -1
- package/dist/esm/components/ContractComponent/ItemPrice.js.map +1 -1
- package/dist/esm/components/ContractComponent/NFT/NFTBase.js +1 -1
- package/dist/esm/components/ContractComponent/NFT/NFTBase.js.map +1 -1
- package/dist/esm/components/Expansion/Expansion.js +4 -4
- package/dist/esm/components/Expansion/Expansion.js.map +1 -1
- package/dist/esm/components/Header/ActivitiesButton.js +1 -1
- package/dist/esm/components/Header/ActivitiesButton.js.map +1 -1
- package/dist/esm/components/Header/ActivitiesButton.style.js +4 -4
- package/dist/esm/components/Header/ActivitiesButton.style.js.map +1 -1
- package/dist/esm/components/Header/Header.js +2 -2
- package/dist/esm/components/Header/Header.js.map +1 -1
- package/dist/esm/components/Header/Header.style.js +2 -2
- package/dist/esm/components/Header/Header.style.js.map +1 -1
- package/dist/esm/components/Header/NavigationHeader.js +3 -3
- package/dist/esm/components/Header/NavigationHeader.js.map +1 -1
- package/dist/esm/components/Header/SettingsButton.style.js +8 -8
- package/dist/esm/components/Header/SettingsButton.style.js.map +1 -1
- package/dist/esm/components/Header/WalletHeader.js +3 -3
- package/dist/esm/components/Header/WalletHeader.js.map +1 -1
- package/dist/esm/components/IconCircle/IconCircle.style.js +7 -7
- package/dist/esm/components/IconCircle/IconCircle.style.js.map +1 -1
- package/dist/esm/components/IconTypography.js +2 -2
- package/dist/esm/components/IconTypography.js.map +1 -1
- package/dist/esm/components/ListItemButton.js +1 -1
- package/dist/esm/components/ListItemButton.js.map +1 -1
- package/dist/esm/components/Messages/AlertMessage.js +1 -1
- package/dist/esm/components/Messages/AlertMessage.js.map +1 -1
- package/dist/esm/components/Messages/AlertMessage.style.js +4 -4
- package/dist/esm/components/Messages/AlertMessage.style.js.map +1 -1
- package/dist/esm/components/Messages/GasRefuelMessage.style.js +2 -2
- package/dist/esm/components/Messages/GasRefuelMessage.style.js.map +1 -1
- package/dist/esm/components/PageEntered.js +2 -2
- package/dist/esm/components/PageEntered.js.map +1 -1
- package/dist/esm/components/RouteCard/RouteCard.js +2 -2
- package/dist/esm/components/RouteCard/RouteCard.js.map +1 -1
- package/dist/esm/components/RouteCard/RouteCardEssentials.js +10 -4
- package/dist/esm/components/RouteCard/RouteCardEssentials.js.map +1 -1
- package/dist/esm/components/RouteCard/RouteToken.js +2 -2
- package/dist/esm/components/RouteCard/RouteToken.js.map +1 -1
- package/dist/esm/components/Routes/RoutesExpanded.js +3 -3
- package/dist/esm/components/Routes/RoutesExpanded.js.map +1 -1
- package/dist/esm/components/SelectChainAndToken.js +8 -5
- package/dist/esm/components/SelectChainAndToken.js.map +1 -1
- package/dist/esm/components/SelectTokenButton/SelectTokenButton.style.js +1 -2
- package/dist/esm/components/SelectTokenButton/SelectTokenButton.style.js.map +1 -1
- package/dist/esm/components/SendToWallet/SendToWalletButton.js +3 -3
- package/dist/esm/components/SendToWallet/SendToWalletButton.js.map +1 -1
- package/dist/esm/components/SendToWallet/SendToWalletExpandButton.js +3 -3
- package/dist/esm/components/SendToWallet/SendToWalletExpandButton.js.map +1 -1
- package/dist/esm/components/Step/CircularProgress.style.js +4 -4
- package/dist/esm/components/Step/CircularProgress.style.js.map +1 -1
- package/dist/esm/components/Step/Step.js +20 -9
- package/dist/esm/components/Step/Step.js.map +1 -1
- package/dist/esm/components/Step/StepActions.js +2 -2
- package/dist/esm/components/Step/StepActions.js.map +1 -1
- package/dist/esm/components/StepActions/StepActions.js +2 -2
- package/dist/esm/components/StepActions/StepActions.js.map +1 -1
- package/dist/esm/components/StepActions/StepActions.style.js +4 -4
- package/dist/esm/components/StepActions/StepActions.style.js.map +1 -1
- package/dist/esm/components/Switch.js +2 -2
- package/dist/esm/components/Switch.js.map +1 -1
- package/dist/esm/components/Tabs/NavigationTabs.js +2 -2
- package/dist/esm/components/Tabs/NavigationTabs.js.map +1 -1
- package/dist/esm/components/Tabs/Tabs.style.js +3 -3
- package/dist/esm/components/Tabs/Tabs.style.js.map +1 -1
- package/dist/esm/components/Timer/TimerContent.js +1 -0
- package/dist/esm/components/Timer/TimerContent.js.map +1 -1
- package/dist/esm/components/Token/Token.js +2 -2
- package/dist/esm/components/Token/Token.js.map +1 -1
- package/dist/esm/components/Token/Token.style.js +1 -1
- package/dist/esm/components/Token/Token.style.js.map +1 -1
- package/dist/esm/components/TokenList/TokenDetailsSheetContent.js +6 -4
- package/dist/esm/components/TokenList/TokenDetailsSheetContent.js.map +1 -1
- package/dist/esm/components/TokenList/TokenList.js +2 -2
- package/dist/esm/components/TokenList/TokenList.js.map +1 -1
- package/dist/esm/components/TokenList/TokenList.style.js +1 -1
- package/dist/esm/components/TokenList/TokenList.style.js.map +1 -1
- package/dist/esm/components/TokenList/useTokenSelect.js +2 -2
- package/dist/esm/components/TokenList/useTokenSelect.js.map +1 -1
- package/dist/esm/components/TransactionCard/ActiveTransactionCard.js +2 -3
- package/dist/esm/components/TransactionCard/ActiveTransactionCard.js.map +1 -1
- package/dist/esm/components/TransactionCard/ActiveTransactionCard.style.js +1 -1
- package/dist/esm/components/TransactionCard/ActiveTransactionCard.style.js.map +1 -1
- package/dist/esm/components/TransactionDetails.js +5 -2
- package/dist/esm/components/TransactionDetails.js.map +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/useAddressValidation.js +3 -8
- package/dist/esm/hooks/useAddressValidation.js.map +1 -1
- package/dist/esm/hooks/useAvailableChains.js +2 -1
- package/dist/esm/hooks/useAvailableChains.js.map +1 -1
- package/dist/esm/hooks/useContactSupport.js +3 -3
- package/dist/esm/hooks/useContactSupport.js.map +1 -1
- package/dist/esm/hooks/useExplorer.js +15 -4
- package/dist/esm/hooks/useExplorer.js.map +1 -1
- package/dist/esm/hooks/useGasRecommendation.js +2 -2
- package/dist/esm/hooks/useGasRecommendation.js.map +1 -1
- package/dist/esm/hooks/useGasRefuel.js +2 -2
- package/dist/esm/hooks/useGasRefuel.js.map +1 -1
- package/dist/esm/hooks/useGasSufficiency.js +2 -2
- package/dist/esm/hooks/useGasSufficiency.js.map +1 -1
- package/dist/esm/hooks/useHasChainExpansion.js +3 -3
- package/dist/esm/hooks/useHasChainExpansion.js.map +1 -1
- package/dist/esm/hooks/useListHeight.js +2 -2
- package/dist/esm/hooks/useListHeight.js.map +1 -1
- package/dist/esm/hooks/useRouteExecution.js +5 -5
- package/dist/esm/hooks/useRouteExecution.js.map +1 -1
- package/dist/esm/hooks/useRoutes.js +4 -4
- package/dist/esm/hooks/useRoutes.js.map +1 -1
- package/dist/esm/hooks/useToAddressRequirements.js +2 -2
- package/dist/esm/hooks/useToAddressRequirements.js.map +1 -1
- package/dist/esm/hooks/useToAddressReset.js +2 -2
- package/dist/esm/hooks/useToAddressReset.js.map +1 -1
- package/dist/esm/hooks/useTokenBalances.js +2 -2
- package/dist/esm/hooks/useTokenBalances.js.map +1 -1
- package/dist/esm/hooks/useTokens.js +4 -2
- package/dist/esm/hooks/useTokens.js.map +1 -1
- package/dist/esm/hooks/useTransactionList.js +2 -3
- package/dist/esm/hooks/useTransactionList.js.map +1 -1
- package/dist/esm/i18n/en.json +3 -0
- package/dist/esm/pages/ActivitiesPage/ActivitiesPage.js +1 -2
- package/dist/esm/pages/ActivitiesPage/ActivitiesPage.js.map +1 -1
- package/dist/esm/pages/ActivitiesPage/ActivitiesPageMenuButton.js +1 -1
- package/dist/esm/pages/ActivitiesPage/ActivitiesPageMenuButton.js.map +1 -1
- package/dist/esm/pages/MainPage/MainPage.js +6 -6
- package/dist/esm/pages/MainPage/MainPage.js.map +1 -1
- package/dist/esm/pages/MainPage/ReviewButton.js +2 -2
- package/dist/esm/pages/MainPage/ReviewButton.js.map +1 -1
- package/dist/esm/pages/RoutesPage/RoutesPage.js +3 -3
- package/dist/esm/pages/RoutesPage/RoutesPage.js.map +1 -1
- package/dist/esm/pages/SelectTokenPage/SelectTokenPage.js +3 -3
- package/dist/esm/pages/SelectTokenPage/SelectTokenPage.js.map +1 -1
- package/dist/esm/pages/SendToWallet/BookmarksPage.js +1 -1
- package/dist/esm/pages/SendToWallet/BookmarksPage.js.map +1 -1
- package/dist/esm/pages/SendToWallet/RecentWalletsPage.js +1 -1
- package/dist/esm/pages/SendToWallet/RecentWalletsPage.js.map +1 -1
- package/dist/esm/pages/SendToWallet/SendToWalletPage.js +6 -6
- package/dist/esm/pages/SendToWallet/SendToWalletPage.js.map +1 -1
- package/dist/esm/pages/SettingsPage/BridgeAndExchangeSettings.js +2 -2
- package/dist/esm/pages/SettingsPage/BridgeAndExchangeSettings.js.map +1 -1
- package/dist/esm/pages/SettingsPage/LanguageSetting.js +2 -2
- package/dist/esm/pages/SettingsPage/LanguageSetting.js.map +1 -1
- package/dist/esm/pages/SettingsPage/ResetSettingsButton.style.js +2 -2
- package/dist/esm/pages/SettingsPage/ResetSettingsButton.style.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SettingsPage.js +2 -2
- package/dist/esm/pages/SettingsPage/SettingsPage.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.style.js +5 -5
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.style.js.map +1 -1
- package/dist/esm/pages/SettingsPage/ThemeSettings.js +2 -2
- package/dist/esm/pages/SettingsPage/ThemeSettings.js.map +1 -1
- package/dist/esm/pages/TransactionDetailsPage/ActionRow.style.js +2 -2
- package/dist/esm/pages/TransactionDetailsPage/ActionRow.style.js.map +1 -1
- package/dist/esm/pages/TransactionDetailsPage/ReceiptsCard.style.js +1 -1
- package/dist/esm/pages/TransactionDetailsPage/ReceiptsCard.style.js.map +1 -1
- package/dist/esm/pages/TransactionDetailsPage/TransferIdCard.js +2 -2
- package/dist/esm/pages/TransactionDetailsPage/TransferIdCard.js.map +1 -1
- package/dist/esm/pages/TransactionPage/ConfirmToAddressSheet.js +2 -2
- package/dist/esm/pages/TransactionPage/ConfirmToAddressSheet.js.map +1 -1
- package/dist/esm/pages/TransactionPage/ExchangeRateBottomSheet.js +1 -1
- package/dist/esm/pages/TransactionPage/ExchangeRateBottomSheet.js.map +1 -1
- package/dist/esm/pages/TransactionPage/StatusBottomSheet.js +20 -21
- package/dist/esm/pages/TransactionPage/StatusBottomSheet.js.map +1 -1
- package/dist/esm/pages/TransactionPage/StatusBottomSheet.style.js +12 -13
- package/dist/esm/pages/TransactionPage/StatusBottomSheet.style.js.map +1 -1
- package/dist/esm/pages/TransactionPage/TokenValueBottomSheet.js +14 -4
- package/dist/esm/pages/TransactionPage/TokenValueBottomSheet.js.map +1 -1
- package/dist/esm/pages/TransactionPage/TransactionPage.js +15 -19
- package/dist/esm/pages/TransactionPage/TransactionPage.js.map +1 -1
- package/dist/esm/providers/WalletProvider/useExternalWalletProvider.js +7 -3
- package/dist/esm/providers/WalletProvider/useExternalWalletProvider.js.map +1 -1
- package/dist/esm/stores/chains/ChainOrderStore.js +2 -2
- package/dist/esm/stores/chains/ChainOrderStore.js.map +1 -1
- package/dist/esm/stores/chains/createChainOrderStore.js +2 -2
- package/dist/esm/stores/chains/createChainOrderStore.js.map +1 -1
- package/dist/esm/stores/form/useFieldActions.js +3 -3
- package/dist/esm/stores/form/useFieldActions.js.map +1 -1
- package/dist/esm/stores/form/useFormRef.js +2 -2
- package/dist/esm/stores/form/useFormRef.js.map +1 -1
- package/dist/esm/stores/routes/createRouteExecutionStore.js +8 -9
- package/dist/esm/stores/routes/createRouteExecutionStore.js.map +1 -1
- package/dist/esm/stores/routes/useRouteExecutionIndicator.js +2 -3
- package/dist/esm/stores/routes/useRouteExecutionIndicator.js.map +1 -1
- package/dist/esm/stores/settings/createSettingsStore.js +1 -5
- package/dist/esm/stores/settings/createSettingsStore.js.map +1 -1
- package/dist/esm/stores/settings/useSettingsActions.js +2 -2
- package/dist/esm/stores/settings/useSettingsActions.js.map +1 -1
- package/dist/esm/themes/createTheme.js +19 -23
- package/dist/esm/themes/createTheme.js.map +1 -1
- package/dist/esm/themes/types.d.ts +0 -11
- package/dist/esm/themes/types.d.ts.map +1 -1
- package/dist/esm/themes/watermelonLight.js +1 -1
- package/dist/esm/themes/watermelonLight.js.map +1 -1
- package/dist/esm/types/events.d.ts +0 -5
- package/dist/esm/types/events.d.ts.map +1 -1
- package/dist/esm/types/events.js +0 -4
- package/dist/esm/types/events.js.map +1 -1
- package/dist/esm/types/widget.d.ts +1 -5
- package/dist/esm/types/widget.d.ts.map +1 -1
- package/dist/esm/types/widget.js.map +1 -1
- package/dist/esm/utils/elements.js +5 -12
- package/dist/esm/utils/elements.js.map +1 -1
- package/package.json +7 -7
- package/src/AppDefault.tsx +9 -11
- package/src/components/AmountInput/PriceFormHelperText.style.tsx +2 -2
- package/src/components/ButtonTertiary.tsx +6 -6
- package/src/components/Card/Card.tsx +2 -2
- package/src/components/Card/CardIconButton.tsx +2 -2
- package/src/components/Card/CardLabel.tsx +2 -2
- package/src/components/Chains/AllChainsAvatar.tsx +6 -0
- package/src/components/ContextMenu.style.tsx +1 -1
- package/src/components/ContractComponent/ItemPrice.tsx +1 -1
- package/src/components/ContractComponent/NFT/NFTBase.tsx +1 -1
- package/src/components/Header/ActivitiesButton.style.tsx +4 -4
- package/src/components/Header/ActivitiesButton.tsx +1 -1
- package/src/components/Header/Header.style.ts +2 -2
- package/src/components/Header/SettingsButton.style.tsx +8 -8
- package/src/components/IconCircle/IconCircle.style.tsx +7 -7
- package/src/components/IconTypography.ts +8 -8
- package/src/components/ListItemButton.tsx +1 -1
- package/src/components/Messages/AlertMessage.style.tsx +4 -4
- package/src/components/Messages/AlertMessage.tsx +1 -1
- package/src/components/Messages/GasRefuelMessage.style.ts +2 -2
- package/src/components/RouteCard/RouteCardEssentials.tsx +2 -2
- package/src/components/SelectChainAndToken.tsx +1 -1
- package/src/components/Step/CircularProgress.style.tsx +4 -4
- package/src/components/Step/Step.tsx +6 -7
- package/src/components/StepActions/StepActions.style.tsx +4 -4
- package/src/components/Switch.tsx +2 -2
- package/src/components/Tabs/NavigationTabs.tsx +2 -2
- package/src/components/Tabs/Tabs.style.tsx +3 -3
- package/src/components/Timer/TimerContent.tsx +1 -0
- package/src/components/Token/Token.style.tsx +1 -1
- package/src/components/Token/Token.tsx +2 -2
- package/src/components/TokenList/TokenDetailsSheetContent.tsx +6 -4
- package/src/components/TokenList/TokenList.style.tsx +1 -1
- package/src/components/TransactionCard/ActiveTransactionCard.style.tsx +1 -1
- package/src/components/TransactionCard/ActiveTransactionCard.tsx +1 -1
- package/src/components/TransactionDetails.tsx +1 -1
- package/src/config/version.ts +1 -1
- package/src/hooks/useAvailableChains.ts +1 -0
- package/src/hooks/useExplorer.ts +16 -5
- package/src/hooks/useTokens.ts +2 -0
- package/src/pages/ActivitiesPage/ActivitiesPageMenuButton.tsx +1 -1
- package/src/pages/MainPage/MainPage.tsx +3 -3
- package/src/pages/RoutesPage/RoutesPage.tsx +6 -1
- package/src/pages/SendToWallet/BookmarksPage.tsx +1 -1
- package/src/pages/SendToWallet/RecentWalletsPage.tsx +1 -1
- package/src/pages/SettingsPage/ResetSettingsButton.style.tsx +2 -2
- package/src/pages/SettingsPage/SlippageSettings/SlippageSettings.style.tsx +5 -5
- package/src/pages/TransactionDetailsPage/ActionRow.style.tsx +2 -2
- package/src/pages/TransactionDetailsPage/ReceiptsCard.style.tsx +1 -1
- package/src/pages/TransactionPage/ExchangeRateBottomSheet.tsx +1 -1
- package/src/pages/TransactionPage/StatusBottomSheet.style.tsx +7 -7
- package/src/pages/TransactionPage/StatusBottomSheet.tsx +1 -1
- package/src/pages/TransactionPage/TokenValueBottomSheet.tsx +27 -5
- package/src/pages/TransactionPage/TransactionPage.tsx +2 -9
- package/src/providers/WalletProvider/useExternalWalletProvider.ts +9 -1
- package/src/stores/settings/createSettingsStore.ts +1 -9
- package/src/themes/createTheme.ts +18 -24
- package/src/themes/types.ts +0 -12
- package/src/themes/watermelonLight.ts +1 -1
- package/src/types/events.ts +0 -5
- package/src/types/widget.ts +1 -4
- package/dist/esm/stores/routes/types.js +0 -14
- package/dist/esm/stores/routes/types.js.map +0 -1
|
@@ -24,7 +24,7 @@ export const SelectChainAndToken: React.FC<BoxProps> = (props) => {
|
|
|
24
24
|
const showReverseButton = !hiddenToToken && !hiddenFromToken
|
|
25
25
|
|
|
26
26
|
return (
|
|
27
|
-
<Box sx={{ display: 'flex'
|
|
27
|
+
<Box {...props} sx={{ display: 'flex', ...props.sx }}>
|
|
28
28
|
{!hiddenFromToken ? (
|
|
29
29
|
<SelectTokenButton formType="from" hiddenReverse={hiddenReverse} />
|
|
30
30
|
) : null}
|
|
@@ -18,14 +18,14 @@ const getStatusColor = (
|
|
|
18
18
|
case 'ACTION_REQUIRED':
|
|
19
19
|
case 'MESSAGE_REQUIRED':
|
|
20
20
|
case 'RESET_REQUIRED':
|
|
21
|
-
return `
|
|
21
|
+
return `color-mix(in srgb, ${theme.vars.palette.info.main} 12%, transparent)`
|
|
22
22
|
case 'DONE':
|
|
23
23
|
if (substatus === 'PARTIAL' || substatus === 'REFUNDED') {
|
|
24
|
-
return `
|
|
24
|
+
return `color-mix(in srgb, ${theme.vars.palette.warning.main} 48%, transparent)`
|
|
25
25
|
}
|
|
26
|
-
return `
|
|
26
|
+
return `color-mix(in srgb, ${theme.vars.palette.success.main} 12%, transparent)`
|
|
27
27
|
case 'FAILED':
|
|
28
|
-
return `
|
|
28
|
+
return `color-mix(in srgb, ${theme.vars.palette.error.main} 12%, transparent)`
|
|
29
29
|
default:
|
|
30
30
|
return null
|
|
31
31
|
}
|
|
@@ -87,18 +87,18 @@ export const Step: React.FC<{
|
|
|
87
87
|
flex: 1,
|
|
88
88
|
}}
|
|
89
89
|
>
|
|
90
|
-
<CardTitle
|
|
91
|
-
<
|
|
90
|
+
<CardTitle sx={{ flex: 1 }}>{getCardTitle()}</CardTitle>
|
|
91
|
+
<Box sx={{ p: 2, pb: 0, fontSize: 14, fontWeight: 600 }}>
|
|
92
92
|
<StepTimer step={step} />
|
|
93
|
-
</
|
|
93
|
+
</Box>
|
|
94
94
|
</Box>
|
|
95
95
|
<Box
|
|
96
96
|
sx={{
|
|
97
97
|
py: 1,
|
|
98
98
|
}}
|
|
99
99
|
>
|
|
100
|
-
{fromToken ? <Token token={fromToken}
|
|
101
|
-
<StepActions step={step}
|
|
100
|
+
{fromToken ? <Token token={fromToken} sx={{ px: 2, py: 1 }} /> : null}
|
|
101
|
+
<StepActions step={step} sx={{ px: 2, py: 1 }} dense />
|
|
102
102
|
{prepareActions(step.execution?.actions ?? []).map(
|
|
103
103
|
(actionsGroup, index) => (
|
|
104
104
|
<StepAction key={index} step={step} actionsGroup={actionsGroup} />
|
|
@@ -128,8 +128,7 @@ export const Step: React.FC<{
|
|
|
128
128
|
token={toToken}
|
|
129
129
|
impactToken={impactToken}
|
|
130
130
|
enableImpactTokenTooltip
|
|
131
|
-
|
|
132
|
-
py={1}
|
|
131
|
+
sx={{ px: 2, py: 1 }}
|
|
133
132
|
/>
|
|
134
133
|
) : null}
|
|
135
134
|
</Box>
|
|
@@ -20,9 +20,9 @@ export const StepConnector: React.FC<
|
|
|
20
20
|
[`.${stepConnectorClasses.line}`]: {
|
|
21
21
|
minHeight: 8,
|
|
22
22
|
borderLeftWidth: 2,
|
|
23
|
-
borderColor: `
|
|
23
|
+
borderColor: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 12%, transparent)`,
|
|
24
24
|
...theme.applyStyles('dark', {
|
|
25
|
-
borderColor: `
|
|
25
|
+
borderColor: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 16%, transparent)`,
|
|
26
26
|
}),
|
|
27
27
|
},
|
|
28
28
|
}))
|
|
@@ -66,9 +66,9 @@ export const StepContent: React.FC<
|
|
|
66
66
|
})<{ last?: boolean }>(({ theme }) => ({
|
|
67
67
|
margin: theme.spacing(0, 0, 0, 2.375),
|
|
68
68
|
paddingLeft: theme.spacing(4.375),
|
|
69
|
-
borderLeft: `2px solid
|
|
69
|
+
borderLeft: `2px solid color-mix(in srgb, ${theme.vars.palette.common.onBackground} 12%, transparent)`,
|
|
70
70
|
...theme.applyStyles('dark', {
|
|
71
|
-
borderLeft: `2px solid
|
|
71
|
+
borderLeft: `2px solid color-mix(in srgb, ${theme.vars.palette.common.onBackground} 16%, transparent)`,
|
|
72
72
|
}),
|
|
73
73
|
variants: [
|
|
74
74
|
{
|
|
@@ -29,7 +29,7 @@ export const Switch: React.FC<React.ComponentProps<typeof MuiSwitch>> = styled(
|
|
|
29
29
|
borderColor: theme.vars.palette.common.white,
|
|
30
30
|
},
|
|
31
31
|
[`&.${switchClasses.disabled} .${switchClasses.thumb}`]: {
|
|
32
|
-
color: `
|
|
32
|
+
color: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 12%, transparent)`,
|
|
33
33
|
},
|
|
34
34
|
[`&.${switchClasses.disabled} + .${switchClasses.track}`]: {
|
|
35
35
|
opacity: 0.7,
|
|
@@ -49,6 +49,6 @@ export const Switch: React.FC<React.ComponentProps<typeof MuiSwitch>> = styled(
|
|
|
49
49
|
transition: theme.transitions.create(['background-color'], {
|
|
50
50
|
duration: theme.transitions.duration.standard,
|
|
51
51
|
}),
|
|
52
|
-
backgroundColor: `
|
|
52
|
+
backgroundColor: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 16%, transparent)`,
|
|
53
53
|
},
|
|
54
54
|
}))
|
|
@@ -26,9 +26,9 @@ export const NavigationTabs: React.FC<React.ComponentProps<typeof Tabs>> =
|
|
|
26
26
|
height: '100%',
|
|
27
27
|
width: '100%',
|
|
28
28
|
borderRadius: theme.vars.shape.borderRadius,
|
|
29
|
-
backgroundColor: `
|
|
29
|
+
backgroundColor: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 4%, transparent)`,
|
|
30
30
|
...theme.applyStyles('dark', {
|
|
31
|
-
backgroundColor: `
|
|
31
|
+
backgroundColor: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 8%, transparent)`,
|
|
32
32
|
}),
|
|
33
33
|
},
|
|
34
34
|
}))
|
|
@@ -24,14 +24,14 @@ const Tabs = styled(MuiTabs)(({ theme }) => ({
|
|
|
24
24
|
export const CardTabs: React.FC<React.ComponentProps<typeof MuiTabs>> = styled(
|
|
25
25
|
Tabs
|
|
26
26
|
)(({ theme }) => ({
|
|
27
|
-
backgroundColor: `
|
|
27
|
+
backgroundColor: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 4%, transparent)`,
|
|
28
28
|
[`.${tabsClasses.indicator}`]: {
|
|
29
29
|
backgroundColor: theme.vars.palette.background.paper,
|
|
30
30
|
},
|
|
31
31
|
...theme.applyStyles('dark', {
|
|
32
|
-
backgroundColor: `
|
|
32
|
+
backgroundColor: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 8%, transparent)`,
|
|
33
33
|
[`.${tabsClasses.indicator}`]: {
|
|
34
|
-
backgroundColor: `
|
|
34
|
+
backgroundColor: `color-mix(in srgb, ${theme.vars.palette.common.background} 56%, transparent)`,
|
|
35
35
|
},
|
|
36
36
|
}),
|
|
37
37
|
}))
|
|
@@ -151,7 +151,7 @@ const TokenBase: FC<TokenProps & BoxProps> = ({
|
|
|
151
151
|
})}
|
|
152
152
|
</TextSecondary>
|
|
153
153
|
{impactToken ? (
|
|
154
|
-
<TextSecondary
|
|
154
|
+
<TextSecondary sx={{ px: 0.5 }} dot>
|
|
155
155
|
•
|
|
156
156
|
</TextSecondary>
|
|
157
157
|
) : null}
|
|
@@ -176,7 +176,7 @@ const TokenBase: FC<TokenProps & BoxProps> = ({
|
|
|
176
176
|
)
|
|
177
177
|
) : null}
|
|
178
178
|
{!disableDescription ? (
|
|
179
|
-
<TextSecondary
|
|
179
|
+
<TextSecondary sx={{ px: 0.5 }} dot>
|
|
180
180
|
•
|
|
181
181
|
</TextSecondary>
|
|
182
182
|
) : null}
|
|
@@ -75,10 +75,12 @@ export const TokenDetailsSheetContent: React.ForwardRefExoticComponent<
|
|
|
75
75
|
) : (
|
|
76
76
|
<>
|
|
77
77
|
<Typography
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
78
|
+
sx={{
|
|
79
|
+
fontWeight: 700,
|
|
80
|
+
fontSize: '24px',
|
|
81
|
+
lineHeight: '24px',
|
|
82
|
+
color: 'text.primary',
|
|
83
|
+
}}
|
|
82
84
|
>
|
|
83
85
|
{token?.symbol || noDataLabel}
|
|
84
86
|
</Typography>
|
|
@@ -36,7 +36,7 @@ export const IconButton: React.FC<
|
|
|
36
36
|
minWidth: 'unset',
|
|
37
37
|
borderRadius: theme.vars.shape.borderRadiusTertiary,
|
|
38
38
|
'&:hover': {
|
|
39
|
-
backgroundColor: `
|
|
39
|
+
backgroundColor: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 4%, transparent)`,
|
|
40
40
|
},
|
|
41
41
|
svg: {
|
|
42
42
|
fontSize: 14,
|
|
@@ -24,7 +24,7 @@ export const StatusRow: React.FC<React.ComponentProps<typeof Box>> = styled(
|
|
|
24
24
|
gap: theme.spacing(1),
|
|
25
25
|
padding: theme.spacing(1),
|
|
26
26
|
borderRadius: theme.vars.shape.borderRadiusTertiary,
|
|
27
|
-
backgroundColor: `
|
|
27
|
+
backgroundColor: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 4%, transparent)`,
|
|
28
28
|
}))
|
|
29
29
|
|
|
30
30
|
export const DeleteButton: React.FC<React.ComponentProps<typeof IconButton>> =
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RouteExtended } from '@lifi/sdk'
|
|
2
|
-
import DeleteOutline from '@mui/icons-material/
|
|
2
|
+
import DeleteOutline from '@mui/icons-material/DeleteOutlined'
|
|
3
3
|
import { Box, Tooltip, Typography } from '@mui/material'
|
|
4
4
|
import type { JSX, MouseEvent } from 'react'
|
|
5
5
|
import { useTranslation } from 'react-i18next'
|
|
@@ -113,7 +113,7 @@ export const TransactionDetails: React.FC<TransactionDetailsProps> = ({
|
|
|
113
113
|
cursor: 'pointer',
|
|
114
114
|
}}
|
|
115
115
|
>
|
|
116
|
-
<IconTypography
|
|
116
|
+
<IconTypography component="span" sx={{ mr: 0.5, fontSize: 16 }}>
|
|
117
117
|
<LocalGasStationRounded fontSize="inherit" />
|
|
118
118
|
</IconTypography>
|
|
119
119
|
<Typography
|
package/src/config/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = '@lifi/widget'
|
|
2
|
-
export const version = '4.0.0-beta.
|
|
2
|
+
export const version = '4.0.0-beta.17'
|
package/src/hooks/useExplorer.ts
CHANGED
|
@@ -6,6 +6,13 @@ import { useWidgetConfig } from '../providers/WidgetProvider/WidgetProvider.js'
|
|
|
6
6
|
|
|
7
7
|
const sanitiseBaseUrl = (baseUrl: string) => baseUrl.trim().replace(/\/+$/, '')
|
|
8
8
|
|
|
9
|
+
const explorerPathOverrides: Partial<
|
|
10
|
+
Record<ChainType | ChainId, { txPath: string; addressPath: string }>
|
|
11
|
+
> = {
|
|
12
|
+
[ChainId.SUI]: { txPath: 'txblock', addressPath: 'coin' },
|
|
13
|
+
[ChainType.TVM]: { txPath: '#/transaction', addressPath: '#/address' },
|
|
14
|
+
}
|
|
15
|
+
|
|
9
16
|
type TransactionLinkProps = { chain?: Chain | number } & (
|
|
10
17
|
| {
|
|
11
18
|
txHash: string
|
|
@@ -35,11 +42,15 @@ export const useExplorer = (): {
|
|
|
35
42
|
resolvedChain.metamask.blockExplorerUrls[0])
|
|
36
43
|
: explorerUrls?.internal?.[0]) || internalExplorerUrl
|
|
37
44
|
|
|
38
|
-
const
|
|
45
|
+
const baseUrl =
|
|
46
|
+
typeof explorerUrl === 'string' ? explorerUrl : explorerUrl.url
|
|
47
|
+
|
|
48
|
+
const overrides =
|
|
49
|
+
explorerPathOverrides[resolvedChain?.id as ChainId] ??
|
|
50
|
+
explorerPathOverrides[resolvedChain?.chainType as ChainType]
|
|
39
51
|
|
|
40
|
-
const defaultTxPath =
|
|
41
|
-
const defaultAddressPath =
|
|
42
|
-
resolvedChain?.id === ChainId.SUI ? 'coin' : 'address'
|
|
52
|
+
const defaultTxPath = overrides?.txPath ?? 'tx'
|
|
53
|
+
const defaultAddressPath = overrides?.addressPath ?? 'address'
|
|
43
54
|
const txPath =
|
|
44
55
|
typeof explorerUrl === 'string'
|
|
45
56
|
? defaultTxPath
|
|
@@ -50,7 +61,7 @@ export const useExplorer = (): {
|
|
|
50
61
|
: explorerUrl.addressPath || defaultAddressPath
|
|
51
62
|
|
|
52
63
|
return {
|
|
53
|
-
url: sanitiseBaseUrl(
|
|
64
|
+
url: sanitiseBaseUrl(baseUrl),
|
|
54
65
|
txPath,
|
|
55
66
|
addressPath,
|
|
56
67
|
resolvedChain,
|
package/src/hooks/useTokens.ts
CHANGED
|
@@ -48,6 +48,7 @@ export const useTokens = (
|
|
|
48
48
|
ChainType.SVM,
|
|
49
49
|
ChainType.UTXO,
|
|
50
50
|
ChainType.MVM,
|
|
51
|
+
ChainType.TVM,
|
|
51
52
|
].filter((chainType) => isItemAllowed(chainType, chainsConfig?.types))
|
|
52
53
|
|
|
53
54
|
const tokensResponse: TokensExtendedResponse = await getTokens(
|
|
@@ -90,6 +91,7 @@ export const useTokens = (
|
|
|
90
91
|
ChainType.SVM,
|
|
91
92
|
ChainType.UTXO,
|
|
92
93
|
ChainType.MVM,
|
|
94
|
+
ChainType.TVM,
|
|
93
95
|
].filter((chainType) => isItemAllowed(chainType, chainsConfig?.types))
|
|
94
96
|
|
|
95
97
|
const tokensResponse: TokensExtendedResponse = await getTokens(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useAccount } from '@lifi/wallet-management'
|
|
2
|
-
import DeleteOutlineIcon from '@mui/icons-material/
|
|
2
|
+
import DeleteOutlineIcon from '@mui/icons-material/DeleteOutlined'
|
|
3
3
|
import { Button } from '@mui/material'
|
|
4
4
|
import { useMemo, useState } from 'react'
|
|
5
5
|
import { useTranslation } from 'react-i18next'
|
|
@@ -49,14 +49,14 @@ export const MainPage: React.FC = () => {
|
|
|
49
49
|
{custom ? (
|
|
50
50
|
<ContractComponent sx={marginSx}>{contractComponent}</ContractComponent>
|
|
51
51
|
) : null}
|
|
52
|
-
<SelectChainAndToken
|
|
52
|
+
<SelectChainAndToken sx={marginSx} />
|
|
53
53
|
{!custom || subvariantOptions?.custom === 'deposit' ? (
|
|
54
54
|
<AmountInput formType="from" sx={marginSx} />
|
|
55
55
|
) : null}
|
|
56
56
|
{!wideVariant ? <Routes sx={marginSx} /> : null}
|
|
57
57
|
<SendToWalletButton sx={marginSx} />
|
|
58
|
-
{showGasRefuelMessage ? <GasRefuelMessage
|
|
59
|
-
<MainWarningMessages
|
|
58
|
+
{showGasRefuelMessage ? <GasRefuelMessage sx={marginSx} /> : null}
|
|
59
|
+
<MainWarningMessages sx={marginSx} />
|
|
60
60
|
<Box
|
|
61
61
|
sx={{
|
|
62
62
|
display: 'flex',
|
|
@@ -69,7 +69,12 @@ export const RoutesPage = (): JSX.Element => {
|
|
|
69
69
|
const allowInteraction = account.isConnected && !toAddressUnsatisfied
|
|
70
70
|
|
|
71
71
|
return (
|
|
72
|
-
<Stack
|
|
72
|
+
<Stack
|
|
73
|
+
className="long-list"
|
|
74
|
+
direction="column"
|
|
75
|
+
spacing={2}
|
|
76
|
+
sx={{ flex: 1 }}
|
|
77
|
+
>
|
|
73
78
|
{routeNotFound ? (
|
|
74
79
|
<RouteNotFoundCard />
|
|
75
80
|
) : isLoading && !routes?.length ? (
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import ContentCopyRounded from '@mui/icons-material/ContentCopyRounded'
|
|
2
|
-
import DeleteOutline from '@mui/icons-material/
|
|
2
|
+
import DeleteOutline from '@mui/icons-material/DeleteOutlined'
|
|
3
3
|
import OpenInNewRounded from '@mui/icons-material/OpenInNewRounded'
|
|
4
4
|
import TurnedIn from '@mui/icons-material/TurnedIn'
|
|
5
5
|
import { Button, ListItemAvatar, ListItemText } from '@mui/material'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import ContentCopyRounded from '@mui/icons-material/ContentCopyRounded'
|
|
2
|
-
import DeleteOutline from '@mui/icons-material/
|
|
2
|
+
import DeleteOutline from '@mui/icons-material/DeleteOutlined'
|
|
3
3
|
import History from '@mui/icons-material/History'
|
|
4
4
|
import OpenInNewRounded from '@mui/icons-material/OpenInNewRounded'
|
|
5
5
|
import TurnedInNot from '@mui/icons-material/TurnedInNot'
|
|
@@ -3,10 +3,10 @@ import type React from 'react'
|
|
|
3
3
|
|
|
4
4
|
export const ResetButtonContainer: React.FC<React.ComponentProps<typeof Box>> =
|
|
5
5
|
styled(Box)(({ theme }) => ({
|
|
6
|
-
background: `
|
|
6
|
+
background: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 4%, transparent)`,
|
|
7
7
|
borderRadius: '16px',
|
|
8
8
|
padding: '16px',
|
|
9
9
|
svg: {
|
|
10
|
-
fill: `
|
|
10
|
+
fill: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 40%, transparent)`,
|
|
11
11
|
},
|
|
12
12
|
}))
|
|
@@ -16,18 +16,18 @@ export const SettingsFieldSet: React.FC<
|
|
|
16
16
|
padding: theme.spacing(0.5),
|
|
17
17
|
gap: theme.spacing(0.5),
|
|
18
18
|
height: '3.5rem',
|
|
19
|
-
backgroundColor: `
|
|
19
|
+
backgroundColor: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 4%, transparent)`,
|
|
20
20
|
...theme.applyStyles('dark', {
|
|
21
|
-
backgroundColor: `
|
|
21
|
+
backgroundColor: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 8%, transparent)`,
|
|
22
22
|
}),
|
|
23
23
|
}))
|
|
24
24
|
|
|
25
25
|
const settingsControlSelected = (theme: Theme) => ({
|
|
26
26
|
backgroundColor: theme.vars.palette.background.paper,
|
|
27
|
-
boxShadow: `0px 2px 4px
|
|
27
|
+
boxShadow: `0px 2px 4px color-mix(in srgb, ${theme.vars.palette.common.onBackground} 4%, transparent)`,
|
|
28
28
|
...theme.applyStyles('dark', {
|
|
29
|
-
backgroundColor: `
|
|
30
|
-
boxShadow: `0px 2px 4px
|
|
29
|
+
backgroundColor: `color-mix(in srgb, ${theme.vars.palette.common.background} 56%, transparent)`,
|
|
30
|
+
boxShadow: `0px 2px 4px color-mix(in srgb, ${theme.vars.palette.common.background} 4%, transparent)`,
|
|
31
31
|
}),
|
|
32
32
|
borderRadius: `calc(${theme.vars.shape.borderRadius} - 4px)`,
|
|
33
33
|
})
|
|
@@ -8,7 +8,7 @@ export const ActionRowContainer: React.FC<React.ComponentProps<typeof Box>> =
|
|
|
8
8
|
gap: theme.spacing(1),
|
|
9
9
|
padding: theme.spacing(1),
|
|
10
10
|
borderRadius: theme.vars.shape.borderRadiusTertiary,
|
|
11
|
-
backgroundColor: `
|
|
11
|
+
backgroundColor: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 4%, transparent)`,
|
|
12
12
|
}))
|
|
13
13
|
|
|
14
14
|
export const ActionIconCircle: React.FC<React.ComponentProps<typeof Box>> =
|
|
@@ -19,7 +19,7 @@ export const ActionIconCircle: React.FC<React.ComponentProps<typeof Box>> =
|
|
|
19
19
|
width: 24,
|
|
20
20
|
height: 24,
|
|
21
21
|
borderRadius: '50%',
|
|
22
|
-
backgroundColor: `color-mix(in srgb,
|
|
22
|
+
backgroundColor: `color-mix(in srgb, ${theme.vars.palette.success.main} 12%, ${theme.vars.palette.background.paper})`,
|
|
23
23
|
}))
|
|
24
24
|
|
|
25
25
|
export const ActionRowLabel: React.FC<React.ComponentProps<typeof Typography>> =
|
|
@@ -20,6 +20,6 @@ export const ExternalLink: React.FC<React.ComponentProps<typeof Link>> = styled(
|
|
|
20
20
|
textDecoration: 'none',
|
|
21
21
|
color: theme.vars.palette.text.primary,
|
|
22
22
|
'&:hover': {
|
|
23
|
-
backgroundColor: `
|
|
23
|
+
backgroundColor: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 4%, transparent)`,
|
|
24
24
|
},
|
|
25
25
|
}))
|
|
@@ -9,14 +9,14 @@ const getStatusColor = (status: StatusColor, theme: Theme) => {
|
|
|
9
9
|
switch (status) {
|
|
10
10
|
case RouteExecutionStatus.Done:
|
|
11
11
|
return {
|
|
12
|
-
color: theme.vars.palette.success.
|
|
12
|
+
color: theme.vars.palette.success.main,
|
|
13
13
|
alpha: 0.12,
|
|
14
14
|
lightDarken: 0,
|
|
15
15
|
darkDarken: 0,
|
|
16
16
|
}
|
|
17
17
|
case RouteExecutionStatus.Failed:
|
|
18
18
|
return {
|
|
19
|
-
color: theme.vars.palette.error.
|
|
19
|
+
color: theme.vars.palette.error.main,
|
|
20
20
|
alpha: 0.12,
|
|
21
21
|
lightDarken: 0,
|
|
22
22
|
darkDarken: 0,
|
|
@@ -25,14 +25,14 @@ const getStatusColor = (status: StatusColor, theme: Theme) => {
|
|
|
25
25
|
case RouteExecutionStatus.Done | RouteExecutionStatus.Refunded:
|
|
26
26
|
case 'warning':
|
|
27
27
|
return {
|
|
28
|
-
color: theme.vars.palette.warning.
|
|
28
|
+
color: theme.vars.palette.warning.main,
|
|
29
29
|
alpha: 0.48,
|
|
30
30
|
lightDarken: 0.32,
|
|
31
31
|
darkDarken: 0,
|
|
32
32
|
}
|
|
33
33
|
default:
|
|
34
34
|
return {
|
|
35
|
-
color: theme.vars.palette.primary.
|
|
35
|
+
color: theme.vars.palette.primary.main,
|
|
36
36
|
alpha: 0.12,
|
|
37
37
|
lightDarken: 0,
|
|
38
38
|
darkDarken: 0,
|
|
@@ -57,7 +57,7 @@ export const IconCircle: React.FC<
|
|
|
57
57
|
const statusConfig = getStatusColor(status, theme)
|
|
58
58
|
|
|
59
59
|
return {
|
|
60
|
-
backgroundColor: `
|
|
60
|
+
backgroundColor: `color-mix(in srgb, ${statusConfig.color} ${statusConfig.alpha * 100}%, transparent)`,
|
|
61
61
|
borderRadius: '50%',
|
|
62
62
|
width: 72,
|
|
63
63
|
height: 72,
|
|
@@ -65,13 +65,13 @@ export const IconCircle: React.FC<
|
|
|
65
65
|
position: 'relative',
|
|
66
66
|
placeItems: 'center',
|
|
67
67
|
'& > svg': {
|
|
68
|
-
color: `color-mix(in srgb,
|
|
68
|
+
color: `color-mix(in srgb, ${statusConfig.color} ${(1 - statusConfig.lightDarken) * 100}%, black)`,
|
|
69
69
|
width: 36,
|
|
70
70
|
height: 36,
|
|
71
71
|
},
|
|
72
72
|
...theme.applyStyles('dark', {
|
|
73
73
|
'& > svg': {
|
|
74
|
-
color: `color-mix(in srgb,
|
|
74
|
+
color: `color-mix(in srgb, ${statusConfig.color} ${(1 - statusConfig.darkDarken) * 100}%, black)`,
|
|
75
75
|
width: 36,
|
|
76
76
|
height: 36,
|
|
77
77
|
},
|
|
@@ -219,7 +219,7 @@ const StatusBottomSheetContent: React.FC<StatusBottomSheetContentProps> = ({
|
|
|
219
219
|
>
|
|
220
220
|
{!showContractComponent ? (
|
|
221
221
|
<CenterContainer>
|
|
222
|
-
<IconCircle status={status}
|
|
222
|
+
<IconCircle status={status} sx={{ mb: 1 }}>
|
|
223
223
|
{status === RouteExecutionStatus.Idle ? (
|
|
224
224
|
<InfoRounded color="primary" />
|
|
225
225
|
) : null}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import type { Route } from '@lifi/sdk'
|
|
2
2
|
import WarningRounded from '@mui/icons-material/WarningRounded'
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
Box,
|
|
5
|
+
Button,
|
|
6
|
+
Checkbox,
|
|
7
|
+
FormControlLabel,
|
|
8
|
+
Typography,
|
|
9
|
+
} from '@mui/material'
|
|
4
10
|
import type { ForwardRefExoticComponent, RefAttributes, RefObject } from 'react'
|
|
5
|
-
import { forwardRef, useRef } from 'react'
|
|
11
|
+
import { forwardRef, useRef, useState } from 'react'
|
|
6
12
|
import { useTranslation } from 'react-i18next'
|
|
7
13
|
import { BottomSheet } from '../../components/BottomSheet/BottomSheet.js'
|
|
8
14
|
import type { BottomSheetBase } from '../../components/BottomSheet/types.js'
|
|
@@ -44,6 +50,7 @@ const TokenValueBottomSheetContent: React.FC<TokenValueBottomSheetProps> = ({
|
|
|
44
50
|
onCancel,
|
|
45
51
|
onContinue,
|
|
46
52
|
}) => {
|
|
53
|
+
const [accepted, setAccepted] = useState(false)
|
|
47
54
|
const { t } = useTranslation()
|
|
48
55
|
const ref = useRef<HTMLElement>(null)
|
|
49
56
|
useSetContentHeight(ref)
|
|
@@ -59,7 +66,7 @@ const TokenValueBottomSheetContent: React.FC<TokenValueBottomSheetProps> = ({
|
|
|
59
66
|
}}
|
|
60
67
|
>
|
|
61
68
|
<CenterContainer>
|
|
62
|
-
<IconCircle status="warning"
|
|
69
|
+
<IconCircle status="warning" sx={{ mb: 1 }}>
|
|
63
70
|
<WarningRounded color="warning" />
|
|
64
71
|
</IconCircle>
|
|
65
72
|
<Typography
|
|
@@ -173,10 +180,20 @@ const TokenValueBottomSheetContent: React.FC<TokenValueBottomSheetProps> = ({
|
|
|
173
180
|
%
|
|
174
181
|
</Typography>
|
|
175
182
|
</Box>
|
|
183
|
+
<FormControlLabel
|
|
184
|
+
control={
|
|
185
|
+
<Checkbox
|
|
186
|
+
checked={accepted}
|
|
187
|
+
onChange={(_, checked) => setAccepted(checked)}
|
|
188
|
+
/>
|
|
189
|
+
}
|
|
190
|
+
label={t('warning.checkbox.highValueLoss')}
|
|
191
|
+
sx={{ mt: 1 }}
|
|
192
|
+
/>
|
|
176
193
|
<Box
|
|
177
194
|
sx={{
|
|
178
195
|
display: 'flex',
|
|
179
|
-
mt:
|
|
196
|
+
mt: 1,
|
|
180
197
|
}}
|
|
181
198
|
>
|
|
182
199
|
<Button variant="text" onClick={onCancel} fullWidth>
|
|
@@ -188,7 +205,12 @@ const TokenValueBottomSheetContent: React.FC<TokenValueBottomSheetProps> = ({
|
|
|
188
205
|
p: 1,
|
|
189
206
|
}}
|
|
190
207
|
/>
|
|
191
|
-
<Button
|
|
208
|
+
<Button
|
|
209
|
+
variant="contained"
|
|
210
|
+
onClick={onContinue}
|
|
211
|
+
disabled={!accepted}
|
|
212
|
+
fullWidth
|
|
213
|
+
>
|
|
192
214
|
{t('button.continue')}
|
|
193
215
|
</Button>
|
|
194
216
|
</Box>
|
|
@@ -2,7 +2,7 @@ import type { ExchangeRateUpdateParams } from '@lifi/sdk'
|
|
|
2
2
|
import Delete from '@mui/icons-material/Delete'
|
|
3
3
|
import { Box, Button, Tooltip } from '@mui/material'
|
|
4
4
|
import { useLocation, useNavigate } from '@tanstack/react-router'
|
|
5
|
-
import { type JSX,
|
|
5
|
+
import { type JSX, useMemo, useRef, useState } from 'react'
|
|
6
6
|
import { useTranslation } from 'react-i18next'
|
|
7
7
|
import type { BottomSheetBase } from '../../components/BottomSheet/types.js'
|
|
8
8
|
import { ContractComponent } from '../../components/ContractComponent/ContractComponent.js'
|
|
@@ -106,13 +106,6 @@ export const TransactionPage = (): JSX.Element | null => {
|
|
|
106
106
|
|
|
107
107
|
useHeader(getHeaderTitle(), headerAction)
|
|
108
108
|
|
|
109
|
-
// biome-ignore lint/correctness/useExhaustiveDependencies: We want to emit event only when the page is mounted
|
|
110
|
-
useEffect(() => {
|
|
111
|
-
if (status === RouteExecutionStatus.Idle) {
|
|
112
|
-
emitter.emit(WidgetEvent.ReviewTransactionPageEntered, route)
|
|
113
|
-
}
|
|
114
|
-
}, [])
|
|
115
|
-
|
|
116
109
|
if (!route) {
|
|
117
110
|
return null
|
|
118
111
|
}
|
|
@@ -221,7 +214,7 @@ export const TransactionPage = (): JSX.Element | null => {
|
|
|
221
214
|
{status === RouteExecutionStatus.Idle ||
|
|
222
215
|
status === RouteExecutionStatus.Failed ? (
|
|
223
216
|
<>
|
|
224
|
-
<WarningMessages
|
|
217
|
+
<WarningMessages sx={{ mt: 2 }} route={route} allowInteraction />
|
|
225
218
|
<Box
|
|
226
219
|
sx={{
|
|
227
220
|
mt: 2,
|