@rango-dev/widget-embedded 0.21.1-next.7 → 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/CustomCollapsible/CustomCollapsible.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/CustomCollapsible/CustomCollapsible.tsx +1 -10
- package/src/components/Quote/Quote.tsx +1 -11
package/package.json
CHANGED
|
@@ -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}
|
|
@@ -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,
|
|
@@ -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
|
<>
|