@lifi/widget 3.0.0-alpha.31 → 3.0.0-alpha.32
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/AppDefault.tsx +0 -2
- package/AppDrawer.style.tsx +1 -97
- package/AppDrawer.tsx +7 -40
- package/_esm/AppDefault.js +1 -2
- package/_esm/AppDefault.js.map +1 -1
- package/_esm/AppDrawer.d.ts +1 -5
- package/_esm/AppDrawer.js +13 -25
- package/_esm/AppDrawer.js.map +1 -1
- package/_esm/AppDrawer.style.d.ts +0 -12
- package/_esm/AppDrawer.style.js +1 -76
- package/_esm/AppDrawer.style.js.map +1 -1
- package/_esm/components/ActiveTransactions/ActiveTransactions.style.d.ts +1 -1
- package/_esm/components/ActiveTransactions/ActiveTransactions.style.js +1 -1
- package/_esm/components/ActiveTransactions/ActiveTransactions.style.js.map +1 -1
- package/_esm/components/AmountInput/PriceFormHelperText.js +2 -2
- package/_esm/components/AmountInput/PriceFormHelperText.js.map +1 -1
- package/_esm/components/AppContainer.d.ts +1 -1
- package/_esm/components/AppContainer.js +3 -3
- package/_esm/components/AppContainer.js.map +1 -1
- package/_esm/components/Avatar/AccountAvatar.js +3 -3
- package/_esm/components/Avatar/AccountAvatar.js.map +1 -1
- package/_esm/components/Avatar/Avatar.js +3 -3
- package/_esm/components/Avatar/Avatar.js.map +1 -1
- package/_esm/components/Avatar/Avatar.style.d.ts +6 -0
- package/_esm/components/Avatar/Avatar.style.js +11 -5
- package/_esm/components/Avatar/Avatar.style.js.map +1 -1
- package/_esm/components/Avatar/TokenAvatar.js +3 -3
- package/_esm/components/Avatar/TokenAvatar.js.map +1 -1
- package/_esm/components/Avatar/utils.d.ts +8 -0
- package/_esm/components/Avatar/utils.js +9 -0
- package/_esm/components/Avatar/utils.js.map +1 -0
- package/_esm/components/ButtonTertiary.d.ts +4 -0
- package/_esm/components/ButtonTertiary.js +19 -0
- package/_esm/components/ButtonTertiary.js.map +1 -0
- package/_esm/components/Card/Card.js +6 -7
- package/_esm/components/Card/Card.js.map +1 -1
- package/_esm/components/Card/CardHeader.js +3 -1
- package/_esm/components/Card/CardHeader.js.map +1 -1
- package/_esm/components/Card/CardIconButton.js +4 -6
- package/_esm/components/Card/CardIconButton.js.map +1 -1
- package/_esm/components/Card/CardLabel.js +0 -4
- package/_esm/components/Card/CardLabel.js.map +1 -1
- package/_esm/components/Card/CardTitle.js +1 -0
- package/_esm/components/Card/CardTitle.js.map +1 -1
- package/_esm/components/ChainSelect/useChainSelect.js +1 -2
- package/_esm/components/ChainSelect/useChainSelect.js.map +1 -1
- package/_esm/components/Header/Header.style.d.ts +4 -1
- package/_esm/components/Header/Header.style.js +12 -12
- package/_esm/components/Header/Header.style.js.map +1 -1
- package/_esm/components/Header/SettingsButton.style.d.ts +1 -1
- package/_esm/components/Header/WalletHeader.js +2 -3
- package/_esm/components/Header/WalletHeader.js.map +1 -1
- package/_esm/components/Header/WalletMenu.js +6 -4
- package/_esm/components/Header/WalletMenu.js.map +1 -1
- package/_esm/components/Input.js +1 -3
- package/_esm/components/Input.js.map +1 -1
- package/_esm/components/ListItem/ListItem.d.ts +1 -1
- package/_esm/components/ListItemButton.js +12 -9
- package/_esm/components/ListItemButton.js.map +1 -1
- package/_esm/components/ListItemText.js +1 -1
- package/_esm/components/NFT/NFT.style.d.ts +1 -1
- package/_esm/components/PageContainer.js +4 -1
- package/_esm/components/PageContainer.js.map +1 -1
- package/_esm/components/PoweredBy/PoweredBy.js +2 -13
- package/_esm/components/PoweredBy/PoweredBy.js.map +1 -1
- package/_esm/components/PoweredBy/PoweredBy.style.d.ts +1 -1
- package/_esm/components/RouteCard/RouteCard.js +3 -7
- package/_esm/components/RouteCard/RouteCard.js.map +1 -1
- package/_esm/components/RouteCard/RouteCard.style.js +2 -2
- package/_esm/components/RouteCard/RouteCard.style.js.map +1 -1
- package/_esm/components/Routes/Routes.js +3 -2
- package/_esm/components/Routes/Routes.js.map +1 -1
- package/_esm/components/SelectTokenButton/SelectTokenButton.js +1 -1
- package/_esm/components/SelectTokenButton/SelectTokenButton.js.map +1 -1
- package/_esm/components/SelectTokenButton/SelectTokenButton.style.js +7 -6
- package/_esm/components/SelectTokenButton/SelectTokenButton.style.js.map +1 -1
- package/_esm/components/SendToWallet/SendToWallet.style.js +14 -9
- package/_esm/components/SendToWallet/SendToWallet.style.js.map +1 -1
- package/_esm/components/SendToWallet/SendToWalletButton.d.ts +3 -1
- package/_esm/components/SendToWallet/SendToWalletButton.js +18 -9
- package/_esm/components/SendToWallet/SendToWalletButton.js.map +1 -1
- package/_esm/components/SendToWallet/SendToWalletExpandButton.js +2 -1
- package/_esm/components/SendToWallet/SendToWalletExpandButton.js.map +1 -1
- package/_esm/components/SmallAvatar.d.ts +1 -1
- package/_esm/components/SmallAvatar.js +4 -6
- package/_esm/components/SmallAvatar.js.map +1 -1
- package/_esm/components/Step/StepProcess.style.d.ts +1 -1
- package/_esm/components/Step/StepProcess.style.js +3 -2
- package/_esm/components/Step/StepProcess.style.js.map +1 -1
- package/_esm/components/StepActions/StepActions.js +1 -3
- package/_esm/components/StepActions/StepActions.js.map +1 -1
- package/_esm/components/StepActions/StepActions.style.d.ts +4 -2
- package/_esm/components/StepActions/StepActions.style.js +12 -15
- package/_esm/components/StepActions/StepActions.style.js.map +1 -1
- package/_esm/components/StepActions/StepFeeBreakdown.js +2 -1
- package/_esm/components/StepActions/StepFeeBreakdown.js.map +1 -1
- package/_esm/components/Tabs/Tabs.style.d.ts +1 -1
- package/_esm/components/Tabs/Tabs.style.js +10 -14
- package/_esm/components/Tabs/Tabs.style.js.map +1 -1
- package/_esm/components/Token/Token.js +2 -6
- package/_esm/components/Token/Token.js.map +1 -1
- package/_esm/components/TokenList/TokenList.js +1 -1
- package/_esm/components/TokenList/TokenList.js.map +1 -1
- package/_esm/components/TokenList/TokenList.style.d.ts +2 -2
- package/_esm/components/TokenList/TokenList.style.js +3 -4
- package/_esm/components/TokenList/TokenList.style.js.map +1 -1
- package/_esm/components/TokenList/TokenListItem.js +1 -1
- package/_esm/components/TokenList/TokenListItem.js.map +1 -1
- package/_esm/components/TokenList/useTokenSelect.js +1 -3
- package/_esm/components/TokenList/useTokenSelect.js.map +1 -1
- package/_esm/config/theme.js +25 -13
- package/_esm/config/theme.js.map +1 -1
- package/_esm/config/version.d.ts +1 -1
- package/_esm/config/version.js +1 -1
- package/_esm/hooks/useRoutes.d.ts +1 -1
- package/_esm/hooks/useToAddressReset.js +1 -1
- package/_esm/hooks/useToAddressReset.js.map +1 -1
- package/_esm/hooks/useTokenAddressBalance.d.ts +1 -1
- package/_esm/hooks/useTokenBalance.d.ts +1 -1
- package/_esm/hooks/useTokenBalances.d.ts +1 -1
- package/_esm/i18n/en.json +4 -10
- package/_esm/pages/ActiveTransactionsPage/ActiveTransactionsPage.js +1 -0
- package/_esm/pages/ActiveTransactionsPage/ActiveTransactionsPage.js.map +1 -1
- package/_esm/pages/LanguagesPage.js +1 -0
- package/_esm/pages/LanguagesPage.js.map +1 -1
- package/_esm/pages/MainPage/MainPage.js +5 -2
- package/_esm/pages/MainPage/MainPage.js.map +1 -1
- package/_esm/pages/RoutesPage/RoutesPage.style.js +1 -1
- package/_esm/pages/RoutesPage/RoutesPage.style.js.map +1 -1
- package/_esm/pages/SelectChainPage/SelectChainPage.js +1 -0
- package/_esm/pages/SelectChainPage/SelectChainPage.js.map +1 -1
- package/_esm/pages/SelectEnabledToolsPage.js +1 -0
- package/_esm/pages/SelectEnabledToolsPage.js.map +1 -1
- package/_esm/pages/SelectNativeTokenPage.js +1 -0
- package/_esm/pages/SelectNativeTokenPage.js.map +1 -1
- package/_esm/pages/SelectWalletPage/SelectWalletPage.js +1 -0
- package/_esm/pages/SelectWalletPage/SelectWalletPage.js.map +1 -1
- package/_esm/pages/SendToWallet/EmptyListIndicator.js +3 -2
- package/_esm/pages/SendToWallet/EmptyListIndicator.js.map +1 -1
- package/_esm/pages/SendToWallet/SendToWalletPage.js +4 -3
- package/_esm/pages/SendToWallet/SendToWalletPage.js.map +1 -1
- package/_esm/pages/SendToWallet/SendToWalletPage.style.d.ts +24 -34
- package/_esm/pages/SendToWallet/SendToWalletPage.style.js +6 -43
- package/_esm/pages/SendToWallet/SendToWalletPage.style.js.map +1 -1
- package/_esm/pages/SettingsPage/ResetSettingsButton.js +1 -1
- package/_esm/pages/SettingsPage/ResetSettingsButton.style.js +2 -2
- package/_esm/pages/SettingsPage/ResetSettingsButton.style.js.map +1 -1
- package/_esm/pages/SettingsPage/RoutePrioritySettings.js +3 -3
- package/_esm/pages/SettingsPage/RoutePrioritySettings.js.map +1 -1
- package/_esm/pages/SettingsPage/SettingsCard/SettingCard.style.d.ts +1 -4
- package/_esm/pages/SettingsPage/SettingsCard/SettingCard.style.js +0 -8
- package/_esm/pages/SettingsPage/SettingsCard/SettingCard.style.js.map +1 -1
- package/_esm/pages/SettingsPage/SettingsPage.js +1 -1
- package/_esm/pages/SettingsPage/SettingsPage.js.map +1 -1
- package/_esm/pages/SettingsPage/SlippageSettings/SlippageSettings.style.js +1 -3
- package/_esm/pages/SettingsPage/SlippageSettings/SlippageSettings.style.js.map +1 -1
- package/_esm/pages/TransactionDetailsPage/TransactionDetailsPage.js +1 -1
- package/_esm/pages/TransactionDetailsPage/TransactionDetailsPage.js.map +1 -1
- package/_esm/stores/bookmarks/createBookmarkStore.js +1 -1
- package/_esm/stores/bookmarks/createBookmarkStore.js.map +1 -1
- package/_esm/stores/form/useFieldController.js +2 -2
- package/_esm/stores/form/useFieldController.js.map +1 -1
- package/_esm/stores/settings/useSettingsStore.js +5 -2
- package/_esm/stores/settings/useSettingsStore.js.map +1 -1
- package/_esm/types/widget.d.ts +0 -1
- package/_esm/types/widget.js +0 -1
- package/_esm/types/widget.js.map +1 -1
- package/_esm/utils/colors.d.ts +2 -2
- package/_esm/utils/colors.js +6 -4
- package/_esm/utils/colors.js.map +1 -1
- package/components/ActiveTransactions/ActiveTransactions.style.ts +1 -1
- package/components/AmountInput/PriceFormHelperText.tsx +3 -3
- package/components/AppContainer.tsx +3 -3
- package/components/Avatar/AccountAvatar.tsx +8 -4
- package/components/Avatar/Avatar.style.tsx +14 -4
- package/components/Avatar/Avatar.tsx +7 -3
- package/components/Avatar/TokenAvatar.tsx +4 -4
- package/components/Avatar/utils.ts +11 -0
- package/components/ButtonTertiary.tsx +19 -0
- package/components/Card/Card.tsx +12 -17
- package/components/Card/CardHeader.tsx +3 -1
- package/components/Card/CardIconButton.tsx +4 -7
- package/components/Card/CardLabel.tsx +0 -4
- package/components/Card/CardTitle.tsx +1 -0
- package/components/ChainSelect/useChainSelect.ts +1 -2
- package/components/Header/Header.style.ts +13 -14
- package/components/Header/WalletHeader.tsx +15 -13
- package/components/Header/WalletMenu.tsx +20 -13
- package/components/Input.tsx +1 -4
- package/components/ListItemButton.tsx +10 -7
- package/components/ListItemText.tsx +1 -1
- package/components/PageContainer.ts +9 -1
- package/components/PoweredBy/PoweredBy.tsx +21 -36
- package/components/RouteCard/RouteCard.style.ts +2 -2
- package/components/RouteCard/RouteCard.tsx +10 -27
- package/components/Routes/Routes.tsx +4 -3
- package/components/SelectTokenButton/SelectTokenButton.style.tsx +7 -6
- package/components/SelectTokenButton/SelectTokenButton.tsx +1 -1
- package/components/SendToWallet/SendToWallet.style.tsx +14 -9
- package/components/SendToWallet/SendToWalletButton.tsx +38 -19
- package/components/SendToWallet/SendToWalletExpandButton.tsx +2 -1
- package/components/SmallAvatar.tsx +4 -6
- package/components/Step/StepProcess.style.tsx +3 -2
- package/components/StepActions/StepActions.style.tsx +14 -19
- package/components/StepActions/StepActions.tsx +1 -3
- package/components/StepActions/StepFeeBreakdown.tsx +3 -2
- package/components/Tabs/Tabs.style.tsx +10 -19
- package/components/Token/Token.tsx +1 -5
- package/components/TokenList/TokenList.style.tsx +3 -5
- package/components/TokenList/TokenList.tsx +2 -1
- package/components/TokenList/TokenListItem.tsx +1 -1
- package/components/TokenList/useTokenSelect.ts +1 -3
- package/config/theme.ts +29 -15
- package/config/version.ts +1 -1
- package/hooks/useToAddressReset.ts +1 -1
- package/i18n/en.json +4 -10
- package/package.json +9 -9
- package/pages/ActiveTransactionsPage/ActiveTransactionsPage.tsx +1 -0
- package/pages/LanguagesPage.tsx +1 -0
- package/pages/MainPage/MainPage.tsx +8 -3
- package/pages/RoutesPage/RoutesPage.style.ts +1 -1
- package/pages/SelectChainPage/SelectChainPage.tsx +1 -0
- package/pages/SelectEnabledToolsPage.tsx +1 -0
- package/pages/SelectNativeTokenPage.tsx +1 -0
- package/pages/SelectWalletPage/SelectWalletPage.tsx +1 -0
- package/pages/SendToWallet/EmptyListIndicator.tsx +5 -6
- package/pages/SendToWallet/SendToWalletPage.style.tsx +6 -53
- package/pages/SendToWallet/SendToWalletPage.tsx +11 -8
- package/pages/SettingsPage/ResetSettingsButton.style.tsx +2 -2
- package/pages/SettingsPage/ResetSettingsButton.tsx +1 -1
- package/pages/SettingsPage/RoutePrioritySettings.tsx +7 -7
- package/pages/SettingsPage/SettingsCard/SettingCard.style.tsx +0 -9
- package/pages/SettingsPage/SettingsPage.tsx +1 -1
- package/pages/SettingsPage/SlippageSettings/SlippageSettings.style.tsx +1 -4
- package/pages/TransactionDetailsPage/TransactionDetailsPage.tsx +1 -1
- package/stores/bookmarks/createBookmarkStore.ts +2 -1
- package/stores/form/useFieldController.ts +2 -2
- package/stores/settings/useSettingsStore.ts +5 -2
- package/types/widget.ts +0 -1
- package/utils/colors.ts +8 -9
|
@@ -4,19 +4,23 @@ import { AmountInput } from '../../components/AmountInput/AmountInput.js';
|
|
|
4
4
|
import { ContractComponent } from '../../components/ContractComponent/ContractComponent.js';
|
|
5
5
|
import { GasRefuelMessage } from '../../components/GasMessage/GasRefuelMessage.js';
|
|
6
6
|
import { PageContainer } from '../../components/PageContainer.js';
|
|
7
|
+
import { PoweredBy } from '../../components/PoweredBy/PoweredBy.js';
|
|
7
8
|
import { Routes } from '../../components/Routes/Routes.js';
|
|
8
9
|
import { SelectChainAndToken } from '../../components/SelectChainAndToken.js';
|
|
9
10
|
import { SendToWalletButton } from '../../components/SendToWallet/SendToWalletButton.js';
|
|
10
11
|
import { SendToWalletExpandButton } from '../../components/SendToWallet/SendToWalletExpandButton.js';
|
|
11
12
|
import { useExpandableVariant } from '../../hooks/useExpandableVariant.js';
|
|
12
13
|
import { useWidgetConfig } from '../../providers/WidgetProvider/WidgetProvider.js';
|
|
14
|
+
import { HiddenUI } from '../../types/widget.js';
|
|
13
15
|
import { MainGasMessage } from './MainGasMessage.js';
|
|
14
16
|
import { ReviewButton } from './ReviewButton.js';
|
|
15
17
|
|
|
16
18
|
export const MainPage: React.FC = () => {
|
|
17
19
|
const expandable = useExpandableVariant();
|
|
18
|
-
const { subvariant, contractComponent } = useWidgetConfig();
|
|
20
|
+
const { subvariant, contractComponent, hiddenUI } = useWidgetConfig();
|
|
19
21
|
const nft = subvariant === 'nft';
|
|
22
|
+
const showPoweredBy = !hiddenUI?.includes(HiddenUI.PoweredBy);
|
|
23
|
+
|
|
20
24
|
return (
|
|
21
25
|
<PageContainer>
|
|
22
26
|
<ActiveTransactions mt={1} mb={2} />
|
|
@@ -28,13 +32,14 @@ export const MainPage: React.FC = () => {
|
|
|
28
32
|
<SelectChainAndToken mt={1} mb={2} />
|
|
29
33
|
{!nft ? <AmountInput formType="from" mb={2} /> : null}
|
|
30
34
|
{!expandable ? <Routes mb={2} /> : null}
|
|
31
|
-
<SendToWalletButton />
|
|
35
|
+
<SendToWalletButton mb={2} />
|
|
32
36
|
<GasRefuelMessage mb={2} />
|
|
33
37
|
<MainGasMessage mb={2} />
|
|
34
|
-
<Box display="flex" mb={1}>
|
|
38
|
+
<Box display="flex" mb={showPoweredBy ? 1 : 3} gap={1.5}>
|
|
35
39
|
<ReviewButton />
|
|
36
40
|
<SendToWalletExpandButton />
|
|
37
41
|
</Box>
|
|
42
|
+
{showPoweredBy ? <PoweredBy /> : null}
|
|
38
43
|
</PageContainer>
|
|
39
44
|
);
|
|
40
45
|
};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
+
import { Typography } from '@mui/material';
|
|
1
2
|
import type { PropsWithChildren, ReactNode } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
EmptyContainer,
|
|
4
|
-
EmptyListMessage,
|
|
5
|
-
IconContainer,
|
|
6
|
-
} from './SendToWalletPage.style.js';
|
|
3
|
+
import { EmptyContainer, IconContainer } from './SendToWalletPage.style.js';
|
|
7
4
|
|
|
8
5
|
interface EmptyListIndicatorProps extends PropsWithChildren {
|
|
9
6
|
icon: ReactNode;
|
|
@@ -14,6 +11,8 @@ export const EmptyListIndicator = ({
|
|
|
14
11
|
}: EmptyListIndicatorProps) => (
|
|
15
12
|
<EmptyContainer>
|
|
16
13
|
<IconContainer>{icon}</IconContainer>
|
|
17
|
-
<
|
|
14
|
+
<Typography fontSize={14} fontWeight={700} color="text.secondary">
|
|
15
|
+
{children}
|
|
16
|
+
</Typography>
|
|
18
17
|
</EmptyContainer>
|
|
19
18
|
);
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { LoadingButton, loadingButtonClasses } from '@mui/lab';
|
|
2
|
-
import type { Theme } from '@mui/material';
|
|
3
1
|
import {
|
|
4
2
|
Alert,
|
|
5
3
|
Box,
|
|
@@ -10,6 +8,7 @@ import {
|
|
|
10
8
|
inputBaseClasses,
|
|
11
9
|
styled,
|
|
12
10
|
} from '@mui/material';
|
|
11
|
+
import { ButtonTertiary } from '../../components/ButtonTertiary.js';
|
|
13
12
|
import { Card } from '../../components/Card/Card.js';
|
|
14
13
|
import { Input } from '../../components/Input.js';
|
|
15
14
|
import type { PageContainerProps } from '../../components/PageContainer.js';
|
|
@@ -39,10 +38,10 @@ export const SendToWalletPageContainer = styled(
|
|
|
39
38
|
gap: theme.spacing(1),
|
|
40
39
|
}));
|
|
41
40
|
|
|
42
|
-
export const SendToWalletCard = styled(Card)(
|
|
41
|
+
export const SendToWalletCard = styled(Card)({
|
|
43
42
|
display: 'flex',
|
|
44
43
|
flexDirection: 'column',
|
|
45
|
-
})
|
|
44
|
+
});
|
|
46
45
|
|
|
47
46
|
export const SendToWalletSheetContainer = styled(Box)(({ theme }) => ({
|
|
48
47
|
display: 'flex',
|
|
@@ -58,48 +57,11 @@ export const SendToWalletButtonRow = styled(Box)(({ theme }) => ({
|
|
|
58
57
|
gap: theme.spacing(1),
|
|
59
58
|
}));
|
|
60
59
|
|
|
61
|
-
const
|
|
62
|
-
color: theme.palette.text.primary,
|
|
63
|
-
height: 40,
|
|
64
|
-
fontSize: 14,
|
|
65
|
-
backgroundColor:
|
|
66
|
-
theme.palette.mode === 'light'
|
|
67
|
-
? theme.palette.grey[200]
|
|
68
|
-
: theme.palette.grey[800],
|
|
69
|
-
'&:hover, &:active': {
|
|
70
|
-
backgroundColor:
|
|
71
|
-
theme.palette.mode === 'light'
|
|
72
|
-
? theme.palette.grey[300]
|
|
73
|
-
: theme.palette.grey[700],
|
|
74
|
-
},
|
|
75
|
-
[`&.${loadingButtonClasses.loading}:disabled`]: {
|
|
76
|
-
backgroundColor:
|
|
77
|
-
theme.palette.mode === 'light'
|
|
78
|
-
? theme.palette.grey[200]
|
|
79
|
-
: theme.palette.grey[800],
|
|
80
|
-
},
|
|
81
|
-
[`.${loadingButtonClasses.loadingIndicator}`]: {
|
|
82
|
-
color: theme.palette.text.primary,
|
|
83
|
-
},
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
export const SendToWalletButton = styled(LoadingButton)(({ theme }) => ({
|
|
87
|
-
...tertiaryButtonStyles(theme),
|
|
88
|
-
}));
|
|
89
|
-
|
|
90
|
-
export const SendToWalletIconButton = styled(LoadingButton)(({ theme }) => ({
|
|
91
|
-
...tertiaryButtonStyles(theme),
|
|
60
|
+
export const SendToWalletIconButton = styled(ButtonTertiary)(({ theme }) => ({
|
|
92
61
|
padding: theme.spacing(1.25),
|
|
93
62
|
minWidth: 40,
|
|
94
63
|
}));
|
|
95
64
|
|
|
96
|
-
export const WalletNumber = styled(Typography)(({ theme }) => ({
|
|
97
|
-
color:
|
|
98
|
-
theme.palette.mode === 'light'
|
|
99
|
-
? theme.palette.grey[600]
|
|
100
|
-
: theme.palette.grey[400],
|
|
101
|
-
}));
|
|
102
|
-
|
|
103
65
|
export const IconContainer = styled(Box)(({ theme }) => ({
|
|
104
66
|
display: 'flex',
|
|
105
67
|
justifyContent: 'center',
|
|
@@ -131,7 +93,7 @@ export const ListContainer = styled(List)(({ theme }) => ({
|
|
|
131
93
|
display: 'flex',
|
|
132
94
|
flexDirection: 'column',
|
|
133
95
|
minHeight: 400,
|
|
134
|
-
paddingBottom: theme.spacing(
|
|
96
|
+
paddingBottom: theme.spacing(1.5),
|
|
135
97
|
}));
|
|
136
98
|
|
|
137
99
|
export const BookmarkButtonContainer = styled(Box)(({ theme }) => ({
|
|
@@ -155,15 +117,6 @@ export const EmptyContainer = styled(Box)(({ theme }) => ({
|
|
|
155
117
|
gap: theme.spacing(2),
|
|
156
118
|
}));
|
|
157
119
|
|
|
158
|
-
export const EmptyListMessage = styled(Typography)(({ theme }) => ({
|
|
159
|
-
fontSize: 14,
|
|
160
|
-
fontWeight: 700,
|
|
161
|
-
color:
|
|
162
|
-
theme.palette.mode === 'light'
|
|
163
|
-
? theme.palette.grey[600]
|
|
164
|
-
: theme.palette.grey[400],
|
|
165
|
-
}));
|
|
166
|
-
|
|
167
120
|
export const ValidationAlert = styled(Alert)(({ theme }) => ({
|
|
168
121
|
backgroundColor: 'transparent',
|
|
169
122
|
padding: 0,
|
|
@@ -180,6 +133,6 @@ export const OptionsMenuButton = styled(IconButton)(({ theme }) => ({
|
|
|
180
133
|
top: theme.spacing(1.75),
|
|
181
134
|
right: theme.spacing(2),
|
|
182
135
|
'&:hover': {
|
|
183
|
-
backgroundColor: getContrastAlphaColor(theme
|
|
136
|
+
backgroundColor: getContrastAlphaColor(theme, 0.04),
|
|
184
137
|
},
|
|
185
138
|
}));
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Error, History, TurnedIn, Wallet } from '@mui/icons-material';
|
|
2
|
-
import { Tooltip } from '@mui/material';
|
|
2
|
+
import { Tooltip, Typography } from '@mui/material';
|
|
3
3
|
import type { ChangeEvent } from 'react';
|
|
4
4
|
import { useRef, useState } from 'react';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
6
|
import { useNavigate } from 'react-router-dom';
|
|
7
7
|
import type { BottomSheetBase } from '../../components/BottomSheet/types.js';
|
|
8
|
+
import { ButtonTertiary } from '../../components/ButtonTertiary.js';
|
|
8
9
|
import { CardButton } from '../../components/Card/CardButton.js';
|
|
9
10
|
import { useAccount } from '../../hooks/useAccount.js';
|
|
10
11
|
import {
|
|
@@ -23,13 +24,11 @@ import { BookmarkAddressSheet } from './BookmarkAddressSheet.js';
|
|
|
23
24
|
import { ConfirmAddressSheet } from './ConfirmAddressSheet.js';
|
|
24
25
|
import {
|
|
25
26
|
AddressInput,
|
|
26
|
-
SendToWalletButton,
|
|
27
27
|
SendToWalletButtonRow,
|
|
28
28
|
SendToWalletCard,
|
|
29
29
|
SendToWalletIconButton,
|
|
30
30
|
SendToWalletPageContainer,
|
|
31
31
|
ValidationAlert,
|
|
32
|
-
WalletNumber,
|
|
33
32
|
} from './SendToWalletPage.style.js';
|
|
34
33
|
|
|
35
34
|
export const SendToWalletPage = () => {
|
|
@@ -201,7 +200,7 @@ export const SendToWalletPage = () => {
|
|
|
201
200
|
</ValidationAlert>
|
|
202
201
|
) : null}
|
|
203
202
|
<SendToWalletButtonRow sx={{ paddingX: 2, paddingBottom: 2 }}>
|
|
204
|
-
<
|
|
203
|
+
<ButtonTertiary
|
|
205
204
|
variant="text"
|
|
206
205
|
onClick={handleDone}
|
|
207
206
|
loading={isDoneButtonLoading}
|
|
@@ -209,7 +208,7 @@ export const SendToWalletPage = () => {
|
|
|
209
208
|
sx={{ flexGrow: 1 }}
|
|
210
209
|
>
|
|
211
210
|
{t('button.done')}
|
|
212
|
-
</
|
|
211
|
+
</ButtonTertiary>
|
|
213
212
|
<Tooltip title={t('button.bookmark')} arrow>
|
|
214
213
|
<SendToWalletIconButton
|
|
215
214
|
onClick={handleBookmarkAddress}
|
|
@@ -237,7 +236,7 @@ export const SendToWalletPage = () => {
|
|
|
237
236
|
onClick={handleRecentWalletsClick}
|
|
238
237
|
>
|
|
239
238
|
{!!recentWallets.length && (
|
|
240
|
-
<
|
|
239
|
+
<Typography color="text.secondary">{recentWallets.length}</Typography>
|
|
241
240
|
)}
|
|
242
241
|
</CardButton>
|
|
243
242
|
<CardButton
|
|
@@ -246,7 +245,9 @@ export const SendToWalletPage = () => {
|
|
|
246
245
|
onClick={handleConnectedWalletsClick}
|
|
247
246
|
>
|
|
248
247
|
{!!connectedWallets.length && (
|
|
249
|
-
<
|
|
248
|
+
<Typography color="text.secondary">
|
|
249
|
+
{connectedWallets.length}
|
|
250
|
+
</Typography>
|
|
250
251
|
)}
|
|
251
252
|
</CardButton>
|
|
252
253
|
<CardButton
|
|
@@ -254,7 +255,9 @@ export const SendToWalletPage = () => {
|
|
|
254
255
|
icon={<TurnedIn />}
|
|
255
256
|
onClick={handleBookmarkedWalletsClick}
|
|
256
257
|
>
|
|
257
|
-
{!!bookmarks.length &&
|
|
258
|
+
{!!bookmarks.length && (
|
|
259
|
+
<Typography color="text.secondary">{bookmarks.length}</Typography>
|
|
260
|
+
)}
|
|
258
261
|
</CardButton>
|
|
259
262
|
</SendToWalletPageContainer>
|
|
260
263
|
);
|
|
@@ -2,11 +2,11 @@ import { Box, styled } from '@mui/material';
|
|
|
2
2
|
import { getContrastAlphaColor } from '../../utils/colors.js';
|
|
3
3
|
|
|
4
4
|
export const ResetButtonContainer = styled(Box)(({ theme }) => ({
|
|
5
|
-
background: getContrastAlphaColor(theme
|
|
5
|
+
background: getContrastAlphaColor(theme, 0.04),
|
|
6
6
|
borderRadius: '16px',
|
|
7
7
|
padding: '16px',
|
|
8
8
|
|
|
9
9
|
[`svg`]: {
|
|
10
|
-
fill: getContrastAlphaColor(theme
|
|
10
|
+
fill: getContrastAlphaColor(theme, 0.4),
|
|
11
11
|
},
|
|
12
12
|
}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Order } from '@lifi/sdk';
|
|
2
2
|
import { Route } from '@mui/icons-material';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { Tab, Tabs } from '../../components/Tabs/Tabs.style.js';
|
|
@@ -8,7 +8,7 @@ import { useSettingsStore } from '../../stores/settings/useSettingsStore.js';
|
|
|
8
8
|
import { BadgedValue } from './SettingsCard/BadgedValue.js';
|
|
9
9
|
import { SettingCardExpandable } from './SettingsCard/SettingCardExpandable.js';
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
const Priorities: Order[] = ['CHEAPEST', 'FASTEST'];
|
|
12
12
|
|
|
13
13
|
export const RoutePrioritySettings: React.FC = () => {
|
|
14
14
|
const { t } = useTranslation();
|
|
@@ -19,7 +19,7 @@ export const RoutePrioritySettings: React.FC = () => {
|
|
|
19
19
|
|
|
20
20
|
const handleRoutePriorityChange = (
|
|
21
21
|
_: React.SyntheticEvent,
|
|
22
|
-
routePriority:
|
|
22
|
+
routePriority: Order,
|
|
23
23
|
) => {
|
|
24
24
|
setValue('routePriority', routePriority);
|
|
25
25
|
};
|
|
@@ -42,12 +42,12 @@ export const RoutePrioritySettings: React.FC = () => {
|
|
|
42
42
|
orientation="vertical"
|
|
43
43
|
sx={{ mt: 1.5 }}
|
|
44
44
|
>
|
|
45
|
-
{
|
|
45
|
+
{Priorities.map((priority) => {
|
|
46
46
|
return (
|
|
47
47
|
<Tab
|
|
48
|
-
key={
|
|
49
|
-
label={t(`main.tags.${
|
|
50
|
-
value={
|
|
48
|
+
key={priority}
|
|
49
|
+
label={t(`main.tags.${priority.toLowerCase()}` as any)}
|
|
50
|
+
value={priority}
|
|
51
51
|
disableRipple
|
|
52
52
|
/>
|
|
53
53
|
);
|
|
@@ -4,15 +4,6 @@ export const SettingsList = styled(Box)(({ theme }) => ({
|
|
|
4
4
|
display: 'flex',
|
|
5
5
|
flexDirection: 'column',
|
|
6
6
|
gap: theme.spacing(1),
|
|
7
|
-
padding: theme.spacing(1, 0, 1),
|
|
8
|
-
}));
|
|
9
|
-
|
|
10
|
-
export const SummaryRowContainer = styled(Box)(({ theme }) => ({
|
|
11
|
-
display: 'flex',
|
|
12
|
-
width: '100%',
|
|
13
|
-
justifyContent: 'space-between',
|
|
14
|
-
alignItems: 'center',
|
|
15
|
-
padding: theme.spacing(2),
|
|
16
7
|
}));
|
|
17
8
|
|
|
18
9
|
export const Badge = styled(MuiBadge)(({ theme }) => ({
|
|
@@ -22,10 +22,7 @@ export const SettingsFieldSet = styled(Box)(({ theme }) => ({
|
|
|
22
22
|
}));
|
|
23
23
|
|
|
24
24
|
const slippageControlSelected = (theme: Theme) => ({
|
|
25
|
-
backgroundColor:
|
|
26
|
-
theme.palette.mode === 'dark'
|
|
27
|
-
? theme.palette.background.default
|
|
28
|
-
: theme.palette.common.white,
|
|
25
|
+
backgroundColor: theme.palette.background.paper,
|
|
29
26
|
borderRadius: theme.shape.borderRadiusSecondary,
|
|
30
27
|
boxShadow: `0px 2px 4px ${alpha(theme.palette.common.black, 0.04)}`,
|
|
31
28
|
});
|
|
@@ -5,7 +5,8 @@ import type { ToAddress } from '../../types/widget.js';
|
|
|
5
5
|
import type { PersistStoreProps } from '../types.js';
|
|
6
6
|
import type { BookmarkState } from './types.js';
|
|
7
7
|
|
|
8
|
-
const recentWalletsLimit =
|
|
8
|
+
const recentWalletsLimit = 10;
|
|
9
|
+
|
|
9
10
|
interface PersistBookmarkProps extends PersistStoreProps {
|
|
10
11
|
toAddress?: ToAddress;
|
|
11
12
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useCallback } from 'react';
|
|
2
2
|
import type { FormFieldNames } from './types.js';
|
|
3
|
-
import { useFieldValues } from './useFieldValues.js';
|
|
4
3
|
import { useFieldActions } from './useFieldActions.js';
|
|
4
|
+
import { useFieldValues } from './useFieldValues.js';
|
|
5
5
|
|
|
6
6
|
interface UseFieldControllerProps {
|
|
7
7
|
name: FormFieldNames;
|
|
@@ -13,7 +13,7 @@ export const useFieldController = ({ name }: UseFieldControllerProps) => {
|
|
|
13
13
|
|
|
14
14
|
const onChange = useCallback(
|
|
15
15
|
(newValue: string | number | undefined) => {
|
|
16
|
-
setFieldValue(name, newValue, { isDirty: true });
|
|
16
|
+
setFieldValue(name, newValue, { isDirty: true, isTouched: true });
|
|
17
17
|
},
|
|
18
18
|
[name, setFieldValue],
|
|
19
19
|
);
|
|
@@ -11,7 +11,7 @@ export const defaultConfigurableSettings: Pick<
|
|
|
11
11
|
SettingsState,
|
|
12
12
|
'routePriority' | 'slippage' | 'gasPrice'
|
|
13
13
|
> = {
|
|
14
|
-
routePriority: '
|
|
14
|
+
routePriority: 'CHEAPEST',
|
|
15
15
|
slippage: defaultSlippage,
|
|
16
16
|
gasPrice: 'normal',
|
|
17
17
|
};
|
|
@@ -111,7 +111,7 @@ export const useSettingsStore = createWithEqualityFn<SettingsState>(
|
|
|
111
111
|
}),
|
|
112
112
|
{
|
|
113
113
|
name: `li.fi-widget-settings`,
|
|
114
|
-
version:
|
|
114
|
+
version: 4,
|
|
115
115
|
partialize: (state) => {
|
|
116
116
|
const { disabledBridges, disabledExchanges, ...partializedState } =
|
|
117
117
|
state;
|
|
@@ -133,6 +133,9 @@ export const useSettingsStore = createWithEqualityFn<SettingsState>(
|
|
|
133
133
|
if (version === 1) {
|
|
134
134
|
persistedState.slippage = defaultConfigurableSettings.slippage;
|
|
135
135
|
}
|
|
136
|
+
if (version <= 3) {
|
|
137
|
+
persistedState.routePriority = 'CHEAPEST';
|
|
138
|
+
}
|
|
136
139
|
return persistedState as SettingsState;
|
|
137
140
|
},
|
|
138
141
|
},
|
package/types/widget.ts
CHANGED
package/utils/colors.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Theme } from '@mui/material';
|
|
2
2
|
import { alpha } from '@mui/material';
|
|
3
3
|
|
|
4
|
-
export const getContrastAlphaColor = (
|
|
5
|
-
mode
|
|
6
|
-
|
|
7
|
-
)
|
|
8
|
-
mode === 'light' ? `rgb(0 0 0 / ${alpha})` : `rgb(255 255 255 / ${alpha})`;
|
|
4
|
+
export const getContrastAlphaColor = (theme: Theme, value: number) =>
|
|
5
|
+
theme.palette.mode === 'light'
|
|
6
|
+
? alpha(theme.palette.common.black, value)
|
|
7
|
+
: alpha(theme.palette.common.white, value);
|
|
9
8
|
|
|
10
9
|
export const getWarningBackgroundColor = (theme: Theme) =>
|
|
11
10
|
theme.palette.mode === 'light'
|
|
@@ -18,6 +17,6 @@ export const getInfoBackgroundColor = (theme: Theme) =>
|
|
|
18
17
|
: alpha(theme.palette.info.main, 0.16);
|
|
19
18
|
|
|
20
19
|
export const getCardFieldsetBackgroundColor = (theme: Theme) =>
|
|
21
|
-
theme.palette.mode === '
|
|
22
|
-
? theme.palette.
|
|
23
|
-
:
|
|
20
|
+
theme.palette.mode === 'light'
|
|
21
|
+
? alpha(theme.palette.common.black, 0.04)
|
|
22
|
+
: theme.palette.grey[800];
|