@rango-dev/widget-embedded 0.21.1-next.6 → 0.21.1-next.8
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/ConfirmWalletsModal/WalletList.d.ts.map +1 -1
- package/dist/components/CustomCollapsible/CustomCollapsible.d.ts.map +1 -1
- package/dist/components/HeaderButtons/HomeButtons.d.ts.map +1 -1
- package/dist/components/NotificationContent/NotificationContent.styles.d.ts.map +1 -1
- package/dist/components/Quote/Quote.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +3 -3
- package/package.json +2 -2
- package/src/components/ConfirmWalletsModal/WalletList.tsx +4 -2
- package/src/components/CustomCollapsible/CustomCollapsible.tsx +1 -10
- package/src/components/HeaderButtons/HomeButtons.tsx +2 -1
- package/src/components/NotificationContent/NotificationContent.styles.ts +1 -0
- package/src/components/Quote/Quote.tsx +2 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rango-dev/widget-embedded",
|
|
3
|
-
"version": "0.21.1-next.
|
|
3
|
+
"version": "0.21.1-next.8",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"source": "./src/index.ts",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@rango-dev/queue-manager-core": "^0.25.0",
|
|
26
26
|
"@rango-dev/queue-manager-rango-preset": "^0.26.0",
|
|
27
27
|
"@rango-dev/queue-manager-react": "^0.25.0",
|
|
28
|
-
"@rango-dev/ui": "^0.27.1-next.
|
|
28
|
+
"@rango-dev/ui": "^0.27.1-next.5",
|
|
29
29
|
"@rango-dev/wallets-react": "^0.12.0",
|
|
30
30
|
"@rango-dev/wallets-shared": "^0.26.0",
|
|
31
31
|
"bignumber.js": "^9.1.1",
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-magic-numbers */
|
|
2
1
|
import type { PropTypes } from './WalletList.type';
|
|
3
2
|
import type { Wallet } from '../../types';
|
|
4
3
|
import type { WalletInfo } from '@rango-dev/ui';
|
|
@@ -42,6 +41,7 @@ import {
|
|
|
42
41
|
WalletImageContainer,
|
|
43
42
|
} from './WalletList.styles';
|
|
44
43
|
|
|
44
|
+
const ACCOUNT_ADDRESS_MAX_CHARACTERS = 7;
|
|
45
45
|
export function WalletList(props: PropTypes) {
|
|
46
46
|
const { chain, isSelected, selectWallet, limit, onShowMore } = props;
|
|
47
47
|
const { config } = useAppStore();
|
|
@@ -147,7 +147,9 @@ export function WalletList(props: PropTypes) {
|
|
|
147
147
|
walletType: wallet.type,
|
|
148
148
|
chain,
|
|
149
149
|
});
|
|
150
|
-
const conciseAddress = address
|
|
150
|
+
const conciseAddress = address
|
|
151
|
+
? getConciseAddress(address, ACCOUNT_ADDRESS_MAX_CHARACTERS)
|
|
152
|
+
: '';
|
|
151
153
|
|
|
152
154
|
const experimentalChain = isExperimentalChain(blockchains(), chain);
|
|
153
155
|
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import type { PropTypes } from './CustomCollapsible.types';
|
|
2
2
|
import type { PropsWithChildren } from 'react';
|
|
3
3
|
|
|
4
|
-
import React, {
|
|
4
|
+
import React, { useRef } from 'react';
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
7
|
CollapsibleContent,
|
|
8
8
|
CollapsibleRoot,
|
|
9
|
-
EXPANDABLE_TRANSITION_DURATION,
|
|
10
9
|
Trigger,
|
|
11
10
|
} from './CustomCollapsible.styles';
|
|
12
11
|
|
|
@@ -22,14 +21,6 @@ export function CustomCollapsible(props: PropsWithChildren<PropTypes>) {
|
|
|
22
21
|
} = props;
|
|
23
22
|
const ref = useRef<HTMLDivElement | null>(null);
|
|
24
23
|
|
|
25
|
-
useLayoutEffect(() => {
|
|
26
|
-
if (open && ref.current) {
|
|
27
|
-
setTimeout(() => {
|
|
28
|
-
ref?.current?.scrollIntoView({ behavior: 'smooth' });
|
|
29
|
-
}, EXPANDABLE_TRANSITION_DURATION);
|
|
30
|
-
}
|
|
31
|
-
}, [open]);
|
|
32
|
-
|
|
33
24
|
return (
|
|
34
25
|
<CollapsibleRoot
|
|
35
26
|
ref={ref}
|
|
@@ -39,7 +39,8 @@ export function HomeButtons(props: HomeButtonsPropTypes) {
|
|
|
39
39
|
|
|
40
40
|
{!isNotificationsHidden && (
|
|
41
41
|
<Popover
|
|
42
|
-
align="
|
|
42
|
+
align="end"
|
|
43
|
+
alignOffset={-88}
|
|
43
44
|
collisionPadding={{ right: 20, left: 20 }}
|
|
44
45
|
container={getContainer()}
|
|
45
46
|
content={<NotificationContent />}>
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
Typography,
|
|
14
14
|
} from '@rango-dev/ui';
|
|
15
15
|
import BigNumber from 'bignumber.js';
|
|
16
|
-
import React, {
|
|
16
|
+
import React, { useRef, useState } from 'react';
|
|
17
17
|
|
|
18
18
|
import {
|
|
19
19
|
PERCENTAGE_CHANGE_MAX_DECIMALS,
|
|
@@ -42,7 +42,6 @@ import {
|
|
|
42
42
|
basicInfoStyles,
|
|
43
43
|
ContainerInfoOutput,
|
|
44
44
|
Content,
|
|
45
|
-
EXPANDABLE_QUOTE_TRANSITION_DURATION,
|
|
46
45
|
FrameIcon,
|
|
47
46
|
HorizontalSeparator,
|
|
48
47
|
QuoteContainer,
|
|
@@ -69,7 +68,6 @@ export function Quote(props: QuoteProps) {
|
|
|
69
68
|
|
|
70
69
|
const [expanded, setExpanded] = useState(props.expanded);
|
|
71
70
|
const quoteRef = useRef<HTMLButtonElement | null>(null);
|
|
72
|
-
const prevExpanded = useRef(expanded);
|
|
73
71
|
const roundedInput = numberToString(
|
|
74
72
|
input.value,
|
|
75
73
|
TOKEN_AMOUNT_MIN_DECIMALS,
|
|
@@ -190,7 +188,7 @@ export function Quote(props: QuoteProps) {
|
|
|
190
188
|
title={
|
|
191
189
|
error?.type === QuoteErrorType.BRIDGE_LIMIT
|
|
192
190
|
? error?.recommendation
|
|
193
|
-
: i18n.t(
|
|
191
|
+
: i18n.t(`Slippage ${stepHasError ? 'Error' : 'Warning'}:`)
|
|
194
192
|
}
|
|
195
193
|
footer={
|
|
196
194
|
<FooterAlert>
|
|
@@ -263,14 +261,6 @@ export function Quote(props: QuoteProps) {
|
|
|
263
261
|
const steps = getQuoteSteps(quote.result?.swaps ?? []);
|
|
264
262
|
const numberOfSteps = steps.length;
|
|
265
263
|
const tooltipContainer = getContainer();
|
|
266
|
-
useLayoutEffect(() => {
|
|
267
|
-
if (expanded && !prevExpanded.current && quoteRef.current) {
|
|
268
|
-
setTimeout(() => {
|
|
269
|
-
quoteRef?.current?.scrollIntoView({ behavior: 'smooth' });
|
|
270
|
-
}, EXPANDABLE_QUOTE_TRANSITION_DURATION);
|
|
271
|
-
}
|
|
272
|
-
prevExpanded.current = expanded;
|
|
273
|
-
}, [expanded, prevExpanded]);
|
|
274
264
|
|
|
275
265
|
return (
|
|
276
266
|
<>
|