@rango-dev/widget-embedded 0.23.1-next.9 → 0.24.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/dist/components/AppRouter.d.ts +1 -6
- package/dist/components/AppRouter.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts +1 -283
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.d.ts.map +1 -1
- package/dist/components/HeaderButtons/HeaderButtons.d.ts.map +1 -1
- package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts +489 -1
- package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts.map +1 -1
- package/dist/components/HeaderButtons/InProgressTransactionBadge.d.ts +4 -0
- package/dist/components/HeaderButtons/InProgressTransactionBadge.d.ts.map +1 -0
- package/dist/components/HeaderButtons/RefreshButton.d.ts.map +1 -1
- package/dist/components/HeaderButtons/UnreadNotificationsBadge.d.ts.map +1 -1
- package/dist/components/HeaderButtons/WalletButton.d.ts.map +1 -1
- package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.d.ts +1 -1
- package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.d.ts.map +1 -1
- package/dist/components/NoResult/NoResult.d.ts.map +1 -1
- package/dist/components/NoResult/NoResult.helpers.d.ts +8 -0
- package/dist/components/NoResult/NoResult.helpers.d.ts.map +1 -1
- package/dist/components/NoResult/NoResult.styles.d.ts +167 -1
- package/dist/components/NoResult/NoResult.styles.d.ts.map +1 -1
- package/dist/components/NoResult/NoResult.types.d.ts +1 -0
- package/dist/components/NoResult/NoResult.types.d.ts.map +1 -1
- package/dist/components/NotificationContent/NotificationContent.d.ts.map +1 -1
- package/dist/components/NotificationContent/NotificationContent.styles.d.ts +165 -0
- package/dist/components/NotificationContent/NotificationContent.styles.d.ts.map +1 -1
- package/dist/components/Quote/Quote.d.ts.map +1 -1
- package/dist/components/Quote/Quote.styles.d.ts.map +1 -1
- package/dist/components/Quote/Quote.types.d.ts +1 -0
- package/dist/components/Quote/Quote.types.d.ts.map +1 -1
- package/dist/components/Quote/QuoteTrigger.d.ts.map +1 -1
- package/dist/components/QuoteSkeleton/QuoteSkeleton.styles.d.ts +1 -0
- package/dist/components/QuoteSkeleton/QuoteSkeleton.styles.d.ts.map +1 -1
- package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.d.ts.map +1 -1
- package/dist/components/QuoteSkeleton/StepSkeleton.styles.d.ts +3 -1
- package/dist/components/QuoteSkeleton/StepSkeleton.styles.d.ts.map +1 -1
- package/dist/components/Quotes/Quotes.d.ts.map +1 -1
- package/dist/components/Quotes/Quotes.types.d.ts +1 -0
- package/dist/components/Quotes/Quotes.types.d.ts.map +1 -1
- package/dist/components/Quotes/SelectStrategy.d.ts.map +1 -1
- package/dist/components/Slippage/Slippage.d.ts.map +1 -1
- package/dist/components/SwapDetails/SwapDetails.d.ts.map +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.WalletState.d.ts.map +1 -1
- package/dist/components/TokenList/TokenList.d.ts.map +1 -1
- package/dist/constants/index.d.ts +1 -1
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/languages.d.ts.map +1 -1
- package/dist/constants/quote.d.ts +1 -5
- package/dist/constants/quote.d.ts.map +1 -1
- package/dist/constants/searchFor.d.ts +7 -0
- package/dist/constants/searchFor.d.ts.map +1 -0
- package/dist/containers/App/App.d.ts.map +1 -1
- package/dist/containers/App/App.styles.d.ts.map +1 -1
- package/dist/containers/ExpandedQuotes/ExpandedQuotes.d.ts.map +1 -1
- package/dist/containers/ExpandedQuotes/ExpandedQuotes.styles.d.ts +3 -1
- package/dist/containers/ExpandedQuotes/ExpandedQuotes.styles.d.ts.map +1 -1
- package/dist/containers/Inputs/Inputs.d.ts.map +1 -1
- package/dist/containers/Inputs/Inputs.types.d.ts +1 -0
- package/dist/containers/Inputs/Inputs.types.d.ts.map +1 -1
- package/dist/containers/QuoteInfo/QuoteInfo.d.ts.map +1 -1
- package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts +1 -0
- package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts.map +1 -1
- package/dist/containers/Settings/Lists.d.ts.map +1 -1
- package/dist/containers/Wallets/Wallets.d.ts.map +1 -1
- package/dist/containers/Wallets/Wallets.types.d.ts +13 -2
- package/dist/containers/Wallets/Wallets.types.d.ts.map +1 -1
- package/dist/containers/Widget/Widget.d.ts.map +1 -1
- package/dist/hooks/useBootstrap/index.d.ts +2 -0
- package/dist/hooks/useBootstrap/index.d.ts.map +1 -0
- package/dist/hooks/useBootstrap/useBootstrap.d.ts +2 -0
- package/dist/hooks/useBootstrap/useBootstrap.d.ts.map +1 -0
- package/dist/hooks/useScreenDetect.d.ts +9 -0
- package/dist/hooks/useScreenDetect.d.ts.map +1 -0
- package/dist/hooks/useSwapInput.d.ts.map +1 -1
- package/dist/hooks/useTheme.d.ts.map +1 -1
- package/dist/hooks/useWalletList.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +4 -4
- package/dist/pages/ConfirmSwapPage.d.ts.map +1 -1
- package/dist/pages/Home.d.ts.map +1 -1
- package/dist/pages/LanguagePage.d.ts.map +1 -1
- package/dist/pages/LiquiditySourcePage.d.ts.map +1 -1
- package/dist/pages/SelectSwapItemsPage.d.ts.map +1 -1
- package/dist/pages/SettingsPage.d.ts.map +1 -1
- package/dist/store/AppStore.d.ts +2 -2
- package/dist/store/app.d.ts +2 -2
- package/dist/store/slices/config.d.ts.map +1 -1
- package/dist/store/slices/data.d.ts +3 -1
- package/dist/store/slices/data.d.ts.map +1 -1
- package/dist/store/slices/settings.d.ts.map +1 -1
- package/dist/types/config.d.ts +9 -5
- package/dist/types/config.d.ts.map +1 -1
- package/dist/utils/colors.d.ts +5 -3
- package/dist/utils/colors.d.ts.map +1 -1
- package/dist/utils/common.d.ts +4 -0
- package/dist/utils/common.d.ts.map +1 -1
- package/dist/utils/configs.d.ts +2 -1
- package/dist/utils/configs.d.ts.map +1 -1
- package/dist/utils/meta.d.ts +1 -0
- package/dist/utils/meta.d.ts.map +1 -1
- package/dist/utils/swap.d.ts +2 -0
- package/dist/utils/swap.d.ts.map +1 -1
- package/dist/utils/ui.d.ts +5 -2
- package/dist/utils/ui.d.ts.map +1 -1
- package/dist/utils/wallets.d.ts +1 -1
- package/dist/utils/wallets.d.ts.map +1 -1
- package/package.json +7 -6
- package/src/components/AppRouter.tsx +1 -29
- package/src/components/ConfirmWalletsModal/ConfirmWallets.styles.ts +6 -12
- package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +7 -11
- package/src/components/ConfirmWalletsModal/WalletList.tsx +2 -2
- package/src/components/HeaderButtons/HeaderButtons.styles.ts +43 -2
- package/src/components/HeaderButtons/HeaderButtons.tsx +2 -0
- package/src/components/HeaderButtons/InProgressTransactionBadge.tsx +26 -0
- package/src/components/HeaderButtons/RefreshButton.tsx +2 -1
- package/src/components/HeaderButtons/UnreadNotificationsBadge.tsx +10 -2
- package/src/components/HeaderButtons/WalletButton.tsx +26 -6
- package/src/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.ts +1 -1
- package/src/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.tsx +4 -4
- package/src/components/NoResult/NoResult.helpers.ts +13 -0
- package/src/components/NoResult/NoResult.styles.ts +19 -1
- package/src/components/NoResult/NoResult.tsx +27 -16
- package/src/components/NoResult/NoResult.types.ts +1 -0
- package/src/components/NotificationContent/NotificationContent.styles.ts +14 -1
- package/src/components/NotificationContent/NotificationContent.tsx +49 -39
- package/src/components/Quote/Quote.styles.ts +13 -14
- package/src/components/Quote/Quote.tsx +166 -145
- package/src/components/Quote/Quote.types.ts +1 -0
- package/src/components/Quote/QuoteTrigger.tsx +19 -14
- package/src/components/QuoteSkeleton/QuoteSkeleton.styles.ts +10 -2
- package/src/components/QuoteSkeleton/QuoteSkeleton.tsx +2 -2
- package/src/components/QuoteSkeleton/QuoteSummarySkeleton.styles.ts +2 -2
- package/src/components/QuoteSkeleton/QuoteSummarySkeleton.tsx +5 -4
- package/src/components/QuoteSkeleton/StepSkeleton.styles.ts +7 -0
- package/src/components/QuoteSkeleton/StepSkeleton.tsx +1 -1
- package/src/components/QuoteWarningsAndErrors/HighValueLossWarningModal.tsx +1 -1
- package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.helpers.ts +3 -3
- package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.ts +1 -1
- package/src/components/Quotes/Quotes.tsx +33 -21
- package/src/components/Quotes/Quotes.types.ts +1 -0
- package/src/components/Quotes/SelectStrategy.tsx +27 -10
- package/src/components/Slippage/Slippage.tsx +11 -13
- package/src/components/SwapDetails/SwapDetails.tsx +3 -1
- package/src/components/SwapDetailsModal/SwapDetailsModal.WalletState.tsx +5 -1
- package/src/components/TokenList/TokenList.tsx +9 -8
- package/src/constants/errors.ts +1 -1
- package/src/constants/index.ts +1 -1
- package/src/constants/languages.ts +27 -1
- package/src/constants/quote.ts +1 -24
- package/src/constants/searchFor.ts +6 -0
- package/src/containers/App/App.styles.ts +0 -4
- package/src/containers/App/App.tsx +4 -28
- package/src/containers/ExpandedQuotes/ExpandedQuotes.styles.ts +13 -0
- package/src/containers/ExpandedQuotes/ExpandedQuotes.tsx +5 -0
- package/src/containers/Inputs/Inputs.tsx +2 -3
- package/src/containers/Inputs/Inputs.types.ts +1 -0
- package/src/containers/QuoteInfo/QuoteInfo.tsx +2 -0
- package/src/containers/QuoteInfo/QuoteInfo.types.ts +1 -0
- package/src/containers/Settings/Lists.tsx +28 -13
- package/src/containers/Wallets/Wallets.tsx +27 -10
- package/src/containers/Wallets/Wallets.types.ts +13 -2
- package/src/containers/Widget/Widget.tsx +13 -13
- package/src/hooks/useBootstrap/index.ts +1 -0
- package/src/hooks/useBootstrap/useBootstrap.ts +72 -0
- package/src/hooks/useScreenDetect.ts +49 -0
- package/src/hooks/useSwapInput.ts +7 -2
- package/src/hooks/useTheme.ts +1 -8
- package/src/hooks/useWalletList.ts +12 -0
- package/src/pages/ConfirmSwapPage.tsx +14 -5
- package/src/pages/Home.tsx +29 -7
- package/src/pages/LanguagePage.tsx +14 -1
- package/src/pages/LiquiditySourcePage.tsx +4 -3
- package/src/pages/SelectSwapItemsPage.tsx +2 -7
- package/src/pages/SettingsPage.tsx +0 -1
- package/src/store/slices/config.ts +3 -2
- package/src/store/slices/data.ts +82 -34
- package/src/store/slices/settings.ts +10 -4
- package/src/types/config.ts +9 -5
- package/src/utils/colors.ts +106 -75
- package/src/utils/common.ts +181 -0
- package/src/utils/configs.ts +12 -1
- package/src/utils/meta.ts +21 -0
- package/src/utils/swap.ts +12 -5
- package/src/utils/ui.ts +7 -5
- package/src/utils/wallets.ts +5 -47
- package/dist/hooks/useMobileDetect.d.ts +0 -3
- package/dist/hooks/useMobileDetect.d.ts.map +0 -1
- package/src/hooks/useMobileDetect.ts +0 -21
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { PendingSwap } from 'rango-types';
|
|
2
|
+
|
|
3
|
+
import { useManager } from '@rango-dev/queue-manager-react';
|
|
4
|
+
import { InProgressIcon } from '@rango-dev/ui';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { getPendingSwaps } from '../../utils/queue';
|
|
8
|
+
|
|
9
|
+
import { InProgressTransactionBadgeContainer } from './HeaderButtons.styles';
|
|
10
|
+
|
|
11
|
+
const InProgressTransactionBadge = () => {
|
|
12
|
+
const { manager } = useManager();
|
|
13
|
+
const list: PendingSwap[] = getPendingSwaps(manager).map(({ swap }) => swap);
|
|
14
|
+
|
|
15
|
+
if (!list.find((swap) => swap.status === 'running')) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<InProgressTransactionBadgeContainer>
|
|
21
|
+
<InProgressIcon color="info" size={6} />
|
|
22
|
+
</InProgressTransactionBadgeContainer>
|
|
23
|
+
);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export default InProgressTransactionBadge;
|
|
@@ -63,13 +63,14 @@ function RefreshButton({ onClick }: { onClick: (() => void) | undefined }) {
|
|
|
63
63
|
<HeaderButton
|
|
64
64
|
variant="ghost"
|
|
65
65
|
size="small"
|
|
66
|
+
style={{ paddingTop: 0, paddingBottom: 0 }}
|
|
66
67
|
onClick={handleRefreshClick}
|
|
67
68
|
disabled={!onClick}>
|
|
68
69
|
<ProgressIcon
|
|
69
70
|
onTransitionEnd={() => setIsRefetched(false)}
|
|
70
71
|
isRefetched={isRefetched}>
|
|
71
72
|
<RefreshProgressButton
|
|
72
|
-
size={
|
|
73
|
+
size={22}
|
|
73
74
|
color={!onClick ? 'gray' : 'black'}
|
|
74
75
|
progress={(elapsedTime / MAX_ELAPSED_TIME) * MAX_PERCENTAGE}
|
|
75
76
|
/>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { EventSeverity } from '@rango-dev/queue-manager-rango-preset';
|
|
1
2
|
import { Typography } from '@rango-dev/ui';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
|
|
@@ -8,10 +9,17 @@ import { NotificationsBadgeContainer } from './HeaderButtons.styles';
|
|
|
8
9
|
export function UnreadNotificationsBadge() {
|
|
9
10
|
const { getUnreadNotifications } = useNotificationStore();
|
|
10
11
|
|
|
11
|
-
const
|
|
12
|
+
const notificationsList = getUnreadNotifications();
|
|
13
|
+
|
|
14
|
+
const notificationsCount = notificationsList.length;
|
|
15
|
+
|
|
16
|
+
const hasSeverNotification = !!notificationsList.find(
|
|
17
|
+
(notificationItem) =>
|
|
18
|
+
notificationItem.event.messageSeverity === EventSeverity.WARNING
|
|
19
|
+
);
|
|
12
20
|
|
|
13
21
|
return notificationsCount ? (
|
|
14
|
-
<NotificationsBadgeContainer>
|
|
22
|
+
<NotificationsBadgeContainer isSever={hasSeverNotification}>
|
|
15
23
|
<Typography variant="body" size="xsmall" color="$background">
|
|
16
24
|
{notificationsCount}
|
|
17
25
|
</Typography>
|
|
@@ -1,17 +1,37 @@
|
|
|
1
1
|
import type { PropTypes } from './HeaderButtons.types';
|
|
2
2
|
|
|
3
3
|
import { i18n } from '@lingui/core';
|
|
4
|
-
import { Tooltip, WalletIcon } from '@rango-dev/ui';
|
|
4
|
+
import { Image, Tooltip, WalletIcon } from '@rango-dev/ui';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { useWalletList } from '../../hooks/useWalletList';
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
ConnectedIcon,
|
|
11
|
+
HeaderButton,
|
|
12
|
+
rowStyles,
|
|
13
|
+
WalletImageContainer,
|
|
14
|
+
} from './HeaderButtons.styles';
|
|
8
15
|
|
|
9
16
|
function WalletButton(props: PropTypes) {
|
|
17
|
+
const { list } = useWalletList({});
|
|
18
|
+
const connectedWallets = list.filter(
|
|
19
|
+
(wallet) => wallet.state === 'connected'
|
|
20
|
+
);
|
|
21
|
+
const content = !connectedWallets.length ? (
|
|
22
|
+
i18n.t('Connect Wallet')
|
|
23
|
+
) : (
|
|
24
|
+
<div className={rowStyles()}>
|
|
25
|
+
{connectedWallets.map((wallet) => (
|
|
26
|
+
<WalletImageContainer key={wallet.title}>
|
|
27
|
+
<Image src={wallet.image} size={14} />
|
|
28
|
+
</WalletImageContainer>
|
|
29
|
+
))}
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
32
|
+
|
|
10
33
|
return (
|
|
11
|
-
<Tooltip
|
|
12
|
-
container={props.container}
|
|
13
|
-
side="top"
|
|
14
|
-
content={i18n.t('Connect Wallet')}>
|
|
34
|
+
<Tooltip container={props.container} side="bottom" content={content}>
|
|
15
35
|
<HeaderButton variant="ghost" size="small" onClick={props.onClick}>
|
|
16
36
|
{props.isConnected && <ConnectedIcon />}
|
|
17
37
|
<WalletIcon size={18} color="black" />
|
|
@@ -3,16 +3,16 @@ import React from 'react';
|
|
|
3
3
|
|
|
4
4
|
import { LiquiditySourceList } from '../SettingsContainer';
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { CustomListItem } from './LoadingLiquiditySourceList.styles';
|
|
7
7
|
|
|
8
8
|
const ITEM_SKELETON_COUNT = 30;
|
|
9
9
|
export function LoadingLiquiditySourceList() {
|
|
10
10
|
return (
|
|
11
11
|
<LiquiditySourceList>
|
|
12
|
-
{Array.from(Array(ITEM_SKELETON_COUNT), (
|
|
13
|
-
<
|
|
12
|
+
{Array.from(Array(ITEM_SKELETON_COUNT), (_, index) => (
|
|
13
|
+
<CustomListItem
|
|
14
14
|
hasDivider
|
|
15
|
-
key={
|
|
15
|
+
key={index}
|
|
16
16
|
start={<Skeleton variant="circular" width={35} height={35} />}
|
|
17
17
|
title={<Skeleton variant="text" size="large" width={90} />}
|
|
18
18
|
end={<Checkbox checked={false} />}
|
|
@@ -9,6 +9,9 @@ import {
|
|
|
9
9
|
type QuoteRequestFailed,
|
|
10
10
|
} from '../../types';
|
|
11
11
|
|
|
12
|
+
const SMALL_NO_ROUTE__ICON_SIZE = 24;
|
|
13
|
+
const LARGE_NO_ROUTE_ICON_SIZE = 60;
|
|
14
|
+
|
|
12
15
|
export function makeInfo(
|
|
13
16
|
error: NoResultError | QuoteRequestFailed | null,
|
|
14
17
|
disabledLiquiditySources: string[],
|
|
@@ -57,3 +60,13 @@ export function makeInfo(
|
|
|
57
60
|
description: errorMessages().noResultError.description,
|
|
58
61
|
};
|
|
59
62
|
}
|
|
63
|
+
|
|
64
|
+
export enum NoRouteIconSize {
|
|
65
|
+
small = SMALL_NO_ROUTE__ICON_SIZE,
|
|
66
|
+
large = LARGE_NO_ROUTE_ICON_SIZE,
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export enum NoRouteTitleSize {
|
|
70
|
+
small = 'small',
|
|
71
|
+
large = 'medium',
|
|
72
|
+
}
|
|
@@ -6,8 +6,26 @@ export const Container = styled('div', {
|
|
|
6
6
|
alignItems: 'center',
|
|
7
7
|
});
|
|
8
8
|
|
|
9
|
+
export const ErrorDescription = styled('div', {
|
|
10
|
+
variants: {
|
|
11
|
+
size: {
|
|
12
|
+
small: {},
|
|
13
|
+
large: {
|
|
14
|
+
maxWidth: '316px',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
|
|
9
20
|
export const Footer = styled('div', {
|
|
10
|
-
|
|
21
|
+
variants: {
|
|
22
|
+
size: {
|
|
23
|
+
small: {
|
|
24
|
+
width: '100%',
|
|
25
|
+
},
|
|
26
|
+
large: {},
|
|
27
|
+
},
|
|
28
|
+
},
|
|
11
29
|
});
|
|
12
30
|
|
|
13
31
|
export const PrefixIcon = styled('div', {
|
|
@@ -13,16 +13,24 @@ import React from 'react';
|
|
|
13
13
|
import { errorMessages } from '../../constants/errors';
|
|
14
14
|
import { useAppStore } from '../../store/AppStore';
|
|
15
15
|
|
|
16
|
-
import {
|
|
17
|
-
|
|
16
|
+
import {
|
|
17
|
+
makeInfo,
|
|
18
|
+
NoRouteIconSize,
|
|
19
|
+
NoRouteTitleSize,
|
|
20
|
+
} from './NoResult.helpers';
|
|
21
|
+
import {
|
|
22
|
+
Container,
|
|
23
|
+
ErrorDescription,
|
|
24
|
+
Footer,
|
|
25
|
+
PrefixIcon,
|
|
26
|
+
} from './NoResult.styles';
|
|
18
27
|
|
|
19
28
|
export function NoResult(props: PropTypes) {
|
|
20
|
-
const { fetch, error } = props;
|
|
29
|
+
const { fetch, error, size = 'small' } = props;
|
|
21
30
|
const disabledLiquiditySources = useAppStore().getDisabledLiquiditySources();
|
|
22
31
|
const toggleAllLiquiditySources = useAppStore().toggleAllLiquiditySources;
|
|
23
32
|
|
|
24
33
|
const swappers = useAppStore().swappers();
|
|
25
|
-
|
|
26
34
|
const info = makeInfo(
|
|
27
35
|
error,
|
|
28
36
|
disabledLiquiditySources,
|
|
@@ -32,27 +40,30 @@ export function NoResult(props: PropTypes) {
|
|
|
32
40
|
|
|
33
41
|
return (
|
|
34
42
|
<Container>
|
|
35
|
-
<NoRouteIcon size={
|
|
43
|
+
<NoRouteIcon size={NoRouteIconSize[size]} color="gray" />
|
|
36
44
|
<Divider size={4} />
|
|
37
|
-
<Typography variant="title" size=
|
|
45
|
+
<Typography variant="title" size={NoRouteTitleSize[size]}>
|
|
38
46
|
{errorMessages().noResultError.title}
|
|
39
47
|
</Typography>
|
|
48
|
+
{size === 'large' && <Divider size={4} />}
|
|
40
49
|
{!!info.description && (
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
50
|
+
<ErrorDescription size={size}>
|
|
51
|
+
<Typography
|
|
52
|
+
variant="body"
|
|
53
|
+
size="small"
|
|
54
|
+
align="center"
|
|
55
|
+
color="neutral700">
|
|
56
|
+
{info.description}
|
|
57
|
+
</Typography>
|
|
58
|
+
</ErrorDescription>
|
|
48
59
|
)}
|
|
49
|
-
<Divider size={4} />
|
|
60
|
+
<Divider size={size === 'large' ? '24' : '4'} />
|
|
50
61
|
{!!info.alert && (
|
|
51
|
-
<Footer>
|
|
62
|
+
<Footer size={size}>
|
|
52
63
|
<Alert
|
|
53
64
|
type={info.alert.type}
|
|
54
65
|
title={info.alert.text}
|
|
55
|
-
titleAlign={'
|
|
66
|
+
titleAlign={'left'}
|
|
56
67
|
action={
|
|
57
68
|
info.alert.action && (
|
|
58
69
|
<Button
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { styled } from '@rango-dev/ui';
|
|
1
|
+
import { darkTheme, ListItemButton, styled } from '@rango-dev/ui';
|
|
2
2
|
|
|
3
3
|
export const Container = styled('div', {
|
|
4
4
|
padding: '$10',
|
|
@@ -17,6 +17,19 @@ export const List = styled('ul', {
|
|
|
17
17
|
},
|
|
18
18
|
});
|
|
19
19
|
|
|
20
|
+
export const ListItem = styled(ListItemButton, {
|
|
21
|
+
variants: {
|
|
22
|
+
actionRequired: {
|
|
23
|
+
true: {
|
|
24
|
+
backgroundColor: '$error300',
|
|
25
|
+
[`.${darkTheme} &`]: {
|
|
26
|
+
backgroundColor: '$error600',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
|
|
20
33
|
export const Images = styled('div', {
|
|
21
34
|
display: 'flex',
|
|
22
35
|
padding: 0,
|
|
@@ -5,7 +5,7 @@ import { EventSeverity } from '@rango-dev/queue-manager-rango-preset';
|
|
|
5
5
|
import {
|
|
6
6
|
ChainToken,
|
|
7
7
|
ChevronRightIcon,
|
|
8
|
-
|
|
8
|
+
Divider,
|
|
9
9
|
Typography,
|
|
10
10
|
} from '@rango-dev/ui';
|
|
11
11
|
import React from 'react';
|
|
@@ -16,7 +16,12 @@ import { useAppStore } from '../../store/AppStore';
|
|
|
16
16
|
import { useNotificationStore } from '../../store/notification';
|
|
17
17
|
import { areTokensEqual } from '../../utils/wallets';
|
|
18
18
|
|
|
19
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
Container,
|
|
21
|
+
Images,
|
|
22
|
+
List,
|
|
23
|
+
ListItem,
|
|
24
|
+
} from './NotificationContent.styles';
|
|
20
25
|
import { NotificationNotFound } from './NotificationNotFound';
|
|
21
26
|
|
|
22
27
|
const MAX_NOTIFICATIONS_DISPLAYED = 4;
|
|
@@ -41,7 +46,7 @@ export function NotificationContent() {
|
|
|
41
46
|
<Container>
|
|
42
47
|
{sortedNotification.length ? (
|
|
43
48
|
<List>
|
|
44
|
-
{sortedNotification.map((notificationItem) => {
|
|
49
|
+
{sortedNotification.map((notificationItem, index) => {
|
|
45
50
|
const { route, requestId, event } = notificationItem;
|
|
46
51
|
const fromToken = tokens.find((tokenItem) =>
|
|
47
52
|
areTokensEqual(tokenItem, route.from)
|
|
@@ -60,42 +65,47 @@ export function NotificationContent() {
|
|
|
60
65
|
);
|
|
61
66
|
|
|
62
67
|
return (
|
|
63
|
-
<
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
68
|
+
<React.Fragment key={requestId}>
|
|
69
|
+
{index > 0 && <Divider size={4} />}
|
|
70
|
+
<ListItem
|
|
71
|
+
onClick={() => handleOnClick(requestId)}
|
|
72
|
+
actionRequired={
|
|
73
|
+
event.messageSeverity === EventSeverity.WARNING
|
|
74
|
+
}
|
|
75
|
+
title={
|
|
76
|
+
<Typography
|
|
77
|
+
variant="body"
|
|
78
|
+
size="small"
|
|
79
|
+
color={
|
|
80
|
+
event.messageSeverity === EventSeverity.WARNING
|
|
81
|
+
? '$foreground'
|
|
82
|
+
: '$neutral700'
|
|
83
|
+
}>
|
|
84
|
+
{i18n.t(event.message)}
|
|
85
|
+
</Typography>
|
|
86
|
+
}
|
|
87
|
+
id={requestId}
|
|
88
|
+
start={
|
|
89
|
+
<Images>
|
|
90
|
+
<div className="from-chain-token">
|
|
91
|
+
<ChainToken
|
|
92
|
+
tokenImage={fromToken ? fromToken.image : ''}
|
|
93
|
+
chainImage={fromBlockchain ? fromBlockchain.logo : ''}
|
|
94
|
+
size="small"
|
|
95
|
+
/>
|
|
96
|
+
</div>
|
|
97
|
+
<div className="to-chain-token">
|
|
98
|
+
<ChainToken
|
|
99
|
+
tokenImage={toToken ? toToken.image : ''}
|
|
100
|
+
chainImage={toBlockchain ? toBlockchain.logo : ''}
|
|
101
|
+
size="small"
|
|
102
|
+
/>
|
|
103
|
+
</div>
|
|
104
|
+
</Images>
|
|
105
|
+
}
|
|
106
|
+
end={<ChevronRightIcon size={12} color="gray" />}
|
|
107
|
+
/>
|
|
108
|
+
</React.Fragment>
|
|
99
109
|
);
|
|
100
110
|
})}
|
|
101
111
|
</List>
|
|
@@ -55,19 +55,6 @@ export const QuoteContainer = styled(Collapsible.Root, {
|
|
|
55
55
|
backgroundColor: '$$color',
|
|
56
56
|
},
|
|
57
57
|
},
|
|
58
|
-
{
|
|
59
|
-
listItem: true,
|
|
60
|
-
selected: false,
|
|
61
|
-
css: {
|
|
62
|
-
cursor: 'pointer',
|
|
63
|
-
'&:hover': {
|
|
64
|
-
backgroundColor: '$neutral300',
|
|
65
|
-
[`.${darkTheme} &`]: {
|
|
66
|
-
backgroundColor: '$neutral400',
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
58
|
],
|
|
72
59
|
});
|
|
73
60
|
|
|
@@ -107,6 +94,18 @@ export const SummaryContainer = styled('div', {
|
|
|
107
94
|
},
|
|
108
95
|
backgroundColor: '$$color',
|
|
109
96
|
'&:hover': {
|
|
97
|
+
'& .quote_container': {
|
|
98
|
+
'& button': {
|
|
99
|
+
backgroundColor: '$neutral500',
|
|
100
|
+
[`.${darkTheme} &`]: {
|
|
101
|
+
backgroundColor: '$neutral200',
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
backgroundColor: '$neutral500',
|
|
105
|
+
[`.${darkTheme} &`]: {
|
|
106
|
+
backgroundColor: '$neutral200',
|
|
107
|
+
},
|
|
108
|
+
},
|
|
110
109
|
backgroundColor: '$neutral300',
|
|
111
110
|
[`.${darkTheme} &`]: {
|
|
112
111
|
backgroundColor: '$neutral400',
|
|
@@ -376,6 +375,6 @@ export const Line = styled('div', {
|
|
|
376
375
|
borderTopColor: '$neutral',
|
|
377
376
|
margin: '$5 0',
|
|
378
377
|
[`.${darkTheme} &`]: {
|
|
379
|
-
borderTopColor: '$
|
|
378
|
+
borderTopColor: '$neutral800',
|
|
380
379
|
},
|
|
381
380
|
});
|