@rango-dev/ui 0.23.0 → 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/CHANGELOG.md +1 -86
- package/dist/index.js +6 -6
- package/dist/index.js.map +4 -4
- package/dist/translations/en.d.ts.map +1 -1
- package/dist/translations/es.d.ts.map +1 -1
- package/dist/translations/fr.d.ts.map +1 -1
- package/dist/translations/ja.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Alert/Alert.styles.d.ts +0 -157
- package/dist/widget/ui/src/components/Alert/Alert.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/BestRoute/BestRoute.d.ts +4 -0
- package/dist/widget/ui/src/components/BestRoute/BestRoute.d.ts.map +1 -0
- package/dist/widget/ui/src/components/BestRoute/BestRoute.stories.d.ts +7 -0
- package/dist/widget/ui/src/components/BestRoute/BestRoute.stories.d.ts.map +1 -0
- package/dist/widget/ui/src/components/BestRoute/BestRoute.styles.d.ts +1429 -0
- package/dist/widget/ui/src/components/BestRoute/BestRoute.styles.d.ts.map +1 -0
- package/dist/widget/ui/src/components/BestRoute/BestRoute.types.d.ts +34 -0
- package/dist/widget/ui/src/components/BestRoute/BestRoute.types.d.ts.map +1 -0
- package/dist/widget/ui/src/components/BestRoute/BestRouteSkeleton.d.ts +4 -0
- package/dist/widget/ui/src/components/BestRoute/BestRouteSkeleton.d.ts.map +1 -0
- package/dist/widget/ui/src/components/BestRoute/BestRouteSkeleton.styles.d.ts +319 -0
- package/dist/widget/ui/src/components/BestRoute/BestRouteSkeleton.styles.d.ts.map +1 -0
- package/dist/widget/ui/src/components/BestRoute/BestRouteSkeleton.types.d.ts +6 -0
- package/dist/widget/ui/src/components/BestRoute/BestRouteSkeleton.types.d.ts.map +1 -0
- package/dist/widget/ui/src/components/BestRoute/RouteSummary.d.ts +12 -0
- package/dist/widget/ui/src/components/BestRoute/RouteSummary.d.ts.map +1 -0
- package/dist/widget/ui/src/components/BestRoute/RouteSummary.styles.d.ts +158 -0
- package/dist/widget/ui/src/components/BestRoute/RouteSummary.styles.d.ts.map +1 -0
- package/dist/widget/ui/src/components/BestRoute/index.d.ts +5 -0
- package/dist/widget/ui/src/components/BestRoute/index.d.ts.map +1 -0
- package/dist/widget/ui/src/components/BestRoute/mock.d.ts +3 -0
- package/dist/widget/ui/src/components/BestRoute/mock.d.ts.map +1 -0
- package/dist/widget/ui/src/components/BlockchainsChip/BlockchainsChip.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Button/Button.d.ts +54 -54
- package/dist/widget/ui/src/components/Button/Button.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Checkbox/Checkbox.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/ListItem/ListItem.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/ListItemButton/ListItemButton.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/PriceImpact/PriceImpact.styles.d.ts +0 -158
- package/dist/widget/ui/src/components/PriceImpact/PriceImpact.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Radio/Radio.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/RouteCost/RouteCost.d.ts +4 -0
- package/dist/widget/ui/src/components/RouteCost/RouteCost.d.ts.map +1 -0
- package/dist/widget/ui/src/components/RouteCost/RouteCost.styles.d.ts +158 -0
- package/dist/widget/ui/src/components/RouteCost/RouteCost.styles.d.ts.map +1 -0
- package/dist/widget/ui/src/components/{QuoteCost/QuoteCost.types.d.ts → RouteCost/RouteCost.types.d.ts} +1 -1
- package/dist/widget/ui/src/components/RouteCost/RouteCost.types.d.ts.map +1 -0
- package/dist/widget/ui/src/components/RouteCost/index.d.ts +2 -0
- package/dist/widget/ui/src/components/RouteCost/index.d.ts.map +1 -0
- package/dist/widget/ui/src/components/RoutesOverview/RoutesOverview.d.ts.map +1 -1
- package/dist/widget/ui/src/components/SelectableCategoryList/SelectableCategoryList.d.ts.map +1 -1
- package/dist/widget/ui/src/components/SelectableCategoryList/SelectableCategoryList.helpers.d.ts +2 -16
- package/dist/widget/ui/src/components/SelectableCategoryList/SelectableCategoryList.helpers.d.ts.map +1 -1
- package/dist/widget/ui/src/components/SelectableCategoryList/index.d.ts +0 -1
- package/dist/widget/ui/src/components/SelectableCategoryList/index.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Skeleton/Skeleton.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Skeleton/Skeleton.types.d.ts +1 -1
- package/dist/widget/ui/src/components/Skeleton/Skeleton.types.d.ts.map +1 -1
- package/dist/widget/ui/src/components/StepDetails/StepDetails.d.ts.map +1 -1
- package/dist/widget/ui/src/components/StepDetails/StepDetails.styles.d.ts +1 -7
- package/dist/widget/ui/src/components/StepDetails/StepDetails.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/StepDetails/StepDetails.types.d.ts +2 -16
- package/dist/widget/ui/src/components/StepDetails/StepDetails.types.d.ts.map +1 -1
- package/dist/widget/ui/src/components/StepDetails/index.d.ts +1 -1
- package/dist/widget/ui/src/components/StepDetails/index.d.ts.map +1 -1
- package/dist/widget/ui/src/components/StepDetails/mock.d.ts +1 -1
- package/dist/widget/ui/src/components/StepDetails/mock.d.ts.map +1 -1
- package/dist/widget/ui/src/components/SwapListItem/mock.d.ts +1 -1
- package/dist/widget/ui/src/components/SwapListItem/mock.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Switch/Switch.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/TextField/TextField.d.ts.map +1 -1
- package/dist/widget/ui/src/components/TokenAmount/TokenAmount.d.ts.map +1 -1
- package/dist/widget/ui/src/components/TokenAmount/TokenAmount.styles.d.ts +1 -471
- package/dist/widget/ui/src/components/TokenAmount/TokenAmount.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Tooltip/Tooltip.styles.d.ts +2 -2
- package/dist/widget/ui/src/components/Tooltip/Tooltip.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Wallet/Wallet.types.d.ts +17 -3
- package/dist/widget/ui/src/components/Wallet/Wallet.types.d.ts.map +1 -1
- package/dist/widget/ui/src/components/common/Image.d.ts +0 -157
- package/dist/widget/ui/src/components/common/Image.d.ts.map +1 -1
- package/dist/widget/ui/src/components/common/index.d.ts +1 -1
- package/dist/widget/ui/src/components/common/index.d.ts.map +1 -1
- package/dist/widget/ui/src/components/index.d.ts +2 -1
- package/dist/widget/ui/src/components/index.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/BlockchainSelector/BlockchainSelector.d.ts +3 -3
- package/dist/widget/ui/src/containers/BlockchainSelector/BlockchainSelector.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/History/types.d.ts +2 -0
- package/dist/widget/ui/src/containers/History/types.d.ts.map +1 -0
- package/dist/widget/ui/src/containers/SwapHistory/SwapHistory.d.ts +1 -1
- package/dist/widget/ui/src/containers/SwapHistory/SwapHistory.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/SwapHistory/SwapHistory.stories.d.ts +2 -2
- package/dist/widget/ui/src/containers/SwapHistory/SwapHistory.stories.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/SwapHistory/mock.d.ts +1 -1
- package/dist/widget/ui/src/containers/SwapHistory/mock.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/SwapInput/SwapInput.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/SwapInput/SwapInput.styles.d.ts +54 -1313
- package/dist/widget/ui/src/containers/SwapInput/SwapInput.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/SwapInput/SwapInput.types.d.ts +0 -2
- package/dist/widget/ui/src/containers/SwapInput/SwapInput.types.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/SwapInput/TokenSection.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/SwapInput/TokenSection.styles.d.ts +54 -525
- package/dist/widget/ui/src/containers/SwapInput/TokenSection.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/TokenSelector/TokenSelector.d.ts +2 -2
- package/dist/widget/ui/src/containers/TokenSelector/TokenSelector.d.ts.map +1 -1
- package/dist/widget/ui/src/{utils → helper}/index.d.ts +3 -0
- package/dist/widget/ui/src/helper/index.d.ts.map +1 -0
- package/dist/widget/ui/src/icons/Icons.stories.d.ts +1 -1
- package/dist/widget/ui/src/icons/index.d.ts +0 -5
- package/dist/widget/ui/src/icons/index.d.ts.map +1 -1
- package/dist/widget/ui/src/index.d.ts +1 -0
- package/dist/widget/ui/src/index.d.ts.map +1 -1
- package/dist/widget/ui/src/types/index.d.ts +1 -0
- package/dist/widget/ui/src/types/index.d.ts.map +1 -1
- package/dist/widget/ui/src/types/swaps.d.ts +27 -1
- package/dist/widget/ui/src/types/swaps.d.ts.map +1 -1
- package/package.json +5 -6
- package/src/components/Alert/Alert.styles.ts +12 -9
- package/src/components/Alert/Alert.tsx +2 -2
- package/src/components/BestRoute/BestRoute.stories.tsx +17 -0
- package/src/components/BestRoute/BestRoute.styles.ts +213 -0
- package/src/components/BestRoute/BestRoute.tsx +176 -0
- package/src/components/BestRoute/BestRoute.types.ts +32 -0
- package/src/components/BestRoute/BestRouteSkeleton.styles.ts +110 -0
- package/src/components/BestRoute/BestRouteSkeleton.tsx +112 -0
- package/src/components/BestRoute/BestRouteSkeleton.types.ts +5 -0
- package/src/components/BestRoute/RouteSummary.styles.ts +15 -0
- package/src/components/BestRoute/RouteSummary.tsx +48 -0
- package/src/components/BestRoute/index.ts +4 -0
- package/src/components/BestRoute/mock.ts +142 -0
- package/src/components/BlockchainsChip/BlockchainsChip.styles.ts +1 -2
- package/src/components/Button/Button.styles.tsx +0 -1
- package/src/components/Checkbox/Checkbox.styles.ts +1 -5
- package/src/components/ListItem/ListItem.styles.ts +0 -9
- package/src/components/ListItem/ListItem.tsx +1 -1
- package/src/components/ListItemButton/ListItemButton.styles.ts +0 -1
- package/src/components/PriceImpact/PriceImpact.styles.ts +1 -9
- package/src/components/PriceImpact/PriceImpact.tsx +5 -5
- package/src/components/Radio/Radio.styles.tsx +2 -5
- package/src/components/RouteCost/RouteCost.styles.ts +20 -0
- package/src/components/{QuoteCost/QuoteCost.tsx → RouteCost/RouteCost.tsx} +10 -14
- package/src/components/RouteCost/index.ts +1 -0
- package/src/components/RoutesOverview/RoutesOverview.tsx +2 -6
- package/src/components/SelectableCategoryList/SelectableCategoryList.helpers.ts +13 -40
- package/src/components/SelectableCategoryList/SelectableCategoryList.tsx +46 -47
- package/src/components/SelectableCategoryList/index.ts +0 -1
- package/src/components/SelectableWalletList/SelectableWalletList.tsx +1 -1
- package/src/components/Skeleton/Skeleton.tsx +2 -3
- package/src/components/Skeleton/Skeleton.types.ts +1 -1
- package/src/components/StepDetails/StepDetails.stories.tsx +1 -1
- package/src/components/StepDetails/StepDetails.styles.ts +28 -36
- package/src/components/StepDetails/StepDetails.tsx +7 -11
- package/src/components/StepDetails/StepDetails.types.ts +2 -17
- package/src/components/StepDetails/index.ts +1 -1
- package/src/components/StepDetails/mock.ts +1 -1
- package/src/components/SvgIcon/SvgIcon.style.ts +1 -1
- package/src/components/SwapListItem/mock.ts +6 -21
- package/src/components/Switch/Switch.styles.tsx +6 -8
- package/src/components/TextField/TextField.tsx +5 -3
- package/src/components/TokenAmount/TokenAmount.styles.ts +10 -12
- package/src/components/TokenAmount/TokenAmount.tsx +17 -23
- package/src/components/Tooltip/Tooltip.styles.ts +5 -8
- package/src/components/Tooltip/Tooltip.tsx +3 -2
- package/src/components/Wallet/Wallet.styles.ts +1 -1
- package/src/components/Wallet/Wallet.types.ts +23 -3
- package/src/components/common/Image.tsx +2 -1
- package/src/components/common/index.ts +1 -1
- package/src/components/index.ts +2 -1
- package/src/containers/BlockchainSelector/BlockchainSelector.tsx +8 -9
- package/src/containers/History/types.tsx +1 -0
- package/src/containers/SwapHistory/SwapHistory.stories.tsx +2 -5
- package/src/containers/SwapHistory/SwapHistory.tsx +1 -1
- package/src/containers/SwapHistory/mock.ts +8 -24
- package/src/containers/SwapInput/SwapInput.styles.ts +27 -78
- package/src/containers/SwapInput/SwapInput.tsx +29 -37
- package/src/containers/SwapInput/SwapInput.types.ts +0 -2
- package/src/containers/SwapInput/TokenSection.styles.ts +12 -27
- package/src/containers/SwapInput/TokenSection.tsx +6 -15
- package/src/containers/TokenSelector/TokenSelector.tsx +10 -8
- package/src/helper/index.ts +99 -0
- package/src/icons/index.ts +0 -5
- package/src/index.ts +1 -0
- package/src/theme.ts +4 -4
- package/src/types/index.ts +1 -0
- package/src/types/swaps.ts +38 -0
- package/dist/widget/ui/src/components/QuoteCost/QuoteCost.d.ts +0 -4
- package/dist/widget/ui/src/components/QuoteCost/QuoteCost.d.ts.map +0 -1
- package/dist/widget/ui/src/components/QuoteCost/QuoteCost.styles.d.ts +0 -629
- package/dist/widget/ui/src/components/QuoteCost/QuoteCost.styles.d.ts.map +0 -1
- package/dist/widget/ui/src/components/QuoteCost/QuoteCost.types.d.ts.map +0 -1
- package/dist/widget/ui/src/components/QuoteCost/index.d.ts +0 -2
- package/dist/widget/ui/src/components/QuoteCost/index.d.ts.map +0 -1
- package/dist/widget/ui/src/icons/CosmosCategory.d.ts +0 -5
- package/dist/widget/ui/src/icons/CosmosCategory.d.ts.map +0 -1
- package/dist/widget/ui/src/icons/EvmCategory.d.ts +0 -5
- package/dist/widget/ui/src/icons/EvmCategory.d.ts.map +0 -1
- package/dist/widget/ui/src/icons/Language.d.ts +0 -5
- package/dist/widget/ui/src/icons/Language.d.ts.map +0 -1
- package/dist/widget/ui/src/icons/OtherCategory.d.ts +0 -5
- package/dist/widget/ui/src/icons/OtherCategory.d.ts.map +0 -1
- package/dist/widget/ui/src/icons/UtxoCategory.d.ts +0 -5
- package/dist/widget/ui/src/icons/UtxoCategory.d.ts.map +0 -1
- package/dist/widget/ui/src/utils/index.d.ts.map +0 -1
- package/src/components/QuoteCost/QuoteCost.styles.ts +0 -29
- package/src/components/QuoteCost/index.ts +0 -1
- package/src/icons/CosmosCategory.tsx +0 -137
- package/src/icons/EvmCategory.tsx +0 -74
- package/src/icons/Language.tsx +0 -55
- package/src/icons/OtherCategory.tsx +0 -72
- package/src/icons/UtxoCategory.tsx +0 -44
- package/src/utils/index.ts +0 -23
- /package/src/components/{QuoteCost/QuoteCost.types.ts → RouteCost/RouteCost.types.ts} +0 -0
|
@@ -2,7 +2,7 @@ import type { BestRouteResponse } from 'rango-sdk';
|
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { styled } from '../../theme';
|
|
6
6
|
import { Divider } from '../Divider';
|
|
7
7
|
import { AngleRightIcon, GasIcon } from '../Icon';
|
|
8
8
|
|
|
@@ -13,11 +13,7 @@ export const Container = styled('div', {
|
|
|
13
13
|
padding: '$8',
|
|
14
14
|
borderRadius: '$xs',
|
|
15
15
|
backgroundColor: '$background',
|
|
16
|
-
|
|
17
|
-
[`.${darkTheme} &`]: {
|
|
18
|
-
$$color: '$colors$neutral700',
|
|
19
|
-
},
|
|
20
|
-
color: '$$color',
|
|
16
|
+
color: '$neutral600',
|
|
21
17
|
fontSize: '$12',
|
|
22
18
|
|
|
23
19
|
'.routes': {
|
|
@@ -1,29 +1,7 @@
|
|
|
1
1
|
import { type BlockchainMeta, TransactionType } from 'rango-sdk';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
CosmosCategoryIcon,
|
|
5
|
-
EvmCategoryIcon,
|
|
6
|
-
OtherCategoryIcon,
|
|
7
|
-
UtxoCategoryIcon,
|
|
8
|
-
} from '../../icons';
|
|
9
|
-
|
|
10
3
|
import { BlockchainCategories } from './SelectableCategoryList.types';
|
|
11
4
|
|
|
12
|
-
export const blockchainCategoryIcons = {
|
|
13
|
-
[BlockchainCategories.EVM]: EvmCategoryIcon,
|
|
14
|
-
[BlockchainCategories.COSMOS]: CosmosCategoryIcon,
|
|
15
|
-
[BlockchainCategories.UTXO]: UtxoCategoryIcon,
|
|
16
|
-
[BlockchainCategories.OTHER]: OtherCategoryIcon,
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export const blockchainCategoryLabel = {
|
|
20
|
-
[BlockchainCategories.ALL]: 'All',
|
|
21
|
-
[BlockchainCategories.EVM]: 'EVM',
|
|
22
|
-
[BlockchainCategories.COSMOS]: 'Cosmos',
|
|
23
|
-
[BlockchainCategories.UTXO]: 'UTXO',
|
|
24
|
-
[BlockchainCategories.OTHER]: 'Other',
|
|
25
|
-
};
|
|
26
|
-
|
|
27
5
|
const filterByType = (blockchain: BlockchainMeta, type: string): boolean => {
|
|
28
6
|
switch (type) {
|
|
29
7
|
case BlockchainCategories.ALL:
|
|
@@ -41,22 +19,17 @@ const filterByType = (blockchain: BlockchainMeta, type: string): boolean => {
|
|
|
41
19
|
}
|
|
42
20
|
};
|
|
43
21
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
export const getCountCategories = (list: BlockchainMeta[]) => {
|
|
50
|
-
const categoriesToCheck = Object.values(BlockchainCategories).filter(
|
|
51
|
-
(category) => category !== BlockchainCategories.ALL
|
|
52
|
-
);
|
|
53
|
-
|
|
54
|
-
const categoriesCount = categoriesToCheck.reduce((count, category) => {
|
|
55
|
-
const isCategoryPresent = list.some((blockchain) =>
|
|
56
|
-
filterByType(blockchain, category)
|
|
57
|
-
);
|
|
58
|
-
return count + (isCategoryPresent ? 1 : 0);
|
|
59
|
-
}, 0);
|
|
60
|
-
|
|
61
|
-
return categoriesCount;
|
|
22
|
+
const blockchainslogo = {
|
|
23
|
+
[BlockchainCategories.EVM]: ['ETH', 'BSC', 'POLYGON'],
|
|
24
|
+
[BlockchainCategories.COSMOS]: ['COSMOS', 'OSMOSIS', 'JUNO'],
|
|
25
|
+
[BlockchainCategories.UTXO]: ['BTC', 'LTC', 'BCH'],
|
|
26
|
+
[BlockchainCategories.OTHER]: ['STARKNET', 'TRON', 'SOLANA'],
|
|
62
27
|
};
|
|
28
|
+
|
|
29
|
+
export const generateBlockchainsLogo = (
|
|
30
|
+
list: BlockchainMeta[],
|
|
31
|
+
type: Exclude<BlockchainCategories, 'ALL'>
|
|
32
|
+
) =>
|
|
33
|
+
list
|
|
34
|
+
.filter((item) => filterByType(item, type))
|
|
35
|
+
.filter((item) => blockchainslogo[type].includes(item.name));
|
|
@@ -4,19 +4,19 @@ import type { PropTypes } from './SelectableCategoryList.types';
|
|
|
4
4
|
import { i18n } from '@lingui/core';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import { Divider, Skeleton, Typography } from '..';
|
|
7
|
+
import { Divider, Image, Skeleton, Typography } from '..';
|
|
8
8
|
import { BlockchainsChip } from '../BlockchainsChip';
|
|
9
9
|
|
|
10
|
+
import { generateBlockchainsLogo } from './SelectableCategoryList.helpers';
|
|
10
11
|
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
} from './SelectableCategoryList.
|
|
15
|
-
import { Container } from './SelectableCategoryList.styles';
|
|
12
|
+
Container,
|
|
13
|
+
FirstImage,
|
|
14
|
+
ImageContent,
|
|
15
|
+
} from './SelectableCategoryList.styles';
|
|
16
16
|
import { BlockchainCategories } from './SelectableCategoryList.types';
|
|
17
17
|
|
|
18
18
|
export function SelectableCategoryList(props: PropTypes) {
|
|
19
|
-
const { setCategory, category,
|
|
19
|
+
const { setCategory, category, blockchains, isLoading } = props;
|
|
20
20
|
const categories = Object.keys(
|
|
21
21
|
BlockchainCategories
|
|
22
22
|
) as BlockchainCategories[];
|
|
@@ -32,46 +32,45 @@ export function SelectableCategoryList(props: PropTypes) {
|
|
|
32
32
|
/>
|
|
33
33
|
))}
|
|
34
34
|
{!isLoading &&
|
|
35
|
-
categories.map((blockchainCategory) =>
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
})}
|
|
35
|
+
categories.map((blockchainCategory) => (
|
|
36
|
+
<BlockchainsChip
|
|
37
|
+
selected={category === blockchainCategory}
|
|
38
|
+
key={blockchainCategory}
|
|
39
|
+
onClick={() => setCategory(blockchainCategory)}>
|
|
40
|
+
{blockchainCategory !== BlockchainCategories.ALL && (
|
|
41
|
+
<>
|
|
42
|
+
<ImageContent>
|
|
43
|
+
{generateBlockchainsLogo(blockchains, blockchainCategory).map(
|
|
44
|
+
(blockchain, index) =>
|
|
45
|
+
index === 0 ? (
|
|
46
|
+
<FirstImage
|
|
47
|
+
key={`image-${blockchain.name}-${blockchain.chainId}`}
|
|
48
|
+
src={blockchain.logo}
|
|
49
|
+
/>
|
|
50
|
+
) : (
|
|
51
|
+
<Image
|
|
52
|
+
key={`image-${blockchain.name}-${blockchain.chainId}`}
|
|
53
|
+
src={blockchain.logo}
|
|
54
|
+
size={15}
|
|
55
|
+
/>
|
|
56
|
+
)
|
|
57
|
+
)}
|
|
58
|
+
</ImageContent>
|
|
59
|
+
<Divider size={12} />
|
|
60
|
+
</>
|
|
61
|
+
)}
|
|
62
|
+
<Typography
|
|
63
|
+
size="xsmall"
|
|
64
|
+
variant="body"
|
|
65
|
+
color={
|
|
66
|
+
blockchainCategory === BlockchainCategories.ALL
|
|
67
|
+
? 'secondary500'
|
|
68
|
+
: undefined
|
|
69
|
+
}>
|
|
70
|
+
{i18n.t(BlockchainCategories[blockchainCategory])}
|
|
71
|
+
</Typography>
|
|
72
|
+
</BlockchainsChip>
|
|
73
|
+
))}
|
|
75
74
|
</Container>
|
|
76
75
|
);
|
|
77
76
|
}
|
|
@@ -2,8 +2,8 @@ import type { PropsWithChildren } from 'react';
|
|
|
2
2
|
|
|
3
3
|
import React, { useEffect, useState } from 'react';
|
|
4
4
|
|
|
5
|
+
import { getConciseAddress } from '../../helper';
|
|
5
6
|
import { styled } from '../../theme';
|
|
6
|
-
import { getConciseAddress } from '../../utils';
|
|
7
7
|
import { Image } from '../common';
|
|
8
8
|
import { Typography } from '../Typography';
|
|
9
9
|
|
|
@@ -5,13 +5,12 @@ import React from 'react';
|
|
|
5
5
|
import { SkeletonContainer } from './Skeleton.styles';
|
|
6
6
|
|
|
7
7
|
export function Skeleton(props: PropTypes) {
|
|
8
|
-
const { width = '100%' } = props;
|
|
9
8
|
const customCss =
|
|
10
9
|
props.variant !== 'text'
|
|
11
10
|
? {
|
|
12
|
-
width,
|
|
11
|
+
width: props.width,
|
|
13
12
|
height: props.height,
|
|
14
13
|
}
|
|
15
|
-
: { width };
|
|
14
|
+
: { width: props.width };
|
|
16
15
|
return <SkeletonContainer css={customCss} {...props} />;
|
|
17
16
|
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { css } from '@stitches/react';
|
|
2
|
-
|
|
3
1
|
import { darkTheme, styled } from '../../theme';
|
|
4
2
|
|
|
5
3
|
export const Container = styled('div', {
|
|
@@ -10,8 +8,8 @@ export const Container = styled('div', {
|
|
|
10
8
|
border: '1px solid transparent',
|
|
11
9
|
variants: {
|
|
12
10
|
type: {
|
|
13
|
-
'
|
|
14
|
-
'
|
|
11
|
+
'route-details': { border: 'none' },
|
|
12
|
+
'route-progress': {
|
|
15
13
|
$$color: '$colors$neutral100',
|
|
16
14
|
[`.${darkTheme} &`]: {
|
|
17
15
|
$$color: '$colors$neutral300',
|
|
@@ -33,16 +31,40 @@ export const Container = styled('div', {
|
|
|
33
31
|
error: { borderColor: '$error500' },
|
|
34
32
|
},
|
|
35
33
|
},
|
|
34
|
+
'& .swapper': {
|
|
35
|
+
display: 'flex',
|
|
36
|
+
alignItems: 'center',
|
|
37
|
+
},
|
|
36
38
|
'& .swapper__description': {
|
|
37
39
|
fontWeight: '$medium',
|
|
38
40
|
},
|
|
41
|
+
'& .step-info': {
|
|
42
|
+
display: 'flex',
|
|
43
|
+
flex: '1',
|
|
44
|
+
width: '100%',
|
|
45
|
+
alignItems: 'start',
|
|
46
|
+
variants: {
|
|
47
|
+
tx: {
|
|
48
|
+
true: {
|
|
49
|
+
paddingLeft: '36px',
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
},
|
|
39
54
|
'& div:nth-child(3)': { display: 'flex', flexDirection: 'column', flex: 1 },
|
|
55
|
+
'& .tokens-container': { width: '100%' },
|
|
56
|
+
'& .tokens': {
|
|
57
|
+
display: 'flex',
|
|
58
|
+
paddingTop: '$5',
|
|
59
|
+
paddingBottom: '$10',
|
|
60
|
+
alignItems: 'center',
|
|
61
|
+
},
|
|
40
62
|
});
|
|
41
63
|
|
|
42
64
|
export const SwapperImage = styled('div', {
|
|
43
65
|
borderRadius: '100%',
|
|
44
|
-
width: '
|
|
45
|
-
height: '
|
|
66
|
+
width: 'max-content',
|
|
67
|
+
height: 'max-content',
|
|
46
68
|
overflow: 'hidden',
|
|
47
69
|
border: '1.5px solid transparent',
|
|
48
70
|
variants: {
|
|
@@ -109,33 +131,3 @@ export const StepSeparator = styled('div', {
|
|
|
109
131
|
},
|
|
110
132
|
},
|
|
111
133
|
});
|
|
112
|
-
|
|
113
|
-
export const tokensContainerStyles = css({
|
|
114
|
-
width: '100%',
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
export const swapperStyles = css({
|
|
118
|
-
display: 'flex',
|
|
119
|
-
alignItems: 'center',
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
export const stepInfoStyles = css({
|
|
123
|
-
display: 'flex',
|
|
124
|
-
flex: '1',
|
|
125
|
-
width: '100%',
|
|
126
|
-
alignItems: 'start',
|
|
127
|
-
variants: {
|
|
128
|
-
tx: {
|
|
129
|
-
true: {
|
|
130
|
-
paddingLeft: '36px',
|
|
131
|
-
},
|
|
132
|
-
},
|
|
133
|
-
},
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
export const tokensStyles = css({
|
|
137
|
-
display: 'flex',
|
|
138
|
-
paddingTop: '$5',
|
|
139
|
-
paddingBottom: '$10',
|
|
140
|
-
alignItems: 'center',
|
|
141
|
-
});
|
|
@@ -13,12 +13,8 @@ import {
|
|
|
13
13
|
Alerts,
|
|
14
14
|
Container,
|
|
15
15
|
DashedLine,
|
|
16
|
-
stepInfoStyles,
|
|
17
16
|
StepSeparator,
|
|
18
17
|
SwapperImage,
|
|
19
|
-
swapperStyles,
|
|
20
|
-
tokensContainerStyles,
|
|
21
|
-
tokensStyles,
|
|
22
18
|
} from './StepDetails.styles';
|
|
23
19
|
|
|
24
20
|
const StepDetailsComponent = forwardRef<HTMLDivElement, StepDetailsProps>(
|
|
@@ -43,8 +39,8 @@ const StepDetailsComponent = forwardRef<HTMLDivElement, StepDetailsProps>(
|
|
|
43
39
|
state={state}
|
|
44
40
|
ref={containerRef}
|
|
45
41
|
tabIndex={tabIndex}>
|
|
46
|
-
<div className=
|
|
47
|
-
{type === '
|
|
42
|
+
<div className="swapper">
|
|
43
|
+
{type === 'route-progress' && hasSeparator && (
|
|
48
44
|
<StepSeparator state={state} />
|
|
49
45
|
)}
|
|
50
46
|
<SwapperImage state={state}>
|
|
@@ -64,10 +60,10 @@ const StepDetailsComponent = forwardRef<HTMLDivElement, StepDetailsProps>(
|
|
|
64
60
|
})}
|
|
65
61
|
</Typography>
|
|
66
62
|
</div>
|
|
67
|
-
<div className=
|
|
68
|
-
<DashedLine invisible={!hasSeparator || type === '
|
|
69
|
-
<div className=
|
|
70
|
-
<div className=
|
|
63
|
+
<div className="step-info">
|
|
64
|
+
<DashedLine invisible={!hasSeparator || type === 'route-progress'} />
|
|
65
|
+
<div className="tokens-container">
|
|
66
|
+
<div className="tokens">
|
|
71
67
|
<ChainToken
|
|
72
68
|
chainImage={step.from.chain.image}
|
|
73
69
|
tokenImage={step.from.token.image}
|
|
@@ -94,7 +90,7 @@ const StepDetailsComponent = forwardRef<HTMLDivElement, StepDetailsProps>(
|
|
|
94
90
|
step.to.price.value
|
|
95
91
|
} ${step.to.token.displayName}`}</Typography>
|
|
96
92
|
</div>
|
|
97
|
-
<Alerts pb={hasSeparator && type === '
|
|
93
|
+
<Alerts pb={hasSeparator && type === 'route-details'}>
|
|
98
94
|
{step.alerts}
|
|
99
95
|
</Alerts>
|
|
100
96
|
</div>
|
|
@@ -1,24 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { SwapInputProps } from 'src/containers/SwapInput/SwapInput.types';
|
|
3
|
-
|
|
4
|
-
type BaseStep = Pick<SwapInputProps, 'chain' | 'token' | 'price'>;
|
|
5
|
-
|
|
6
|
-
export type Step = {
|
|
7
|
-
swapper: SwapInputProps['chain'];
|
|
8
|
-
from: BaseStep;
|
|
9
|
-
to: BaseStep;
|
|
10
|
-
error?: {
|
|
11
|
-
title?: string;
|
|
12
|
-
description?: string;
|
|
13
|
-
};
|
|
14
|
-
alerts?: ReactNode;
|
|
15
|
-
state?: 'error' | 'warning';
|
|
16
|
-
};
|
|
1
|
+
import type { Step } from '../BestRoute/BestRoute.types';
|
|
17
2
|
|
|
18
3
|
export type StepDetailsProps = {
|
|
19
4
|
step: Step;
|
|
20
5
|
hasSeparator: boolean;
|
|
21
|
-
type: '
|
|
6
|
+
type: 'route-details' | 'route-progress';
|
|
22
7
|
state?: 'default' | 'in-progress' | 'completed' | 'warning' | 'error';
|
|
23
8
|
isFocused?: boolean;
|
|
24
9
|
tabIndex?: number;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { StepDetails } from './StepDetails';
|
|
2
|
-
export type { StepDetailsProps
|
|
2
|
+
export type { StepDetailsProps } from './StepDetails.types';
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-magic-numbers */
|
|
2
|
+
// TODO: fix ts errors
|
|
3
|
+
// eslint-disable-next-line
|
|
4
|
+
// @ts-nocheck
|
|
2
5
|
import type { SwapTokenData } from './SwapListItem.types';
|
|
3
|
-
import type { PendingSwap } from '
|
|
6
|
+
import type { PendingSwap } from '../../containers/History/types';
|
|
4
7
|
|
|
5
|
-
import {
|
|
6
|
-
MessageSeverity,
|
|
7
|
-
RoutingResultType,
|
|
8
|
-
TransactionType,
|
|
9
|
-
} from 'rango-types';
|
|
8
|
+
import { RoutingResultType, TransactionType } from 'rango-sdk';
|
|
10
9
|
|
|
11
10
|
export const swap: PendingSwap = {
|
|
12
11
|
creationTime: '1673164511955',
|
|
@@ -22,7 +21,7 @@ export const swap: PendingSwap = {
|
|
|
22
21
|
status: 'running',
|
|
23
22
|
isPaused: false,
|
|
24
23
|
extraMessage: null,
|
|
25
|
-
extraMessageSeverity:
|
|
24
|
+
extraMessageSeverity: 'info',
|
|
26
25
|
extraMessageDetail: '',
|
|
27
26
|
extraMessageErrorCode: null,
|
|
28
27
|
networkStatusExtraMessage: null,
|
|
@@ -76,7 +75,6 @@ export const swap: PendingSwap = {
|
|
|
76
75
|
expenseType: 'FROM_SOURCE_WALLET',
|
|
77
76
|
name: 'Network Fee',
|
|
78
77
|
amount: '0',
|
|
79
|
-
price: null,
|
|
80
78
|
},
|
|
81
79
|
],
|
|
82
80
|
estimatedTimeInSeconds: 45,
|
|
@@ -152,7 +150,6 @@ export const swap: PendingSwap = {
|
|
|
152
150
|
includesDestinationTx: false,
|
|
153
151
|
maxRequiredSign: 1,
|
|
154
152
|
warnings: [],
|
|
155
|
-
internalSwaps: null,
|
|
156
153
|
},
|
|
157
154
|
],
|
|
158
155
|
},
|
|
@@ -167,20 +164,16 @@ export const swap: PendingSwap = {
|
|
|
167
164
|
'ibc/46b44899322f3cd854d2d46deef881958467cdd4b3b10086da49296bbed94bed',
|
|
168
165
|
fromDecimals: 6,
|
|
169
166
|
fromAmountPrecision: null,
|
|
170
|
-
fromAmountRestrictionType: 'EXCLUSIVE',
|
|
171
|
-
estimatedTimeInSeconds: 5,
|
|
172
167
|
fromAmountMinValue: null,
|
|
173
168
|
fromAmountMaxValue: null,
|
|
174
169
|
toBlockchainLogo: 'https://api.rango.exchange/swappers/osmosis.png',
|
|
175
170
|
fromBlockchainLogo: 'https://api.rango.exchange/swappers/osmosis.png',
|
|
176
|
-
fromUsdPrice: null,
|
|
177
171
|
toBlockchain: 'OSMOSIS',
|
|
178
172
|
fromLogo: 'https://api.rango.exchange/tokens/COSMOS/JUNO.png',
|
|
179
173
|
toSymbol: 'OSMO',
|
|
180
174
|
toSymbolAddress: null,
|
|
181
175
|
toDecimals: 6,
|
|
182
176
|
toLogo: 'https://api.rango.exchange/i/mJQPS2',
|
|
183
|
-
toUsdPrice: null,
|
|
184
177
|
startTransactionTime: 1673164519916,
|
|
185
178
|
swapperId: 'Osmosis',
|
|
186
179
|
swapperLogo: 'https://api.rango.exchange/swappers/osmosis.png',
|
|
@@ -196,13 +189,6 @@ export const swap: PendingSwap = {
|
|
|
196
189
|
description: null,
|
|
197
190
|
},
|
|
198
191
|
],
|
|
199
|
-
starknetApprovalTransaction: null,
|
|
200
|
-
starknetTransaction: null,
|
|
201
|
-
tronApprovalTransaction: null,
|
|
202
|
-
tonTransaction: null,
|
|
203
|
-
tronTransaction: null,
|
|
204
|
-
feeInUsd: null,
|
|
205
|
-
executedTransactionTime: null,
|
|
206
192
|
cosmosTransaction: {
|
|
207
193
|
type: TransactionType.COSMOS,
|
|
208
194
|
fromWalletAddress: 'osmo1unf2rcytjxfpz8x8ar63h4qeftadptg5t0nqcl',
|
|
@@ -290,7 +276,6 @@ export const swap: PendingSwap = {
|
|
|
290
276
|
transferTransaction: null,
|
|
291
277
|
diagnosisUrl: null,
|
|
292
278
|
internalSteps: null,
|
|
293
|
-
internalSwaps: null,
|
|
294
279
|
},
|
|
295
280
|
],
|
|
296
281
|
};
|
|
@@ -5,15 +5,13 @@ import { darkTheme, styled } from '../../theme';
|
|
|
5
5
|
export const StyledSwitchRoot = styled(RadixSwitch.Root, {
|
|
6
6
|
boxSizing: 'border-box',
|
|
7
7
|
boxShadow: 'none',
|
|
8
|
+
borderStyle: 'solid',
|
|
8
9
|
width: '24px',
|
|
9
10
|
height: '16px',
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
$$color: '$colors$neutral700',
|
|
13
|
-
},
|
|
14
|
-
backgroundColor: '$$color',
|
|
15
|
-
border: 'none',
|
|
11
|
+
backgroundColor: '$neutral600',
|
|
12
|
+
borderColor: '$neutral600',
|
|
16
13
|
borderRadius: '99999px',
|
|
14
|
+
position: 'relative',
|
|
17
15
|
padding: '0',
|
|
18
16
|
cursor: 'pointer',
|
|
19
17
|
transition: 'all 0.35s',
|
|
@@ -30,9 +28,9 @@ export const StyledSwitchRoot = styled(RadixSwitch.Root, {
|
|
|
30
28
|
});
|
|
31
29
|
|
|
32
30
|
export const StyledSwitchThumb = styled(RadixSwitch.Thumb, {
|
|
31
|
+
position: 'absolute',
|
|
32
|
+
top: '0',
|
|
33
33
|
boxSizing: 'border-box',
|
|
34
|
-
position: 'relative',
|
|
35
|
-
left: '$2',
|
|
36
34
|
display: 'block',
|
|
37
35
|
width: '12px',
|
|
38
36
|
height: '12px',
|
|
@@ -23,7 +23,9 @@ function TextFieldComponent(props: PropsWithChildren<PropTypes>, ref?: Ref) {
|
|
|
23
23
|
<>
|
|
24
24
|
{label && (
|
|
25
25
|
<>
|
|
26
|
-
<Label
|
|
26
|
+
<Label
|
|
27
|
+
className="_text"
|
|
28
|
+
{...(inputAttributes.id && { htmlFor: inputAttributes.id })}>
|
|
27
29
|
<Typography variant="label" size="large">
|
|
28
30
|
{label}
|
|
29
31
|
</Typography>
|
|
@@ -37,9 +39,10 @@ function TextFieldComponent(props: PropsWithChildren<PropTypes>, ref?: Ref) {
|
|
|
37
39
|
variant={variant}
|
|
38
40
|
size={size}
|
|
39
41
|
style={style}
|
|
40
|
-
className="_text
|
|
42
|
+
className="_text">
|
|
41
43
|
{prefix || null}
|
|
42
44
|
<Input
|
|
45
|
+
className="_text"
|
|
43
46
|
{...inputAttributes}
|
|
44
47
|
spellCheck={false}
|
|
45
48
|
suffix={!!suffix}
|
|
@@ -53,6 +56,5 @@ function TextFieldComponent(props: PropsWithChildren<PropTypes>, ref?: Ref) {
|
|
|
53
56
|
|
|
54
57
|
const TextField = React.forwardRef(TextFieldComponent);
|
|
55
58
|
TextField.displayName = 'TextField';
|
|
56
|
-
TextField.toString = () => '._text-field';
|
|
57
59
|
|
|
58
60
|
export { TextField };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { styled } from '@stitches/react';
|
|
2
2
|
|
|
3
3
|
export const Container = styled('div', {
|
|
4
4
|
display: 'flex',
|
|
@@ -15,15 +15,13 @@ export const Container = styled('div', {
|
|
|
15
15
|
true: { alignItems: 'center', justifyContent: 'center' },
|
|
16
16
|
},
|
|
17
17
|
},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
display: 'flex',
|
|
28
|
-
paddingTop: '$5',
|
|
18
|
+
'& .token-amount': {
|
|
19
|
+
display: 'flex',
|
|
20
|
+
justifyContent: 'center',
|
|
21
|
+
alignItems: 'center',
|
|
22
|
+
},
|
|
23
|
+
'& .usd-value': {
|
|
24
|
+
display: 'flex',
|
|
25
|
+
paddingTop: '$5',
|
|
26
|
+
},
|
|
29
27
|
});
|