@lifi/widget 1.11.4 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/NotFound.js +2 -1
- package/config/version.d.ts +1 -1
- package/config/version.js +1 -1
- package/i18n/en/translation.json +3 -2
- package/i18n/index.d.ts +1 -0
- package/package.json +5 -5
- package/pages/SwapHistoryPage/SwapHistoryPage.js +19 -3
- package/stores/route/types.d.ts +1 -0
- package/stores/route/useRouteStore.js +3 -0
package/components/NotFound.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Block as BlockIcon } from '@mui/icons-material';
|
|
2
3
|
import { Box, Typography } from '@mui/material';
|
|
3
4
|
import { useTranslation } from 'react-i18next';
|
|
4
5
|
export const NotFound = () => {
|
|
@@ -10,5 +11,5 @@ export const NotFound = () => {
|
|
|
10
11
|
flexDirection: 'column',
|
|
11
12
|
flex: 1,
|
|
12
13
|
padding: 3,
|
|
13
|
-
} }, { children: [_jsx(Typography, Object.assign({
|
|
14
|
+
} }, { children: [_jsx(Typography, Object.assign({ fontSize: 48 }, { children: _jsx(BlockIcon, { fontSize: "inherit" }) })), _jsx(Typography, Object.assign({ fontSize: 18, fontWeight: 700 }, { children: t('tooltip.notFound.title') })), _jsx(Typography, Object.assign({ fontSize: 14, color: "text.secondary", textAlign: "center", mt: 2 }, { children: t('tooltip.notFound.text') }))] })));
|
|
14
15
|
};
|
package/config/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const name = "@lifi/widget";
|
|
2
|
-
export declare const version = "1.
|
|
2
|
+
export declare const version = "1.12.0";
|
package/config/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = '@lifi/widget';
|
|
2
|
-
export const version = '1.
|
|
2
|
+
export const version = '1.12.0';
|
package/i18n/en/translation.json
CHANGED
|
@@ -90,7 +90,8 @@
|
|
|
90
90
|
"warning": {
|
|
91
91
|
"title": {
|
|
92
92
|
"insufficientGas": "Insufficient gas",
|
|
93
|
-
"deleteSwap": "Delete this swap?"
|
|
93
|
+
"deleteSwap": "Delete this swap?",
|
|
94
|
+
"deleteSwapHistory": "Delete swap history?"
|
|
94
95
|
},
|
|
95
96
|
"message": {
|
|
96
97
|
"insufficientFunds": "You don't have enough funds to execute the swap.",
|
|
@@ -164,7 +165,7 @@
|
|
|
164
165
|
},
|
|
165
166
|
"tooltip": {
|
|
166
167
|
"notFound": {
|
|
167
|
-
"title": "
|
|
168
|
+
"title": "404",
|
|
168
169
|
"text": "We couldn't find this page."
|
|
169
170
|
},
|
|
170
171
|
"progressToNextUpdate": "Displayed data will auto-refresh after {{value}} seconds. Click this circle to update manually."
|
package/i18n/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lifi/widget",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.12.0",
|
|
4
4
|
"description": "LI.FI Widget for cross-chain bridging and swapping. It will drive your multi-chain strategy and attract new users from everywhere.",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./index.js",
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"@mui/icons-material": "^5.8.4",
|
|
47
47
|
"@mui/lab": "^5.0.0-alpha.92",
|
|
48
48
|
"@mui/material": "^5.9.2",
|
|
49
|
-
"@sentry/integrations": "^7.
|
|
50
|
-
"@sentry/react": "^7.
|
|
51
|
-
"@sentry/tracing": "^7.
|
|
49
|
+
"@sentry/integrations": "^7.8.0",
|
|
50
|
+
"@sentry/react": "^7.8.0",
|
|
51
|
+
"@sentry/tracing": "^7.8.0",
|
|
52
52
|
"@tanstack/react-query": "^4.0.10",
|
|
53
53
|
"big.js": "^6.2.1",
|
|
54
54
|
"i18next": "^21.8.14",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"react": "^18.2.0",
|
|
57
57
|
"react-dom": "^18.2.0",
|
|
58
58
|
"react-hook-form": "^7.33.1",
|
|
59
|
-
"react-i18next": "^11.18.
|
|
59
|
+
"react-i18next": "^11.18.3",
|
|
60
60
|
"react-resize-detector": "^7.1.2",
|
|
61
61
|
"react-router-dom": "^6.3.0",
|
|
62
62
|
"react-timer-hook": "^3.0.5",
|
|
@@ -1,14 +1,30 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { DeleteOutline as DeleteIcon } from '@mui/icons-material';
|
|
3
|
+
import { Button, Container, DialogActions, DialogContent, DialogContentText, DialogTitle, IconButton, Stack, } from '@mui/material';
|
|
4
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
6
|
+
import { Dialog } from '../../components/Dialog';
|
|
7
|
+
import { useSetHeaderAction } from '../../components/Header';
|
|
3
8
|
import { useWallet } from '../../providers/WalletProvider';
|
|
9
|
+
import { useRouteStore } from '../../stores';
|
|
4
10
|
import { useSwapHistory } from '../../stores/route';
|
|
5
11
|
import { SwapHistoryEmpty } from './SwapHistoryEmpty';
|
|
6
12
|
import { SwapHistoryItem } from './SwapHistoryItem';
|
|
7
13
|
export const SwapHistoryPage = () => {
|
|
14
|
+
const { t } = useTranslation();
|
|
8
15
|
const { account } = useWallet();
|
|
9
16
|
const swaps = useSwapHistory(account.address);
|
|
17
|
+
const deleteRoutes = useRouteStore((store) => store.deleteRoutes);
|
|
18
|
+
const setHeaderAction = useSetHeaderAction();
|
|
19
|
+
const [open, setOpen] = useState(false);
|
|
20
|
+
const toggleDialog = useCallback(() => {
|
|
21
|
+
setOpen((open) => !open);
|
|
22
|
+
}, []);
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
return setHeaderAction(_jsx(IconButton, Object.assign({ size: "medium", "aria-label": "settings", edge: "end", onClick: toggleDialog }, { children: _jsx(DeleteIcon, {}) })));
|
|
25
|
+
}, [setHeaderAction, toggleDialog]);
|
|
10
26
|
if (!swaps.length) {
|
|
11
27
|
return _jsx(SwapHistoryEmpty, {});
|
|
12
28
|
}
|
|
13
|
-
return (
|
|
29
|
+
return (_jsxs(Container, { children: [_jsx(Stack, Object.assign({ spacing: 2, mt: 1 }, { children: swaps.length ? (swaps.map(({ route }) => (_jsx(SwapHistoryItem, { route: route }, route.id)))) : (_jsx(SwapHistoryEmpty, {})) })), _jsxs(Dialog, Object.assign({ open: open, onClose: toggleDialog }, { children: [_jsx(DialogTitle, { children: t('swap.warning.title.deleteSwapHistory') }), _jsx(DialogContent, { children: _jsx(DialogContentText, { children: t('swap.warning.message.deleteSwap') }) }), _jsxs(DialogActions, { children: [_jsx(Button, Object.assign({ onClick: toggleDialog }, { children: t('button.cancel') })), _jsx(Button, Object.assign({ onClick: deleteRoutes, autoFocus: true }, { children: t('button.delete') }))] })] }))] }));
|
|
14
30
|
};
|
package/stores/route/types.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export interface RouteExecutionStore {
|
|
|
5
5
|
updateRoute: (route: Route) => void;
|
|
6
6
|
restartRoute: (routeId: string) => void;
|
|
7
7
|
deleteRoute: (routeId: string) => void;
|
|
8
|
+
deleteRoutes: () => void;
|
|
8
9
|
}
|
|
9
10
|
export declare type RouteExecutionStatus = 'error' | 'idle' | 'loading' | 'success';
|
|
10
11
|
export interface RouteExecution {
|
|
@@ -54,6 +54,9 @@ export const useRouteStore = create()(persist(immer((set) => ({
|
|
|
54
54
|
delete state.routes[routeId];
|
|
55
55
|
}
|
|
56
56
|
}),
|
|
57
|
+
deleteRoutes: () => set((state) => {
|
|
58
|
+
state.routes = {};
|
|
59
|
+
}),
|
|
57
60
|
})), {
|
|
58
61
|
name: 'li.fi-widget-routes',
|
|
59
62
|
partialize: (state) => ({ routes: state.routes }),
|