@rango-dev/ui 0.44.1-next.5 → 0.44.1-next.6
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/index.js +1 -1
- package/dist/index.js.map +4 -4
- package/dist/ui.build.json +1 -1
- package/dist/widget/ui/src/components/ChainToken/ChainToken.constants.d.ts +1 -0
- package/dist/widget/ui/src/components/ChainToken/ChainToken.constants.d.ts.map +1 -1
- package/dist/widget/ui/src/components/ChainToken/ChainToken.d.ts.map +1 -1
- package/dist/widget/ui/src/components/ChainToken/ChainToken.types.d.ts +2 -2
- package/dist/widget/ui/src/components/ChainToken/ChainToken.types.d.ts.map +1 -1
- package/dist/widget/ui/src/components/CustomTokenWarning/CustomTokenWarning.d.ts +4 -0
- package/dist/widget/ui/src/components/CustomTokenWarning/CustomTokenWarning.d.ts.map +1 -0
- package/dist/widget/ui/src/components/CustomTokenWarning/CustomTokenWarning.styles.d.ts +486 -0
- package/dist/widget/ui/src/components/CustomTokenWarning/CustomTokenWarning.styles.d.ts.map +1 -0
- package/dist/widget/ui/src/components/CustomTokenWarning/CustomTokenWarning.types.d.ts +4 -0
- package/dist/widget/ui/src/components/CustomTokenWarning/CustomTokenWarning.types.d.ts.map +1 -0
- package/dist/widget/ui/src/components/CustomTokenWarning/index.d.ts +2 -0
- package/dist/widget/ui/src/components/CustomTokenWarning/index.d.ts.map +1 -0
- package/dist/widget/ui/src/components/FullExpandedQuote/FullExpandedQuote.Skeletons.d.ts.map +1 -1
- package/dist/widget/ui/src/components/SwapListItem/SwapListItem.types.d.ts +4 -4
- package/dist/widget/ui/src/components/SwapListItem/SwapListItem.types.d.ts.map +1 -1
- package/dist/widget/ui/src/components/SwapListItem/SwapToken.d.ts.map +1 -1
- package/dist/widget/ui/src/components/index.d.ts +1 -0
- package/dist/widget/ui/src/components/index.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/Notifications/Notifications.types.d.ts +2 -2
- package/dist/widget/ui/src/containers/Notifications/Notifications.types.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.types.d.ts +6 -3
- 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 +160 -0
- package/dist/widget/ui/src/containers/SwapInput/TokenSection.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/SwapInput/TokenSection.types.d.ts +4 -2
- package/dist/widget/ui/src/containers/SwapInput/TokenSection.types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/ChainToken/ChainToken.constants.ts +3 -0
- package/src/components/ChainToken/ChainToken.tsx +15 -7
- package/src/components/ChainToken/ChainToken.types.ts +2 -2
- package/src/components/CustomTokenWarning/CustomTokenWarning.styles.ts +30 -0
- package/src/components/CustomTokenWarning/CustomTokenWarning.tsx +44 -0
- package/src/components/CustomTokenWarning/CustomTokenWarning.types.ts +3 -0
- package/src/components/CustomTokenWarning/index.ts +1 -0
- package/src/components/FullExpandedQuote/FullExpandedQuote.Skeletons.tsx +1 -7
- package/src/components/SwapListItem/SwapListItem.types.ts +4 -4
- package/src/components/SwapListItem/SwapToken.tsx +2 -12
- package/src/components/index.ts +1 -0
- package/src/containers/Notifications/Notifications.types.ts +2 -2
- package/src/containers/SwapInput/SwapInput.tsx +2 -0
- package/src/containers/SwapInput/SwapInput.types.ts +5 -3
- package/src/containers/SwapInput/TokenSection.styles.ts +7 -0
- package/src/containers/SwapInput/TokenSection.tsx +17 -5
- package/src/containers/SwapInput/TokenSection.types.ts +4 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TokenSection.d.ts","sourceRoot":"","sources":["../../../../../../src/containers/SwapInput/TokenSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAGjE,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TokenSection.d.ts","sourceRoot":"","sources":["../../../../../../src/containers/SwapInput/TokenSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAGjE,OAAO,KAAK,MAAM,OAAO,CAAC;AAmB1B,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,qBA0DpD"}
|
|
@@ -1078,4 +1078,164 @@ export declare const skeletonStyles: import("@stitches/react/types/styled-compon
|
|
|
1078
1078
|
zIndices: {};
|
|
1079
1079
|
transitions: {};
|
|
1080
1080
|
}, import("@stitches/react/types/config.js").DefaultThemeMap, {}>>;
|
|
1081
|
+
export declare const TitleContainer: import("@stitches/react/types/styled-component.js").StyledComponent<"div", {}, {
|
|
1082
|
+
xs: string;
|
|
1083
|
+
sm: string;
|
|
1084
|
+
md: string;
|
|
1085
|
+
lg: string;
|
|
1086
|
+
}, import("@stitches/react/types/css-util.js").CSS<{
|
|
1087
|
+
xs: string;
|
|
1088
|
+
sm: string;
|
|
1089
|
+
md: string;
|
|
1090
|
+
lg: string;
|
|
1091
|
+
}, {
|
|
1092
|
+
colors: {
|
|
1093
|
+
primary: string;
|
|
1094
|
+
primary500: string;
|
|
1095
|
+
primary550: string;
|
|
1096
|
+
secondary: string;
|
|
1097
|
+
secondary100: string;
|
|
1098
|
+
secondary150: string;
|
|
1099
|
+
secondary200: string;
|
|
1100
|
+
secondary250: string;
|
|
1101
|
+
secondary500: string;
|
|
1102
|
+
secondary550: string;
|
|
1103
|
+
neutral: string;
|
|
1104
|
+
neutral100: string;
|
|
1105
|
+
neutral200: string;
|
|
1106
|
+
neutral300: string;
|
|
1107
|
+
neutral400: string;
|
|
1108
|
+
neutral500: string;
|
|
1109
|
+
neutral600: string;
|
|
1110
|
+
neutral700: string;
|
|
1111
|
+
neutral800: string;
|
|
1112
|
+
neutral900: string;
|
|
1113
|
+
error100: string;
|
|
1114
|
+
error300: string;
|
|
1115
|
+
error500: string;
|
|
1116
|
+
error600: string;
|
|
1117
|
+
error700: string;
|
|
1118
|
+
warning100: string;
|
|
1119
|
+
warning300: string;
|
|
1120
|
+
warning500: string;
|
|
1121
|
+
warning600: string;
|
|
1122
|
+
warning700: string;
|
|
1123
|
+
info: string;
|
|
1124
|
+
info100: string;
|
|
1125
|
+
info300: string;
|
|
1126
|
+
info500: string;
|
|
1127
|
+
info600: string;
|
|
1128
|
+
info700: string;
|
|
1129
|
+
success100: string;
|
|
1130
|
+
success300: string;
|
|
1131
|
+
success500: string;
|
|
1132
|
+
success600: string;
|
|
1133
|
+
success700: string;
|
|
1134
|
+
background: string;
|
|
1135
|
+
foreground: string;
|
|
1136
|
+
};
|
|
1137
|
+
space: {
|
|
1138
|
+
0: string;
|
|
1139
|
+
5: string;
|
|
1140
|
+
10: string;
|
|
1141
|
+
15: string;
|
|
1142
|
+
20: string;
|
|
1143
|
+
25: string;
|
|
1144
|
+
30: string;
|
|
1145
|
+
40: string;
|
|
1146
|
+
46: string;
|
|
1147
|
+
50: string;
|
|
1148
|
+
60: string;
|
|
1149
|
+
70: string;
|
|
1150
|
+
80: string;
|
|
1151
|
+
90: string;
|
|
1152
|
+
100: string;
|
|
1153
|
+
2: string;
|
|
1154
|
+
4: string;
|
|
1155
|
+
6: string;
|
|
1156
|
+
8: string;
|
|
1157
|
+
12: string;
|
|
1158
|
+
16: string;
|
|
1159
|
+
24: string;
|
|
1160
|
+
28: string;
|
|
1161
|
+
32: string;
|
|
1162
|
+
36: string;
|
|
1163
|
+
};
|
|
1164
|
+
radii: {
|
|
1165
|
+
xs: string;
|
|
1166
|
+
sm: string;
|
|
1167
|
+
xm: string;
|
|
1168
|
+
md: string;
|
|
1169
|
+
xl: string;
|
|
1170
|
+
lg: string;
|
|
1171
|
+
primary: string;
|
|
1172
|
+
secondary: string;
|
|
1173
|
+
};
|
|
1174
|
+
fontSizes: {
|
|
1175
|
+
10: string;
|
|
1176
|
+
12: string;
|
|
1177
|
+
14: string;
|
|
1178
|
+
16: string;
|
|
1179
|
+
18: string;
|
|
1180
|
+
20: string;
|
|
1181
|
+
22: string;
|
|
1182
|
+
24: string;
|
|
1183
|
+
28: string;
|
|
1184
|
+
32: string;
|
|
1185
|
+
36: string;
|
|
1186
|
+
40: string;
|
|
1187
|
+
48: string;
|
|
1188
|
+
};
|
|
1189
|
+
fonts: {
|
|
1190
|
+
primary: string;
|
|
1191
|
+
widget: string;
|
|
1192
|
+
};
|
|
1193
|
+
fontWeights: {
|
|
1194
|
+
regular: number;
|
|
1195
|
+
medium: number;
|
|
1196
|
+
semiBold: number;
|
|
1197
|
+
bold: number;
|
|
1198
|
+
};
|
|
1199
|
+
lineHeights: {
|
|
1200
|
+
12: string;
|
|
1201
|
+
16: string;
|
|
1202
|
+
20: string;
|
|
1203
|
+
24: string;
|
|
1204
|
+
26: string;
|
|
1205
|
+
28: string;
|
|
1206
|
+
30: string;
|
|
1207
|
+
36: string;
|
|
1208
|
+
40: string;
|
|
1209
|
+
44: string;
|
|
1210
|
+
52: string;
|
|
1211
|
+
64: string;
|
|
1212
|
+
};
|
|
1213
|
+
letterSpacings: {};
|
|
1214
|
+
sizes: {
|
|
1215
|
+
4: string;
|
|
1216
|
+
6: string;
|
|
1217
|
+
8: string;
|
|
1218
|
+
10: string;
|
|
1219
|
+
12: string;
|
|
1220
|
+
16: string;
|
|
1221
|
+
18: string;
|
|
1222
|
+
20: string;
|
|
1223
|
+
24: string;
|
|
1224
|
+
26: string;
|
|
1225
|
+
28: string;
|
|
1226
|
+
30: string;
|
|
1227
|
+
32: string;
|
|
1228
|
+
36: string;
|
|
1229
|
+
40: string;
|
|
1230
|
+
45: string;
|
|
1231
|
+
48: string;
|
|
1232
|
+
};
|
|
1233
|
+
borderWidths: {};
|
|
1234
|
+
borderStyles: {};
|
|
1235
|
+
shadows: {
|
|
1236
|
+
mainContainer: string;
|
|
1237
|
+
};
|
|
1238
|
+
zIndices: {};
|
|
1239
|
+
transitions: {};
|
|
1240
|
+
}, import("@stitches/react/types/config.js").DefaultThemeMap, {}>>;
|
|
1081
1241
|
//# sourceMappingURL=TokenSection.styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TokenSection.styles.d.ts","sourceRoot":"","sources":["../../../../../../src/containers/SwapInput/TokenSection.styles.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAwBX,MAAO,SAClB;aAAY,MAAO,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kEAY1B,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kEAAQ,CAAC;AAErC,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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ectionProps = {
|
|
2
|
-
chainImage
|
|
3
|
-
tokenImage
|
|
2
|
+
chainImage?: string;
|
|
3
|
+
tokenImage?: string;
|
|
4
4
|
tokenSymbol: string;
|
|
5
5
|
chain: string;
|
|
6
6
|
chianImageId?: string;
|
|
7
7
|
error?: boolean;
|
|
8
8
|
onClick: () => void;
|
|
9
9
|
loading?: boolean;
|
|
10
|
+
warning?: boolean;
|
|
11
|
+
tooltipContainer?: HTMLElement;
|
|
10
12
|
};
|
|
11
13
|
//# sourceMappingURL=TokenSection.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TokenSection.types.d.ts","sourceRoot":"","sources":["../../../../../../src/containers/SwapInput/TokenSection.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,UAAU,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"TokenSection.types.d.ts","sourceRoot":"","sources":["../../../../../../src/containers/SwapInput/TokenSection.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gBAAgB,CAAC,EAAE,WAAW,CAAC;CAChC,CAAC"}
|
package/package.json
CHANGED
|
@@ -5,7 +5,10 @@ import React from 'react';
|
|
|
5
5
|
import { Image } from '../common/index.js';
|
|
6
6
|
import { Skeleton } from '../Skeleton/index.js';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
DEFAULT_TOKEN_IMAGE_SRC,
|
|
10
|
+
tokenChainSizeMap,
|
|
11
|
+
} from './ChainToken.constants.js';
|
|
9
12
|
import {
|
|
10
13
|
ChainImageContainer,
|
|
11
14
|
Container,
|
|
@@ -22,6 +25,11 @@ export const ChainToken: React.FC<ChainTokenPropTypes> = (props) => {
|
|
|
22
25
|
loading,
|
|
23
26
|
} = props;
|
|
24
27
|
|
|
28
|
+
const tokenImageSrc =
|
|
29
|
+
tokenImage === '' ? DEFAULT_TOKEN_IMAGE_SRC : tokenImage;
|
|
30
|
+
const chainImageSrc =
|
|
31
|
+
chainImage === '' ? DEFAULT_TOKEN_IMAGE_SRC : chainImage;
|
|
32
|
+
|
|
25
33
|
return (
|
|
26
34
|
<Container
|
|
27
35
|
css={
|
|
@@ -39,19 +47,19 @@ export const ChainToken: React.FC<ChainTokenPropTypes> = (props) => {
|
|
|
39
47
|
width={tokenChainSizeMap[size].token}
|
|
40
48
|
/>
|
|
41
49
|
) : (
|
|
42
|
-
<TokenImageContainer hasBorder={!
|
|
50
|
+
<TokenImageContainer hasBorder={!tokenImageSrc}>
|
|
43
51
|
<Image
|
|
44
52
|
size={tokenChainSizeMap[size].token}
|
|
45
|
-
src={
|
|
53
|
+
src={tokenImageSrc}
|
|
46
54
|
type="circular"
|
|
47
|
-
{...((useAsPlaceholder || !
|
|
55
|
+
{...((useAsPlaceholder || !tokenImageSrc) && {
|
|
48
56
|
useAsPlaceholder: true,
|
|
49
57
|
backgroundColor: 'transparent',
|
|
50
58
|
})}
|
|
51
59
|
/>
|
|
52
60
|
</TokenImageContainer>
|
|
53
61
|
)}
|
|
54
|
-
<ChainImageContainer size={size} hasBorder={!
|
|
62
|
+
<ChainImageContainer size={size} hasBorder={!chainImageSrc}>
|
|
55
63
|
{loading ? (
|
|
56
64
|
<Skeleton
|
|
57
65
|
variant="circular"
|
|
@@ -62,9 +70,9 @@ export const ChainToken: React.FC<ChainTokenPropTypes> = (props) => {
|
|
|
62
70
|
<Image
|
|
63
71
|
id={chianImageId}
|
|
64
72
|
size={tokenChainSizeMap[size].chain}
|
|
65
|
-
src={
|
|
73
|
+
src={chainImageSrc}
|
|
66
74
|
type="circular"
|
|
67
|
-
{...((useAsPlaceholder || !
|
|
75
|
+
{...((useAsPlaceholder || !chainImageSrc) && {
|
|
68
76
|
useAsPlaceholder: true,
|
|
69
77
|
backgroundColor: 'transparent',
|
|
70
78
|
})}
|
|
@@ -5,8 +5,8 @@ type BaseProps = Stitches.VariantProps<typeof ChainImageContainer>;
|
|
|
5
5
|
type BaseSizes = Exclude<BaseProps['size'], object>;
|
|
6
6
|
|
|
7
7
|
export type ChainTokenPropTypes = {
|
|
8
|
-
tokenImage
|
|
9
|
-
chainImage
|
|
8
|
+
tokenImage?: string;
|
|
9
|
+
chainImage?: string;
|
|
10
10
|
chianImageId?: string;
|
|
11
11
|
size: NonNullable<BaseSizes>;
|
|
12
12
|
useAsPlaceholder?: boolean;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Tooltip } from '../Tooltip';
|
|
2
|
+
import type { ComponentProps } from 'react';
|
|
3
|
+
|
|
4
|
+
import { styled } from '../../theme';
|
|
5
|
+
import { IconHighlight } from '../Alert/Alert.styles';
|
|
6
|
+
|
|
7
|
+
export const tooltipStyles: ComponentProps<typeof Tooltip>['styles'] = {
|
|
8
|
+
root: {
|
|
9
|
+
zIndex: 10,
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const TooltipContent = styled('div', {
|
|
14
|
+
width: '217px',
|
|
15
|
+
display: 'flex',
|
|
16
|
+
justifyContent: 'center',
|
|
17
|
+
alignItems: 'center',
|
|
18
|
+
|
|
19
|
+
'& .warning-icon-container': {
|
|
20
|
+
width: '$20',
|
|
21
|
+
height: '$20',
|
|
22
|
+
alignSelf: 'unset',
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export const StyledIconHighlight = styled(IconHighlight, {
|
|
27
|
+
width: '14px',
|
|
28
|
+
height: '14px',
|
|
29
|
+
alignSelf: 'unset',
|
|
30
|
+
});
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { PropTypes } from './CustomTokenWarning.types';
|
|
2
|
+
|
|
3
|
+
import { i18n } from '@lingui/core';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
|
|
6
|
+
import { WarningIcon } from '../../icons';
|
|
7
|
+
import { IconHighlight } from '../Alert/Alert.styles';
|
|
8
|
+
import { Divider } from '../Divider';
|
|
9
|
+
import { Tooltip } from '../Tooltip';
|
|
10
|
+
import { Typography } from '../Typography';
|
|
11
|
+
|
|
12
|
+
import {
|
|
13
|
+
StyledIconHighlight,
|
|
14
|
+
TooltipContent,
|
|
15
|
+
tooltipStyles,
|
|
16
|
+
} from './CustomTokenWarning.styles';
|
|
17
|
+
|
|
18
|
+
export function CustomTokenWarning(props: PropTypes) {
|
|
19
|
+
return (
|
|
20
|
+
<Tooltip
|
|
21
|
+
styles={tooltipStyles}
|
|
22
|
+
side="bottom"
|
|
23
|
+
align="center"
|
|
24
|
+
sideOffset={20}
|
|
25
|
+
container={props.container}
|
|
26
|
+
content={
|
|
27
|
+
<TooltipContent>
|
|
28
|
+
<IconHighlight type="warning" className="warning-icon-container">
|
|
29
|
+
<WarningIcon color="warning" size={13} />
|
|
30
|
+
</IconHighlight>
|
|
31
|
+
<Divider size={4} direction="horizontal" />
|
|
32
|
+
<Typography variant="body" size="xsmall">
|
|
33
|
+
{i18n.t(
|
|
34
|
+
'This token may involve potential security risks; proceed with caution.'
|
|
35
|
+
)}
|
|
36
|
+
</Typography>
|
|
37
|
+
</TooltipContent>
|
|
38
|
+
}>
|
|
39
|
+
<StyledIconHighlight type="warning">
|
|
40
|
+
<WarningIcon color="warning" size={9} />
|
|
41
|
+
</StyledIconHighlight>
|
|
42
|
+
</Tooltip>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CustomTokenWarning } from './CustomTokenWarning';
|
|
@@ -34,13 +34,7 @@ export function SkeletonHeader() {
|
|
|
34
34
|
export function SkeletonOutput() {
|
|
35
35
|
return (
|
|
36
36
|
<OutputLoading>
|
|
37
|
-
<ChainToken
|
|
38
|
-
useAsPlaceholder={true}
|
|
39
|
-
size="large"
|
|
40
|
-
chainImage=""
|
|
41
|
-
tokenImage=""
|
|
42
|
-
loading={true}
|
|
43
|
-
/>
|
|
37
|
+
<ChainToken useAsPlaceholder={true} size="large" loading={true} />
|
|
44
38
|
<Skeleton variant="rounded" width={122} height={29} />
|
|
45
39
|
</OutputLoading>
|
|
46
40
|
);
|
|
@@ -25,11 +25,11 @@ export const StatusColors = {
|
|
|
25
25
|
export interface SwapTokenData {
|
|
26
26
|
from: {
|
|
27
27
|
token: {
|
|
28
|
-
image
|
|
28
|
+
image?: string;
|
|
29
29
|
displayName: string;
|
|
30
30
|
};
|
|
31
31
|
blockchain: {
|
|
32
|
-
image
|
|
32
|
+
image?: string;
|
|
33
33
|
};
|
|
34
34
|
amount: string;
|
|
35
35
|
realAmount: string;
|
|
@@ -37,11 +37,11 @@ export interface SwapTokenData {
|
|
|
37
37
|
|
|
38
38
|
to: {
|
|
39
39
|
token: {
|
|
40
|
-
image
|
|
40
|
+
image?: string;
|
|
41
41
|
displayName: string;
|
|
42
42
|
};
|
|
43
43
|
blockchain: {
|
|
44
|
-
image
|
|
44
|
+
image?: string;
|
|
45
45
|
};
|
|
46
46
|
amount: string;
|
|
47
47
|
realAmount: string;
|
|
@@ -27,23 +27,13 @@ export function SwapToken(props: PropTypes) {
|
|
|
27
27
|
<TokenContainer>
|
|
28
28
|
<Images>
|
|
29
29
|
<div>
|
|
30
|
-
<ChainToken
|
|
31
|
-
tokenImage=""
|
|
32
|
-
chainImage=""
|
|
33
|
-
size="medium"
|
|
34
|
-
loading={true}
|
|
35
|
-
/>
|
|
30
|
+
<ChainToken size="medium" loading={true} />
|
|
36
31
|
</div>
|
|
37
32
|
<div
|
|
38
33
|
style={{
|
|
39
34
|
transform: 'translateX(-5px)',
|
|
40
35
|
}}>
|
|
41
|
-
<ChainToken
|
|
42
|
-
tokenImage=""
|
|
43
|
-
chainImage=""
|
|
44
|
-
size="medium"
|
|
45
|
-
loading={true}
|
|
46
|
-
/>
|
|
36
|
+
<ChainToken size="medium" loading={true} />
|
|
47
37
|
</div>
|
|
48
38
|
</Images>
|
|
49
39
|
<LayoutLoading>
|
package/src/components/index.ts
CHANGED
|
@@ -9,8 +9,8 @@ type Notification = {
|
|
|
9
9
|
|
|
10
10
|
export type PropTypes = {
|
|
11
11
|
list: Notification[];
|
|
12
|
-
getBlockchainImage: (blockchain: string) => string;
|
|
13
|
-
getTokenImage: (token: Asset) => string;
|
|
12
|
+
getBlockchainImage: (blockchain: string) => string | undefined;
|
|
13
|
+
getTokenImage: (token: Asset) => string | undefined;
|
|
14
14
|
onClickItem: (requestId: string) => void;
|
|
15
15
|
onClearAll: () => void;
|
|
16
16
|
containerStyles?: CSS;
|
|
@@ -96,6 +96,8 @@ export function SwapInput(props: SwapInputPropTypes) {
|
|
|
96
96
|
tokenImage={props.token.image}
|
|
97
97
|
onClick={props.onClickToken}
|
|
98
98
|
loading={props.loading}
|
|
99
|
+
warning={props.token.securityWarning}
|
|
100
|
+
tooltipContainer={props.tooltipContainer}
|
|
99
101
|
/>
|
|
100
102
|
<div className={amountStyles()}>
|
|
101
103
|
{props.loading || (props.mode === 'To' && props.fetchingQuote) ? (
|
|
@@ -3,11 +3,12 @@ import type { PriceImpactWarningLevel } from '../../components/PriceImpact/Price
|
|
|
3
3
|
export type BaseProps = {
|
|
4
4
|
chain: {
|
|
5
5
|
displayName: string;
|
|
6
|
-
image
|
|
6
|
+
image?: string;
|
|
7
7
|
};
|
|
8
8
|
token: {
|
|
9
9
|
displayName: string;
|
|
10
|
-
image
|
|
10
|
+
image?: string;
|
|
11
|
+
securityWarning?: boolean;
|
|
11
12
|
};
|
|
12
13
|
price: {
|
|
13
14
|
value: string;
|
|
@@ -41,4 +42,5 @@ type ToProps = {
|
|
|
41
42
|
warningLevel: PriceImpactWarningLevel;
|
|
42
43
|
};
|
|
43
44
|
|
|
44
|
-
export type SwapInputPropTypes = BaseProps &
|
|
45
|
+
export type SwapInputPropTypes = BaseProps &
|
|
46
|
+
(FromProps | ToProps) & { tooltipContainer?: HTMLElement };
|
|
@@ -2,6 +2,7 @@ import type { TokenSectionProps } from './TokenSection.types.js';
|
|
|
2
2
|
|
|
3
3
|
import { i18n } from '@lingui/core';
|
|
4
4
|
import React from 'react';
|
|
5
|
+
import { CustomTokenWarning } from 'src/components/CustomTokenWarning/CustomTokenWarning.js';
|
|
5
6
|
|
|
6
7
|
import {
|
|
7
8
|
ChainToken,
|
|
@@ -14,6 +15,7 @@ import {
|
|
|
14
15
|
chainNameStyles,
|
|
15
16
|
Container,
|
|
16
17
|
skeletonStyles,
|
|
18
|
+
TitleContainer,
|
|
17
19
|
tokenChainStyles,
|
|
18
20
|
TokenSectionContainer,
|
|
19
21
|
} from './TokenSection.styles.js';
|
|
@@ -28,6 +30,8 @@ export function TokenSection(props: TokenSectionProps) {
|
|
|
28
30
|
chianImageId,
|
|
29
31
|
onClick,
|
|
30
32
|
loading,
|
|
33
|
+
warning,
|
|
34
|
+
tooltipContainer,
|
|
31
35
|
} = props;
|
|
32
36
|
return (
|
|
33
37
|
<Container variant="default" disabled={error || loading} onClick={onClick}>
|
|
@@ -49,11 +53,19 @@ export function TokenSection(props: TokenSectionProps) {
|
|
|
49
53
|
</div>
|
|
50
54
|
) : (
|
|
51
55
|
<>
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
<TitleContainer>
|
|
57
|
+
<Typography variant="title" size="medium">
|
|
58
|
+
{error || (!loading && !tokenSymbol)
|
|
59
|
+
? i18n.t('Select Token')
|
|
60
|
+
: tokenSymbol}
|
|
61
|
+
</Typography>
|
|
62
|
+
{warning && (
|
|
63
|
+
<>
|
|
64
|
+
<Divider size={4} direction="horizontal" />
|
|
65
|
+
<CustomTokenWarning container={tooltipContainer} />
|
|
66
|
+
</>
|
|
67
|
+
)}
|
|
68
|
+
</TitleContainer>
|
|
57
69
|
<Typography
|
|
58
70
|
variant="body"
|
|
59
71
|
size="medium"
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export type TokenSectionProps = {
|
|
2
|
-
chainImage
|
|
3
|
-
tokenImage
|
|
2
|
+
chainImage?: string;
|
|
3
|
+
tokenImage?: string;
|
|
4
4
|
tokenSymbol: string;
|
|
5
5
|
chain: string;
|
|
6
6
|
chianImageId?: string;
|
|
7
7
|
error?: boolean;
|
|
8
8
|
onClick: () => void;
|
|
9
9
|
loading?: boolean;
|
|
10
|
+
warning?: boolean;
|
|
11
|
+
tooltipContainer?: HTMLElement;
|
|
10
12
|
};
|