@rango-dev/ui 0.15.1-next.7 → 0.15.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/index.js +6 -6
- package/dist/index.js.map +4 -4
- package/dist/widget/ui/src/components/BestRoute/BestRoute.d.ts.map +1 -1
- package/dist/widget/ui/src/components/BestRoute/BestRoute.styles.d.ts.map +1 -1
- 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 +149 -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 +1 -0
- package/dist/widget/ui/src/components/BestRoute/index.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Modal/Modal.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/widget/ui/src/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Tooltip/Tooltip.types.d.ts +7 -2
- package/dist/widget/ui/src/components/Tooltip/Tooltip.types.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/SwapInput/SwapInput.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/SwapInput/TokenSection.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/hooks/usePaddingRight.d.ts +2 -1
- package/dist/widget/ui/src/hooks/usePaddingRight.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/BestRoute/BestRoute.styles.ts +4 -5
- package/src/components/BestRoute/BestRoute.tsx +10 -32
- package/src/components/BestRoute/BestRouteSkeleton.styles.ts +1 -1
- package/src/components/BestRoute/RouteSummary.styles.ts +15 -0
- package/src/components/BestRoute/RouteSummary.tsx +48 -0
- package/src/components/BestRoute/index.ts +1 -0
- package/src/components/Modal/Modal.tsx +2 -4
- package/src/components/TokenAmount/TokenAmount.tsx +3 -3
- package/src/components/Tooltip/Tooltip.tsx +20 -45
- package/src/components/Tooltip/Tooltip.types.ts +7 -2
- package/src/components/Wallet/ClickableWallet.tsx +1 -1
- package/src/containers/SwapInput/SwapInput.styles.ts +3 -0
- package/src/containers/SwapInput/SwapInput.tsx +1 -1
- package/src/containers/SwapInput/TokenSection.styles.ts +3 -0
- package/src/containers/SwapInput/TokenSection.tsx +3 -3
- package/src/hooks/usePaddingRight.ts +17 -14
|
@@ -29,11 +29,11 @@ export function TokenSection(props: TokenSectionProps) {
|
|
|
29
29
|
/>
|
|
30
30
|
<div className="token-chain-name">
|
|
31
31
|
{loading ? (
|
|
32
|
-
|
|
32
|
+
<div className="token-chain-name__skeleton">
|
|
33
33
|
<Skeleton variant="text" size="large" width={92} />
|
|
34
|
-
<Divider size={
|
|
34
|
+
<Divider size={8} />
|
|
35
35
|
<Skeleton variant="text" size="medium" width={92} />
|
|
36
|
-
|
|
36
|
+
</div>
|
|
37
37
|
) : (
|
|
38
38
|
<>
|
|
39
39
|
<Typography variant="title" size="medium">
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { MutableRefObject } from 'react';
|
|
2
|
+
|
|
3
|
+
import { useLayoutEffect } from 'react';
|
|
2
4
|
|
|
3
5
|
type Params = {
|
|
4
|
-
|
|
6
|
+
elementRef: MutableRefObject<HTMLElement | null>;
|
|
5
7
|
paddingRight: string;
|
|
6
8
|
};
|
|
7
9
|
|
|
@@ -10,29 +12,30 @@ type Params = {
|
|
|
10
12
|
* By implementing this solution, we ensure that there is a constant padding on the right side of the content, regardless of whether or not a scrollbar is present.
|
|
11
13
|
*/
|
|
12
14
|
export function usePaddingRight(params: Params) {
|
|
13
|
-
const {
|
|
14
|
-
|
|
15
|
+
const { elementRef, paddingRight } = params;
|
|
16
|
+
useLayoutEffect(() => {
|
|
15
17
|
let resizeObserver: ResizeObserver | null = null;
|
|
16
|
-
if (
|
|
18
|
+
if (elementRef.current) {
|
|
17
19
|
resizeObserver = new ResizeObserver(() => {
|
|
18
|
-
if (
|
|
19
|
-
const scrollable =
|
|
20
|
+
if (elementRef.current) {
|
|
21
|
+
const scrollable =
|
|
22
|
+
elementRef.current.scrollHeight > elementRef.current.clientHeight;
|
|
20
23
|
if (scrollable) {
|
|
21
|
-
|
|
24
|
+
elementRef.current.style.paddingRight = `${
|
|
22
25
|
parseInt(paddingRight) -
|
|
23
|
-
(
|
|
26
|
+
(elementRef.current.offsetWidth - elementRef.current.clientWidth)
|
|
24
27
|
}px`;
|
|
25
28
|
} else {
|
|
26
|
-
|
|
29
|
+
elementRef.current.style.paddingRight = paddingRight;
|
|
27
30
|
}
|
|
28
31
|
}
|
|
29
32
|
});
|
|
30
|
-
resizeObserver.observe(
|
|
33
|
+
resizeObserver.observe(elementRef.current);
|
|
31
34
|
}
|
|
32
35
|
return () => {
|
|
33
|
-
if (
|
|
34
|
-
resizeObserver?.unobserve(
|
|
36
|
+
if (elementRef.current) {
|
|
37
|
+
resizeObserver?.unobserve(elementRef.current);
|
|
35
38
|
}
|
|
36
39
|
};
|
|
37
|
-
}, [
|
|
40
|
+
}, [elementRef.current]);
|
|
38
41
|
}
|