@lifi/widget 3.0.0-alpha.37 → 3.0.0-alpha.38
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/_esm/components/Header/Header.style.d.ts +0 -3
- package/_esm/components/Header/Header.style.js +1 -7
- package/_esm/components/Header/Header.style.js.map +1 -1
- package/_esm/components/Header/NavigationHeader.js +1 -66
- package/_esm/components/Header/NavigationHeader.js.map +1 -1
- package/_esm/components/Header/NavigationTabs.js +3 -3
- package/_esm/components/Header/NavigationTabs.js.map +1 -1
- package/_esm/components/Tabs/Tabs.style.d.ts +3 -0
- package/_esm/components/Tabs/Tabs.style.js +17 -9
- package/_esm/components/Tabs/Tabs.style.js.map +1 -1
- package/_esm/config/version.d.ts +1 -1
- package/_esm/config/version.js +1 -1
- package/_esm/hooks/useAddressValidation.d.ts +1 -1
- package/_esm/hooks/useAddressValidation.js.map +1 -1
- package/_esm/hooks/useHeader.d.ts +2 -0
- package/_esm/hooks/useHeader.js +16 -0
- package/_esm/hooks/useHeader.js.map +1 -0
- package/_esm/pages/ActiveTransactionsPage/ActiveTransactionsPage.js +4 -10
- package/_esm/pages/ActiveTransactionsPage/ActiveTransactionsPage.js.map +1 -1
- package/_esm/pages/LanguagesPage.js +3 -1
- package/_esm/pages/LanguagesPage.js.map +1 -1
- package/_esm/pages/MainPage/MainPage.js +9 -0
- package/_esm/pages/MainPage/MainPage.js.map +1 -1
- package/_esm/pages/RoutesPage/RoutesPage.js +6 -8
- package/_esm/pages/RoutesPage/RoutesPage.js.map +1 -1
- package/_esm/pages/SelectChainPage/SelectChainPage.js +4 -0
- package/_esm/pages/SelectChainPage/SelectChainPage.js.map +1 -1
- package/_esm/pages/SelectEnabledToolsPage.js +5 -8
- package/_esm/pages/SelectEnabledToolsPage.js.map +1 -1
- package/_esm/pages/SelectTokenPage/SelectTokenPage.js +11 -0
- package/_esm/pages/SelectTokenPage/SelectTokenPage.js.map +1 -1
- package/_esm/pages/SelectWalletPage/SelectWalletPage.js +2 -0
- package/_esm/pages/SelectWalletPage/SelectWalletPage.js.map +1 -1
- package/_esm/pages/SendToWallet/BookmarksPage.js +2 -0
- package/_esm/pages/SendToWallet/BookmarksPage.js.map +1 -1
- package/_esm/pages/SendToWallet/ConnectedWalletsPage.js +2 -0
- package/_esm/pages/SendToWallet/ConnectedWalletsPage.js.map +1 -1
- package/_esm/pages/SendToWallet/RecentWalletsPage.js +2 -0
- package/_esm/pages/SendToWallet/RecentWalletsPage.js.map +1 -1
- package/_esm/pages/SendToWallet/SendToConfiguredWalletPage.js +2 -0
- package/_esm/pages/SendToWallet/SendToConfiguredWalletPage.js.map +1 -1
- package/_esm/pages/SendToWallet/SendToWalletPage.js +2 -0
- package/_esm/pages/SendToWallet/SendToWalletPage.js.map +1 -1
- package/_esm/pages/SettingsPage/GasPriceSettings.js +2 -2
- package/_esm/pages/SettingsPage/GasPriceSettings.js.map +1 -1
- package/_esm/pages/SettingsPage/RoutePrioritySettings.js +2 -2
- package/_esm/pages/SettingsPage/RoutePrioritySettings.js.map +1 -1
- package/_esm/pages/SettingsPage/SettingsPage.js +4 -0
- package/_esm/pages/SettingsPage/SettingsPage.js.map +1 -1
- package/_esm/pages/SettingsPage/SlippageSettings/SlippageSettings.style.js +8 -5
- package/_esm/pages/SettingsPage/SlippageSettings/SlippageSettings.style.js.map +1 -1
- package/_esm/pages/SettingsPage/ThemeSettings.js +2 -2
- package/_esm/pages/SettingsPage/ThemeSettings.js.map +1 -1
- package/_esm/pages/TransactionDetailsPage/TransactionDetailsPage.js +5 -0
- package/_esm/pages/TransactionDetailsPage/TransactionDetailsPage.js.map +1 -1
- package/_esm/pages/TransactionHistoryPage/TransactionHistoryPage.js +4 -0
- package/_esm/pages/TransactionHistoryPage/TransactionHistoryPage.js.map +1 -1
- package/_esm/pages/TransactionPage/StatusBottomSheet.js +4 -3
- package/_esm/pages/TransactionPage/StatusBottomSheet.js.map +1 -1
- package/_esm/pages/TransactionPage/StatusBottomSheet.style.d.ts +3 -0
- package/_esm/pages/TransactionPage/StatusBottomSheet.style.js +7 -0
- package/_esm/pages/TransactionPage/StatusBottomSheet.style.js.map +1 -1
- package/_esm/pages/TransactionPage/TransactionPage.js +16 -11
- package/_esm/pages/TransactionPage/TransactionPage.js.map +1 -1
- package/_esm/stores/header/useHeaderStore.js.map +1 -1
- package/_esm/themes/azureLight.js +12 -0
- package/_esm/themes/azureLight.js.map +1 -1
- package/_esm/themes/createTheme.js +28 -2
- package/_esm/themes/createTheme.js.map +1 -1
- package/_esm/themes/watermelonLight.js.map +1 -1
- package/_esm/types/widget.d.ts +1 -1
- package/_esm/types/widget.js.map +1 -1
- package/_esm/utils/colors.d.ts +0 -1
- package/_esm/utils/colors.js +0 -3
- package/_esm/utils/colors.js.map +1 -1
- package/components/Header/Header.style.ts +0 -9
- package/components/Header/NavigationHeader.tsx +1 -67
- package/components/Header/NavigationTabs.tsx +4 -4
- package/components/Tabs/Tabs.style.tsx +20 -9
- package/config/version.ts +1 -1
- package/hooks/useAddressValidation.ts +2 -1
- package/hooks/useHeader.ts +18 -0
- package/package.json +10 -11
- package/pages/ActiveTransactionsPage/ActiveTransactionsPage.tsx +11 -10
- package/pages/LanguagesPage.tsx +3 -1
- package/pages/MainPage/MainPage.tsx +11 -0
- package/pages/RoutesPage/RoutesPage.tsx +21 -18
- package/pages/SelectChainPage/SelectChainPage.tsx +5 -0
- package/pages/SelectEnabledToolsPage.tsx +17 -15
- package/pages/SelectTokenPage/SelectTokenPage.tsx +14 -0
- package/pages/SelectWalletPage/SelectWalletPage.tsx +3 -0
- package/pages/SendToWallet/BookmarksPage.tsx +3 -0
- package/pages/SendToWallet/ConnectedWalletsPage.tsx +2 -0
- package/pages/SendToWallet/RecentWalletsPage.tsx +3 -0
- package/pages/SendToWallet/SendToConfiguredWalletPage.tsx +3 -0
- package/pages/SendToWallet/SendToWalletPage.tsx +3 -0
- package/pages/SettingsPage/GasPriceSettings.tsx +3 -3
- package/pages/SettingsPage/RoutePrioritySettings.tsx +3 -3
- package/pages/SettingsPage/SettingsPage.tsx +5 -0
- package/pages/SettingsPage/SlippageSettings/SlippageSettings.style.tsx +10 -8
- package/pages/SettingsPage/ThemeSettings.tsx +3 -3
- package/pages/TransactionDetailsPage/TransactionDetailsPage.tsx +7 -0
- package/pages/TransactionHistoryPage/TransactionHistoryPage.tsx +5 -0
- package/pages/TransactionPage/StatusBottomSheet.style.tsx +8 -0
- package/pages/TransactionPage/StatusBottomSheet.tsx +18 -3
- package/pages/TransactionPage/TransactionPage.tsx +20 -14
- package/stores/header/useHeaderStore.tsx +0 -1
- package/themes/azureLight.ts +12 -0
- package/themes/createTheme.ts +36 -1
- package/themes/watermelonLight.ts +0 -2
- package/types/widget.ts +1 -0
- package/utils/colors.ts +0 -5
|
@@ -10,12 +10,12 @@ import {
|
|
|
10
10
|
List,
|
|
11
11
|
useTheme,
|
|
12
12
|
} from '@mui/material';
|
|
13
|
-
import { useCallback,
|
|
13
|
+
import { useCallback, useMemo, useState } from 'react';
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
15
|
import { ActiveTransactionItem } from '../../components/ActiveTransactions/ActiveTransactionItem.js';
|
|
16
16
|
import { Dialog } from '../../components/Dialog.js';
|
|
17
17
|
import { PageContainer } from '../../components/PageContainer.js';
|
|
18
|
-
import {
|
|
18
|
+
import { useHeader } from '../../hooks/useHeader.js';
|
|
19
19
|
import { useRouteExecutionStore } from '../../stores/routes/RouteExecutionStore.js';
|
|
20
20
|
import { useExecutingRoutesIds } from '../../stores/routes/useExecutingRoutesIds.js';
|
|
21
21
|
import { ActiveTransactionsEmpty } from './ActiveTransactionsEmpty.js';
|
|
@@ -38,20 +38,21 @@ export const ActiveTransactionsPage = () => {
|
|
|
38
38
|
const { t } = useTranslation();
|
|
39
39
|
const executingRoutes = useExecutingRoutesIds();
|
|
40
40
|
const deleteRoutes = useRouteExecutionStore((store) => store.deleteRoutes);
|
|
41
|
-
const headerStoreContext = useHeaderStoreContext();
|
|
42
41
|
const [open, setOpen] = useState(false);
|
|
43
42
|
|
|
44
43
|
const toggleDialog = useCallback(() => {
|
|
45
44
|
setOpen((open) => !open);
|
|
46
45
|
}, []);
|
|
47
46
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
47
|
+
const headerAction = useMemo(
|
|
48
|
+
() =>
|
|
49
|
+
executingRoutes.length ? (
|
|
50
|
+
<DeleteIconButton onClick={toggleDialog} />
|
|
51
|
+
) : undefined,
|
|
52
|
+
[executingRoutes.length, toggleDialog],
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
useHeader(t(`header.activeTransactions`), headerAction);
|
|
55
56
|
|
|
56
57
|
if (!executingRoutes.length) {
|
|
57
58
|
return <ActiveTransactionsEmpty />;
|
package/pages/LanguagesPage.tsx
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { Check } from '@mui/icons-material';
|
|
2
2
|
import { List } from '@mui/material';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import { useHeader } from '../hooks/useHeader.js';
|
|
4
5
|
import { ListItemText } from '../components/ListItemText.js';
|
|
5
6
|
import { PageContainer } from '../components/PageContainer.js';
|
|
6
7
|
import { SettingsListItemButton } from '../components/SettingsListItemButton.js';
|
|
7
8
|
import { useLanguages } from '../hooks/useLanguages.js';
|
|
8
9
|
|
|
9
10
|
export const LanguagesPage: React.FC = () => {
|
|
11
|
+
const { t } = useTranslation();
|
|
10
12
|
const { selectedLanguageCode, availableLanguages, setLanguageWithCode } =
|
|
11
13
|
useLanguages();
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
useHeader(t(`language.title`));
|
|
14
16
|
|
|
15
17
|
if (availableLanguages.length < 1) {
|
|
16
18
|
return null;
|
|
@@ -11,16 +11,27 @@ import { SendToWalletButton } from '../../components/SendToWallet/SendToWalletBu
|
|
|
11
11
|
import { SendToWalletExpandButton } from '../../components/SendToWallet/SendToWalletExpandButton.js';
|
|
12
12
|
import { useWideVariant } from '../../hooks/useWideVariant.js';
|
|
13
13
|
import { useWidgetConfig } from '../../providers/WidgetProvider/WidgetProvider.js';
|
|
14
|
+
import { useHeader } from '../../hooks/useHeader.js';
|
|
14
15
|
import { HiddenUI } from '../../types/widget.js';
|
|
15
16
|
import { MainMessages } from './MainMessages.js';
|
|
16
17
|
import { ReviewButton } from './ReviewButton.js';
|
|
18
|
+
import { useTranslation } from 'react-i18next';
|
|
17
19
|
|
|
18
20
|
export const MainPage: React.FC = () => {
|
|
21
|
+
const { t } = useTranslation();
|
|
19
22
|
const wideVariant = useWideVariant();
|
|
20
23
|
const { subvariant, contractComponent, hiddenUI } = useWidgetConfig();
|
|
21
24
|
const custom = subvariant === 'custom';
|
|
22
25
|
const showPoweredBy = !hiddenUI?.includes(HiddenUI.PoweredBy);
|
|
23
26
|
|
|
27
|
+
const title =
|
|
28
|
+
subvariant === 'custom'
|
|
29
|
+
? t(`header.checkout`)
|
|
30
|
+
: subvariant === 'refuel'
|
|
31
|
+
? t(`header.gas`)
|
|
32
|
+
: t(`header.exchange`);
|
|
33
|
+
useHeader(title);
|
|
34
|
+
|
|
24
35
|
return (
|
|
25
36
|
<PageContainer>
|
|
26
37
|
<ActiveTransactions sx={{ marginBottom: 2 }} />
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable react/no-array-index-key */
|
|
2
2
|
import type { Route } from '@lifi/sdk';
|
|
3
3
|
import type { BoxProps } from '@mui/material';
|
|
4
|
-
import {
|
|
4
|
+
import { useMemo } from 'react';
|
|
5
5
|
import { ProgressToNextUpdate } from '../../components/ProgressToNextUpdate.js';
|
|
6
6
|
import { RouteCard } from '../../components/RouteCard/RouteCard.js';
|
|
7
7
|
import { RouteCardSkeleton } from '../../components/RouteCard/RouteCardSkeleton.js';
|
|
@@ -11,15 +11,15 @@ import { useNavigateBack } from '../../hooks/useNavigateBack.js';
|
|
|
11
11
|
import { useRoutes } from '../../hooks/useRoutes.js';
|
|
12
12
|
import { useToAddressRequirements } from '../../hooks/useToAddressRequirements.js';
|
|
13
13
|
import { useFieldValues } from '../../stores/form/useFieldValues.js';
|
|
14
|
-
import {
|
|
14
|
+
import { useHeader } from '../../hooks/useHeader.js';
|
|
15
15
|
import { useSetExecutableRoute } from '../../stores/routes/useSetExecutableRoute.js';
|
|
16
16
|
import { navigationRoutes } from '../../utils/navigationRoutes.js';
|
|
17
17
|
import { Stack } from './RoutesPage.style.js';
|
|
18
|
+
import { useTranslation } from 'react-i18next';
|
|
18
19
|
|
|
19
20
|
export const RoutesPage: React.FC<BoxProps> = () => {
|
|
20
21
|
const { navigate } = useNavigateBack();
|
|
21
22
|
const setExecutableRoute = useSetExecutableRoute();
|
|
22
|
-
const headerStoreContext = useHeaderStoreContext();
|
|
23
23
|
const {
|
|
24
24
|
routes,
|
|
25
25
|
isLoading,
|
|
@@ -33,6 +33,24 @@ export const RoutesPage: React.FC<BoxProps> = () => {
|
|
|
33
33
|
const [toAddress] = useFieldValues('toAddress');
|
|
34
34
|
const { requiredToAddress } = useToAddressRequirements();
|
|
35
35
|
|
|
36
|
+
const { t } = useTranslation();
|
|
37
|
+
|
|
38
|
+
const headerAction = useMemo(
|
|
39
|
+
() => (
|
|
40
|
+
<ProgressToNextUpdate
|
|
41
|
+
updatedAt={dataUpdatedAt || new Date().getTime()}
|
|
42
|
+
timeToUpdate={refetchTime}
|
|
43
|
+
isLoading={isFetching}
|
|
44
|
+
onClick={() => refetch()}
|
|
45
|
+
sx={{ marginRight: -1 }}
|
|
46
|
+
size="medium"
|
|
47
|
+
/>
|
|
48
|
+
),
|
|
49
|
+
[dataUpdatedAt, isFetching, refetch, refetchTime],
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
useHeader(t(`header.youGet`), headerAction);
|
|
53
|
+
|
|
36
54
|
const handleRouteClick = (route: Route) => {
|
|
37
55
|
setExecutableRoute(route);
|
|
38
56
|
navigate(navigationRoutes.transactionExecution, {
|
|
@@ -40,21 +58,6 @@ export const RoutesPage: React.FC<BoxProps> = () => {
|
|
|
40
58
|
});
|
|
41
59
|
};
|
|
42
60
|
|
|
43
|
-
useEffect(() => {
|
|
44
|
-
return headerStoreContext
|
|
45
|
-
.getState()
|
|
46
|
-
.setAction(
|
|
47
|
-
<ProgressToNextUpdate
|
|
48
|
-
updatedAt={dataUpdatedAt || new Date().getTime()}
|
|
49
|
-
timeToUpdate={refetchTime}
|
|
50
|
-
isLoading={isFetching}
|
|
51
|
-
onClick={() => refetch()}
|
|
52
|
-
sx={{ marginRight: -1 }}
|
|
53
|
-
size="medium"
|
|
54
|
-
/>,
|
|
55
|
-
);
|
|
56
|
-
}, [dataUpdatedAt, headerStoreContext, isFetching, refetch, refetchTime]);
|
|
57
|
-
|
|
58
61
|
const routeNotFound = !routes?.length && !isLoading && !isFetching;
|
|
59
62
|
|
|
60
63
|
const toAddressUnsatisfied = routes?.[0] && requiredToAddress && !toAddress;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ExtendedChain } from '@lifi/sdk';
|
|
2
2
|
import { Avatar, List, ListItemAvatar } from '@mui/material';
|
|
3
|
+
import { useHeader } from '../../hooks/useHeader.js';
|
|
3
4
|
import { useChainSelect } from '../../components/ChainSelect/useChainSelect.js';
|
|
4
5
|
import { ListItemButton } from '../../components/ListItemButton.js';
|
|
5
6
|
import { ListItemText } from '../../components/ListItemText.js';
|
|
@@ -7,6 +8,7 @@ import { PageContainer } from '../../components/PageContainer.js';
|
|
|
7
8
|
import { useTokenSelect } from '../../components/TokenList/useTokenSelect.js';
|
|
8
9
|
import { useNavigateBack } from '../../hooks/useNavigateBack.js';
|
|
9
10
|
import type { SelectChainPageProps } from './types.js';
|
|
11
|
+
import { useTranslation } from 'react-i18next';
|
|
10
12
|
|
|
11
13
|
export const SelectChainPage: React.FC<SelectChainPageProps> = ({
|
|
12
14
|
formType,
|
|
@@ -16,6 +18,9 @@ export const SelectChainPage: React.FC<SelectChainPageProps> = ({
|
|
|
16
18
|
const { chains, setCurrentChain } = useChainSelect(formType);
|
|
17
19
|
const selectToken = useTokenSelect(formType, navigateBack);
|
|
18
20
|
|
|
21
|
+
const { t } = useTranslation();
|
|
22
|
+
useHeader(t('header.selectChain'));
|
|
23
|
+
|
|
19
24
|
const handleClick = async (chain: ExtendedChain) => {
|
|
20
25
|
if (selectNativeToken) {
|
|
21
26
|
selectToken(chain.nativeToken.address, chain.id);
|
|
@@ -13,14 +13,14 @@ import {
|
|
|
13
13
|
useTheme,
|
|
14
14
|
} from '@mui/material';
|
|
15
15
|
import type { MouseEventHandler } from 'react';
|
|
16
|
-
import {
|
|
16
|
+
import { useMemo } from 'react';
|
|
17
17
|
import { useTranslation } from 'react-i18next';
|
|
18
18
|
import { shallow } from 'zustand/shallow';
|
|
19
19
|
import { ListItemText } from '../components/ListItemText.js';
|
|
20
20
|
import { PageContainer } from '../components/PageContainer.js';
|
|
21
21
|
import { SettingsListItemButton } from '../components/SettingsListItemButton.js';
|
|
22
22
|
import { useTools } from '../hooks/useTools.js';
|
|
23
|
-
import {
|
|
23
|
+
import { useHeader } from '../hooks/useHeader.js';
|
|
24
24
|
import { useSettingsStore } from '../stores/settings/useSettingsStore.js';
|
|
25
25
|
|
|
26
26
|
interface SelectAllCheckboxProps {
|
|
@@ -74,24 +74,26 @@ export const SelectEnabledToolsPage: React.FC<{
|
|
|
74
74
|
],
|
|
75
75
|
shallow,
|
|
76
76
|
);
|
|
77
|
-
|
|
77
|
+
|
|
78
|
+
const { t } = useTranslation();
|
|
79
|
+
|
|
80
|
+
const headerAction = useMemo(
|
|
81
|
+
() => (
|
|
82
|
+
<SelectAllCheckbox
|
|
83
|
+
allCheckboxesSelected={!disabledTools.length}
|
|
84
|
+
anyCheckboxesSelected={Boolean(disabledTools.length)}
|
|
85
|
+
onClick={() => toggleTools(type)}
|
|
86
|
+
/>
|
|
87
|
+
),
|
|
88
|
+
[disabledTools.length, toggleTools, type],
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
useHeader(t(`settings.enabled${type}`), headerAction);
|
|
78
92
|
|
|
79
93
|
const handleClick = (key: string) => {
|
|
80
94
|
setToolValue(type, key, !enabledTools[key]);
|
|
81
95
|
};
|
|
82
96
|
|
|
83
|
-
useEffect(() => {
|
|
84
|
-
return headerStoreContext
|
|
85
|
-
.getState()
|
|
86
|
-
.setAction(
|
|
87
|
-
<SelectAllCheckbox
|
|
88
|
-
allCheckboxesSelected={!disabledTools.length}
|
|
89
|
-
anyCheckboxesSelected={Boolean(disabledTools.length)}
|
|
90
|
-
onClick={() => toggleTools(type)}
|
|
91
|
-
/>,
|
|
92
|
-
);
|
|
93
|
-
}, [disabledTools.length, headerStoreContext, toggleTools, type]);
|
|
94
|
-
|
|
95
97
|
return (
|
|
96
98
|
<PageContainer disableGutters>
|
|
97
99
|
<List
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Box } from '@mui/material';
|
|
2
2
|
import type { FC } from 'react';
|
|
3
3
|
import { useLayoutEffect, useRef, useState } from 'react';
|
|
4
|
+
import { useWidgetConfig } from '../../providers/WidgetProvider/WidgetProvider.js';
|
|
5
|
+
import { useHeader } from '../../hooks/useHeader.js';
|
|
4
6
|
import { ChainSelect } from '../../components/ChainSelect/ChainSelect.js';
|
|
5
7
|
import { PageContainer } from '../../components/PageContainer.js';
|
|
6
8
|
import { TokenList } from '../../components/TokenList/TokenList.js';
|
|
@@ -10,6 +12,7 @@ import { useScrollableOverflowHidden } from '../../hooks/useScrollableContainer.
|
|
|
10
12
|
import { useSwapOnly } from '../../hooks/useSwapOnly.js';
|
|
11
13
|
import type { FormTypeProps } from '../../stores/form/types.js';
|
|
12
14
|
import { SearchTokenInput } from './SearchTokenInput.js';
|
|
15
|
+
import { useTranslation } from 'react-i18next';
|
|
13
16
|
|
|
14
17
|
const minTokenListHeight = 360;
|
|
15
18
|
|
|
@@ -21,6 +24,17 @@ export const SelectTokenPage: FC<FormTypeProps> = ({ formType }) => {
|
|
|
21
24
|
const [tokenListHeight, setTokenListHeight] = useState(0);
|
|
22
25
|
const swapOnly = useSwapOnly();
|
|
23
26
|
|
|
27
|
+
const { subvariant } = useWidgetConfig();
|
|
28
|
+
const { t } = useTranslation();
|
|
29
|
+
const title =
|
|
30
|
+
formType === 'from'
|
|
31
|
+
? subvariant === 'custom'
|
|
32
|
+
? t(`header.payWith`)
|
|
33
|
+
: t(`header.from`)
|
|
34
|
+
: t(`header.to`);
|
|
35
|
+
|
|
36
|
+
useHeader(title);
|
|
37
|
+
|
|
24
38
|
useLayoutEffect(() => {
|
|
25
39
|
setTokenListHeight(
|
|
26
40
|
Math.max(
|
|
@@ -23,6 +23,7 @@ import { isItemAllowed } from '../../utils/item.js';
|
|
|
23
23
|
import { EVMListItemButton } from './EVMListItemButton.js';
|
|
24
24
|
import { SVMListItemButton } from './SVMListItemButton.js';
|
|
25
25
|
import { walletComparator } from './utils.js';
|
|
26
|
+
import { useHeader } from '../../hooks/useHeader.js';
|
|
26
27
|
|
|
27
28
|
export const SelectWalletPage = () => {
|
|
28
29
|
const { t } = useTranslation();
|
|
@@ -35,6 +36,8 @@ export const SelectWalletPage = () => {
|
|
|
35
36
|
}>({ show: false });
|
|
36
37
|
const { wallets: solanaWallets } = useWallet();
|
|
37
38
|
|
|
39
|
+
useHeader(t(`header.selectWallet`));
|
|
40
|
+
|
|
38
41
|
const isDesktopView = useMediaQuery((theme: Theme) =>
|
|
39
42
|
theme.breakpoints.up('sm'),
|
|
40
43
|
);
|
|
@@ -21,6 +21,7 @@ import { useBookmarkActions } from '../../stores/bookmarks/useBookmarkActions.js
|
|
|
21
21
|
import { useBookmarks } from '../../stores/bookmarks/useBookmarks.js';
|
|
22
22
|
import { useFieldActions } from '../../stores/form/useFieldActions.js';
|
|
23
23
|
import { useSendToWalletActions } from '../../stores/settings/useSendToWalletStore.js';
|
|
24
|
+
import { useHeader } from '../../hooks/useHeader.js';
|
|
24
25
|
import { defaultChainIdsByType } from '../../utils/chainType.js';
|
|
25
26
|
import { navigationRoutes } from '../../utils/navigationRoutes.js';
|
|
26
27
|
import { shortenAddress } from '../../utils/wallet.js';
|
|
@@ -46,6 +47,8 @@ export const BookmarksPage = () => {
|
|
|
46
47
|
const { setFieldValue } = useFieldActions();
|
|
47
48
|
const { setSendToWallet } = useSendToWalletActions();
|
|
48
49
|
|
|
50
|
+
useHeader(t(`header.bookmarkedWallets`));
|
|
51
|
+
|
|
49
52
|
const handleAddBookmark = () => {
|
|
50
53
|
bookmarkAddressSheetRef.current?.open();
|
|
51
54
|
};
|
|
@@ -19,6 +19,7 @@ import { useToAddressRequirements } from '../../hooks/useToAddressRequirements.j
|
|
|
19
19
|
import { useBookmarkActions } from '../../stores/bookmarks/useBookmarkActions.js';
|
|
20
20
|
import { useFieldActions } from '../../stores/form/useFieldActions.js';
|
|
21
21
|
import { useSendToWalletActions } from '../../stores/settings/useSendToWalletStore.js';
|
|
22
|
+
import { useHeader } from '../../hooks/useHeader.js';
|
|
22
23
|
import { navigationRoutes } from '../../utils/navigationRoutes.js';
|
|
23
24
|
import { shortenAddress } from '../../utils/wallet.js';
|
|
24
25
|
import { EmptyListIndicator } from './EmptyListIndicator.js';
|
|
@@ -42,6 +43,7 @@ export const ConnectedWalletsPage = () => {
|
|
|
42
43
|
const moreMenuId = useId();
|
|
43
44
|
const open = Boolean(moreMenuAnchorEl);
|
|
44
45
|
|
|
46
|
+
useHeader(t('sendToWallet.connectedWallets'));
|
|
45
47
|
const handleWalletSelected = (account: Account) => {
|
|
46
48
|
setFieldValue('toAddress', account.address!, {
|
|
47
49
|
isTouched: true,
|
|
@@ -22,6 +22,7 @@ import { useBookmarkActions } from '../../stores/bookmarks/useBookmarkActions.js
|
|
|
22
22
|
import { useBookmarks } from '../../stores/bookmarks/useBookmarks.js';
|
|
23
23
|
import { useFieldActions } from '../../stores/form/useFieldActions.js';
|
|
24
24
|
import { useSendToWalletActions } from '../../stores/settings/useSendToWalletStore.js';
|
|
25
|
+
import { useHeader } from '../../hooks/useHeader.js';
|
|
25
26
|
import { defaultChainIdsByType } from '../../utils/chainType.js';
|
|
26
27
|
import { navigationRoutes } from '../../utils/navigationRoutes.js';
|
|
27
28
|
import { shortenAddress } from '../../utils/wallet.js';
|
|
@@ -53,6 +54,8 @@ export const RecentWalletsPage = () => {
|
|
|
53
54
|
const [moreMenuAnchorEl, setMenuAnchorEl] = useState<HTMLElement | null>();
|
|
54
55
|
const open = Boolean(moreMenuAnchorEl);
|
|
55
56
|
|
|
57
|
+
useHeader(t(`header.recentWallets`));
|
|
58
|
+
|
|
56
59
|
const handleRecentSelected = (recentWallet: Bookmark) => {
|
|
57
60
|
addRecentWallet(recentWallet);
|
|
58
61
|
setFieldValue('toAddress', recentWallet.address, {
|
|
@@ -16,6 +16,7 @@ import { useToAddressRequirements } from '../../hooks/useToAddressRequirements.j
|
|
|
16
16
|
import { useWidgetConfig } from '../../providers/WidgetProvider/WidgetProvider.js';
|
|
17
17
|
import { useBookmarkActions } from '../../stores/bookmarks/useBookmarkActions.js';
|
|
18
18
|
import { useFieldActions } from '../../stores/form/useFieldActions.js';
|
|
19
|
+
import { useHeader } from '../../hooks/useHeader.js';
|
|
19
20
|
import type { ToAddress } from '../../types/widget.js';
|
|
20
21
|
import { defaultChainIdsByType } from '../../utils/chainType.js';
|
|
21
22
|
import { navigationRoutes } from '../../utils/navigationRoutes.js';
|
|
@@ -39,6 +40,8 @@ export const SendToConfiguredWalletPage = () => {
|
|
|
39
40
|
const [moreMenuAnchorEl, setMenuAnchorEl] = useState<HTMLElement | null>();
|
|
40
41
|
const open = Boolean(moreMenuAnchorEl);
|
|
41
42
|
|
|
43
|
+
useHeader(t(`header.sendToWallet`));
|
|
44
|
+
|
|
42
45
|
const handleCuratedSelected = (toAddress: ToAddress) => {
|
|
43
46
|
setSelectedBookmark(toAddress);
|
|
44
47
|
setFieldValue('toAddress', toAddress.address, { isTouched: true });
|
|
@@ -19,6 +19,7 @@ import { useBookmarkActions } from '../../stores/bookmarks/useBookmarkActions.js
|
|
|
19
19
|
import { useBookmarks } from '../../stores/bookmarks/useBookmarks.js';
|
|
20
20
|
import { useFieldActions } from '../../stores/form/useFieldActions.js';
|
|
21
21
|
import { useFieldValues } from '../../stores/form/useFieldValues.js';
|
|
22
|
+
import { useHeader } from '../../hooks/useHeader.js';
|
|
22
23
|
import { navigationRoutes } from '../../utils/navigationRoutes.js';
|
|
23
24
|
import { BookmarkAddressSheet } from './BookmarkAddressSheet.js';
|
|
24
25
|
import { ConfirmAddressSheet } from './ConfirmAddressSheet.js';
|
|
@@ -59,6 +60,8 @@ export const SendToWalletPage = () => {
|
|
|
59
60
|
const [isDoneButtonLoading, setIsDoneButtonLoading] = useState(false);
|
|
60
61
|
const [isBookmarkButtonLoading, setIsBookmarkButtonLoading] = useState(false);
|
|
61
62
|
|
|
63
|
+
useHeader(t(`header.sendToWallet`));
|
|
64
|
+
|
|
62
65
|
const handleInputChange = (e: ChangeEvent) => {
|
|
63
66
|
if (errorMessage) {
|
|
64
67
|
setErrorMessage('');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EvStation } from '@mui/icons-material';
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
|
-
import {
|
|
3
|
+
import { CardTabs, Tab } from '../../components/Tabs/Tabs.style.js';
|
|
4
4
|
import { useSettingMonitor } from '../../hooks/useSettingMonitor.js';
|
|
5
5
|
import { useSettings } from '../../stores/settings/useSettings.js';
|
|
6
6
|
import { useSettingsStore } from '../../stores/settings/useSettingsStore.js';
|
|
@@ -27,7 +27,7 @@ export const GasPriceSettings: React.FC = () => {
|
|
|
27
27
|
icon={<EvStation />}
|
|
28
28
|
title={t(`settings.gasPrice.title`)}
|
|
29
29
|
>
|
|
30
|
-
<
|
|
30
|
+
<CardTabs
|
|
31
31
|
value={gasPrice}
|
|
32
32
|
aria-label="tabs"
|
|
33
33
|
indicatorColor="primary"
|
|
@@ -41,7 +41,7 @@ export const GasPriceSettings: React.FC = () => {
|
|
|
41
41
|
disableRipple
|
|
42
42
|
/>
|
|
43
43
|
<Tab label={t(`settings.gasPrice.fast`)} value="fast" disableRipple />
|
|
44
|
-
</
|
|
44
|
+
</CardTabs>
|
|
45
45
|
</SettingCardExpandable>
|
|
46
46
|
);
|
|
47
47
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Order } from '@lifi/sdk';
|
|
2
2
|
import { Route } from '@mui/icons-material';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import {
|
|
4
|
+
import { CardTabs, Tab } from '../../components/Tabs/Tabs.style.js';
|
|
5
5
|
import { useSettingMonitor } from '../../hooks/useSettingMonitor.js';
|
|
6
6
|
import { useSettings } from '../../stores/settings/useSettings.js';
|
|
7
7
|
import { useSettingsStore } from '../../stores/settings/useSettingsStore.js';
|
|
@@ -34,7 +34,7 @@ export const RoutePrioritySettings: React.FC = () => {
|
|
|
34
34
|
icon={<Route />}
|
|
35
35
|
title={t(`settings.routePriority`)}
|
|
36
36
|
>
|
|
37
|
-
<
|
|
37
|
+
<CardTabs
|
|
38
38
|
value={currentRoutePriority}
|
|
39
39
|
aria-label="tabs"
|
|
40
40
|
indicatorColor="primary"
|
|
@@ -52,7 +52,7 @@ export const RoutePrioritySettings: React.FC = () => {
|
|
|
52
52
|
/>
|
|
53
53
|
);
|
|
54
54
|
})}
|
|
55
|
-
</
|
|
55
|
+
</CardTabs>
|
|
56
56
|
</SettingCardExpandable>
|
|
57
57
|
);
|
|
58
58
|
};
|
|
@@ -8,8 +8,13 @@ import { SettingsList } from './SettingsCard/SettingCard.style.js';
|
|
|
8
8
|
import { SettingsCardAccordion } from './SettingsCard/SettingsAccordian.js';
|
|
9
9
|
import { SlippageSettings } from './SlippageSettings/SlippageSettings.js';
|
|
10
10
|
import { ThemeSettings } from './ThemeSettings.js';
|
|
11
|
+
import { useHeader } from '../../hooks/useHeader.js';
|
|
12
|
+
import { useTranslation } from 'react-i18next';
|
|
11
13
|
|
|
12
14
|
export const SettingsPage = () => {
|
|
15
|
+
const { t } = useTranslation();
|
|
16
|
+
useHeader(t(`header.settings`));
|
|
17
|
+
|
|
13
18
|
return (
|
|
14
19
|
<PageContainer bottomGutters>
|
|
15
20
|
<SettingsList>
|
|
@@ -7,23 +7,25 @@ import {
|
|
|
7
7
|
inputBaseClasses,
|
|
8
8
|
styled,
|
|
9
9
|
} from '@mui/material';
|
|
10
|
-
import { getCardFieldsetBackgroundColor } from '../../../utils/colors.js';
|
|
11
10
|
|
|
12
11
|
export const SettingsFieldSet = styled(Box)(({ theme }) => ({
|
|
13
12
|
display: 'flex',
|
|
14
|
-
backgroundColor:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
backgroundColor:
|
|
14
|
+
theme.palette.mode === 'light'
|
|
15
|
+
? alpha(theme.palette.common.black, 0.04)
|
|
16
|
+
: alpha(theme.palette.common.white, 0.08),
|
|
17
|
+
borderRadius: theme.shape.borderRadius,
|
|
19
18
|
padding: theme.spacing(0.5),
|
|
20
19
|
gap: theme.spacing(0.5),
|
|
21
20
|
height: '3.5rem',
|
|
22
21
|
}));
|
|
23
22
|
|
|
24
23
|
const slippageControlSelected = (theme: Theme) => ({
|
|
25
|
-
backgroundColor:
|
|
26
|
-
|
|
24
|
+
backgroundColor:
|
|
25
|
+
theme.palette.mode === 'light'
|
|
26
|
+
? theme.palette.background.paper
|
|
27
|
+
: alpha(theme.palette.common.black, 0.56),
|
|
28
|
+
borderRadius: theme.shape.borderRadius - 4,
|
|
27
29
|
boxShadow: `0px 2px 4px ${alpha(theme.palette.common.black, 0.04)}`,
|
|
28
30
|
});
|
|
29
31
|
|
|
@@ -2,7 +2,7 @@ import { BrightnessAuto, LightMode, Nightlight } from '@mui/icons-material';
|
|
|
2
2
|
import { Tooltip } from '@mui/material';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { CardValue } from '../../components/Card/CardButton.style.js';
|
|
5
|
-
import {
|
|
5
|
+
import { CardTabs, Tab } from '../../components/Tabs/Tabs.style.js';
|
|
6
6
|
import { useWidgetConfig } from '../../providers/WidgetProvider/WidgetProvider.js';
|
|
7
7
|
import { useAppearance } from '../../stores/settings/useAppearance.js';
|
|
8
8
|
import type { Appearance } from '../../types/widget.js';
|
|
@@ -58,7 +58,7 @@ export const ThemeSettings: React.FC = () => {
|
|
|
58
58
|
icon={<ThemeIcon />}
|
|
59
59
|
title={t('settings.theme')}
|
|
60
60
|
>
|
|
61
|
-
<
|
|
61
|
+
<CardTabs
|
|
62
62
|
value={appearance}
|
|
63
63
|
aria-label="tabs"
|
|
64
64
|
indicatorColor="primary"
|
|
@@ -77,7 +77,7 @@ export const ThemeSettings: React.FC = () => {
|
|
|
77
77
|
/>
|
|
78
78
|
);
|
|
79
79
|
})}
|
|
80
|
-
</
|
|
80
|
+
</CardTabs>
|
|
81
81
|
</SettingCardExpandable>
|
|
82
82
|
);
|
|
83
83
|
};
|
|
@@ -21,6 +21,7 @@ import { formatTokenAmount } from '../../utils/format.js';
|
|
|
21
21
|
import { navigationRoutes } from '../../utils/navigationRoutes.js';
|
|
22
22
|
import { ContactSupportButton } from './ContactSupportButton.js';
|
|
23
23
|
import { TransactionDetailsSkeleton } from './TransactionDetailsSkeleton.js';
|
|
24
|
+
import { useHeader } from '../../hooks/useHeader.js';
|
|
24
25
|
|
|
25
26
|
export const TransactionDetailsPage: React.FC = () => {
|
|
26
27
|
const { t, i18n } = useTranslation();
|
|
@@ -36,6 +37,12 @@ export const TransactionDetailsPage: React.FC = () => {
|
|
|
36
37
|
state?.transactionHash,
|
|
37
38
|
);
|
|
38
39
|
|
|
40
|
+
const title =
|
|
41
|
+
subvariant === 'custom'
|
|
42
|
+
? t(`header.purchaseDetails`)
|
|
43
|
+
: t(`header.transactionDetails`);
|
|
44
|
+
useHeader(title);
|
|
45
|
+
|
|
39
46
|
const routeExecution = useMemo(() => {
|
|
40
47
|
if (storedRouteExecution) {
|
|
41
48
|
return storedRouteExecution;
|
|
@@ -2,18 +2,23 @@ import type { FullStatusData } from '@lifi/sdk';
|
|
|
2
2
|
import { List } from '@mui/material';
|
|
3
3
|
import { useVirtualizer } from '@tanstack/react-virtual';
|
|
4
4
|
import { useRef } from 'react';
|
|
5
|
+
import { useHeader } from '../../hooks/useHeader.js';
|
|
5
6
|
import { PageContainer } from '../../components/PageContainer.js';
|
|
6
7
|
import { useTransactionHistory } from '../../hooks/useTransactionHistory.js';
|
|
7
8
|
import { TransactionHistoryEmpty } from './TransactionHistoryEmpty.js';
|
|
8
9
|
import { TransactionHistoryItem } from './TransactionHistoryItem.js';
|
|
9
10
|
import { TransactionHistoryItemSkeleton } from './TransactionHistorySkeleton.js';
|
|
10
11
|
import { minTransactionListHeight } from './constants.js';
|
|
12
|
+
import { useTranslation } from 'react-i18next';
|
|
11
13
|
|
|
12
14
|
export const TransactionHistoryPage: React.FC = () => {
|
|
13
15
|
// Parent ref and useVirtualizer should be in one file to avoid blank page (0 virtual items) issue
|
|
14
16
|
const parentRef = useRef<HTMLDivElement | null>(null);
|
|
15
17
|
const { data: transactions, isLoading } = useTransactionHistory();
|
|
16
18
|
|
|
19
|
+
const { t } = useTranslation();
|
|
20
|
+
useHeader(t(`header.transactionHistory`));
|
|
21
|
+
|
|
17
22
|
const { getVirtualItems, getTotalSize } = useVirtualizer({
|
|
18
23
|
count: transactions.length,
|
|
19
24
|
overscan: 10,
|
|
@@ -52,3 +52,11 @@ export const IconCircle = styled(Box, {
|
|
|
52
52
|
},
|
|
53
53
|
};
|
|
54
54
|
});
|
|
55
|
+
|
|
56
|
+
export const MessageSkeletonContainer = styled(Box)(({ theme }) => ({
|
|
57
|
+
display: 'flex',
|
|
58
|
+
flexDirection: 'column',
|
|
59
|
+
height: 64,
|
|
60
|
+
gap: theme.spacing(0.5),
|
|
61
|
+
paddingTop: theme.spacing(1),
|
|
62
|
+
}));
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
InfoRounded,
|
|
5
5
|
WarningRounded,
|
|
6
6
|
} from '@mui/icons-material';
|
|
7
|
-
import { Box, Button, Typography } from '@mui/material';
|
|
7
|
+
import { Box, Button, Skeleton, Typography } from '@mui/material';
|
|
8
8
|
import { useQueryClient } from '@tanstack/react-query';
|
|
9
9
|
import { useCallback, useEffect, useRef } from 'react';
|
|
10
10
|
import { useTranslation } from 'react-i18next';
|
|
@@ -27,12 +27,23 @@ import { hasEnumFlag } from '../../utils/enum.js';
|
|
|
27
27
|
import { formatTokenAmount } from '../../utils/format.js';
|
|
28
28
|
import { navigationRoutes } from '../../utils/navigationRoutes.js';
|
|
29
29
|
import { shortenAddress } from '../../utils/wallet.js';
|
|
30
|
-
import {
|
|
30
|
+
import {
|
|
31
|
+
CenterContainer,
|
|
32
|
+
IconCircle,
|
|
33
|
+
MessageSkeletonContainer,
|
|
34
|
+
} from './StatusBottomSheet.style.js';
|
|
31
35
|
|
|
32
36
|
interface StatusBottomSheetContentProps extends RouteExecution {
|
|
33
37
|
onClose(): void;
|
|
34
38
|
}
|
|
35
39
|
|
|
40
|
+
const MessageSkeleton = () => (
|
|
41
|
+
<MessageSkeletonContainer>
|
|
42
|
+
<Skeleton height={24} variant="text" width="92%" />
|
|
43
|
+
<Skeleton height={24} variant="text" width="56%" />
|
|
44
|
+
</MessageSkeletonContainer>
|
|
45
|
+
);
|
|
46
|
+
|
|
36
47
|
export const StatusBottomSheet: React.FC<RouteExecution> = ({
|
|
37
48
|
status,
|
|
38
49
|
route,
|
|
@@ -270,7 +281,11 @@ export const StatusBottomSheetContent: React.FC<
|
|
|
270
281
|
</CenterContainer>
|
|
271
282
|
)}
|
|
272
283
|
{!showContractComponent ? (
|
|
273
|
-
|
|
284
|
+
primaryMessage ? (
|
|
285
|
+
<Typography py={1}>{primaryMessage}</Typography>
|
|
286
|
+
) : (
|
|
287
|
+
<MessageSkeleton />
|
|
288
|
+
)
|
|
274
289
|
) : null}
|
|
275
290
|
{secondaryMessage ? (
|
|
276
291
|
<Typography py={1}>{secondaryMessage}</Typography>
|