@rango-dev/ui 0.26.1-next.6 → 0.26.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 +2 -2
- package/dist/index.js.map +3 -3
- 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/StepDetails/StepDetails.d.ts.map +1 -1
- package/dist/widget/ui/src/components/StepDetails/StepDetails.styles.d.ts +163 -1
- 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 +15 -1
- package/dist/widget/ui/src/components/StepDetails/StepDetails.types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/RefreshProgressButton/RefreshProgressButton.styles.ts +4 -4
- package/src/components/StepDetails/StepDetails.styles.ts +28 -5
- package/src/components/StepDetails/StepDetails.tsx +73 -23
- package/src/components/StepDetails/StepDetails.types.ts +17 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../../translations/en.ts"],"names":[],"mappings":"AAAkB,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../../translations/en.ts"],"names":[],"mappings":"AAAkB,eAAO,MAAM,QAAQ,KAAm3X,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"es.d.ts","sourceRoot":"","sources":["../../../../translations/es.ts"],"names":[],"mappings":"AAAkB,eAAO,MAAM,QAAQ,KAA+
|
|
1
|
+
{"version":3,"file":"es.d.ts","sourceRoot":"","sources":["../../../../translations/es.ts"],"names":[],"mappings":"AAAkB,eAAO,MAAM,QAAQ,KAA+rZ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fr.d.ts","sourceRoot":"","sources":["../../../../translations/fr.ts"],"names":[],"mappings":"AAAkB,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"fr.d.ts","sourceRoot":"","sources":["../../../../translations/fr.ts"],"names":[],"mappings":"AAAkB,eAAO,MAAM,QAAQ,KAAu0Z,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ja.d.ts","sourceRoot":"","sources":["../../../../translations/ja.ts"],"names":[],"mappings":"AAAkB,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"ja.d.ts","sourceRoot":"","sources":["../../../../translations/ja.ts"],"names":[],"mappings":"AAAkB,eAAO,MAAM,QAAQ,KAAuoU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepDetails.d.ts","sourceRoot":"","sources":["../../../../../../src/components/StepDetails/StepDetails.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"StepDetails.d.ts","sourceRoot":"","sources":["../../../../../../src/components/StepDetails/StepDetails.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG1E,OAAO,KAAwD,MAAM,OAAO,CAAC;AA2K7E,eAAO,MAAM,WAAW,oHAA6B,CAAC"}
|
|
@@ -643,6 +643,167 @@ export declare const DashedLine: import("@stitches/react/types/styled-component"
|
|
|
643
643
|
zIndices: {};
|
|
644
644
|
transitions: {};
|
|
645
645
|
}, import("@stitches/react/types/config").DefaultThemeMap, {}>>;
|
|
646
|
+
export declare const SwapperSeparator: import("@stitches/react/types/styled-component").StyledComponent<"div", {
|
|
647
|
+
state?: "warning" | "error" | "default" | "in-progress" | "completed" | undefined;
|
|
648
|
+
}, {
|
|
649
|
+
sm: string;
|
|
650
|
+
md: string;
|
|
651
|
+
lg: string;
|
|
652
|
+
}, import("@stitches/react/types/css-util").CSS<{
|
|
653
|
+
sm: string;
|
|
654
|
+
md: string;
|
|
655
|
+
lg: string;
|
|
656
|
+
}, {
|
|
657
|
+
colors: {
|
|
658
|
+
primary: string;
|
|
659
|
+
primary500: string;
|
|
660
|
+
primary600: string;
|
|
661
|
+
secondary: string;
|
|
662
|
+
secondary100: string;
|
|
663
|
+
secondary200: string;
|
|
664
|
+
secondary300: string;
|
|
665
|
+
secondary400: string;
|
|
666
|
+
secondary500: string;
|
|
667
|
+
secondary600: string;
|
|
668
|
+
secondary700: string;
|
|
669
|
+
secondary800: string;
|
|
670
|
+
secondary900: string;
|
|
671
|
+
neutral: string;
|
|
672
|
+
neutral100: string;
|
|
673
|
+
neutral200: string;
|
|
674
|
+
neutral300: string;
|
|
675
|
+
neutral400: string;
|
|
676
|
+
neutral500: string;
|
|
677
|
+
neutral600: string;
|
|
678
|
+
neutral700: string;
|
|
679
|
+
neutral800: string;
|
|
680
|
+
neutral900: string;
|
|
681
|
+
error100: string;
|
|
682
|
+
error300: string;
|
|
683
|
+
error500: string;
|
|
684
|
+
error600: string;
|
|
685
|
+
error700: string;
|
|
686
|
+
warning100: string;
|
|
687
|
+
warning300: string;
|
|
688
|
+
warning500: string;
|
|
689
|
+
warning600: string;
|
|
690
|
+
warning700: string;
|
|
691
|
+
info: string;
|
|
692
|
+
info100: string;
|
|
693
|
+
info300: string;
|
|
694
|
+
info500: string;
|
|
695
|
+
info600: string;
|
|
696
|
+
info700: string;
|
|
697
|
+
success100: string;
|
|
698
|
+
success300: string;
|
|
699
|
+
success500: string;
|
|
700
|
+
success600: string;
|
|
701
|
+
success700: string;
|
|
702
|
+
background: string;
|
|
703
|
+
foreground: string;
|
|
704
|
+
};
|
|
705
|
+
space: {
|
|
706
|
+
0: string;
|
|
707
|
+
5: string;
|
|
708
|
+
10: string;
|
|
709
|
+
15: string;
|
|
710
|
+
20: string;
|
|
711
|
+
25: string;
|
|
712
|
+
30: string;
|
|
713
|
+
40: string;
|
|
714
|
+
46: string;
|
|
715
|
+
50: string;
|
|
716
|
+
60: string;
|
|
717
|
+
70: string;
|
|
718
|
+
80: string;
|
|
719
|
+
90: string;
|
|
720
|
+
100: string;
|
|
721
|
+
2: string;
|
|
722
|
+
4: string;
|
|
723
|
+
6: string;
|
|
724
|
+
8: string;
|
|
725
|
+
12: string;
|
|
726
|
+
16: string;
|
|
727
|
+
24: string;
|
|
728
|
+
28: string;
|
|
729
|
+
32: string;
|
|
730
|
+
};
|
|
731
|
+
radii: {
|
|
732
|
+
xs: string;
|
|
733
|
+
sm: string;
|
|
734
|
+
xm: string;
|
|
735
|
+
md: string;
|
|
736
|
+
xl: string;
|
|
737
|
+
lg: string;
|
|
738
|
+
primary: string;
|
|
739
|
+
secondary: string;
|
|
740
|
+
};
|
|
741
|
+
fontSizes: {
|
|
742
|
+
10: string;
|
|
743
|
+
12: string;
|
|
744
|
+
14: string;
|
|
745
|
+
16: string;
|
|
746
|
+
18: string;
|
|
747
|
+
20: string;
|
|
748
|
+
22: string;
|
|
749
|
+
24: string;
|
|
750
|
+
28: string;
|
|
751
|
+
32: string;
|
|
752
|
+
36: string;
|
|
753
|
+
40: string;
|
|
754
|
+
48: string;
|
|
755
|
+
};
|
|
756
|
+
fonts: {
|
|
757
|
+
primary: string;
|
|
758
|
+
widget: string;
|
|
759
|
+
};
|
|
760
|
+
fontWeights: {
|
|
761
|
+
regular: number;
|
|
762
|
+
medium: number;
|
|
763
|
+
semiBold: number;
|
|
764
|
+
bold: number;
|
|
765
|
+
};
|
|
766
|
+
lineHeights: {
|
|
767
|
+
12: string;
|
|
768
|
+
16: string;
|
|
769
|
+
20: string;
|
|
770
|
+
24: string;
|
|
771
|
+
26: string;
|
|
772
|
+
28: string;
|
|
773
|
+
30: string;
|
|
774
|
+
36: string;
|
|
775
|
+
40: string;
|
|
776
|
+
44: string;
|
|
777
|
+
52: string;
|
|
778
|
+
64: string;
|
|
779
|
+
};
|
|
780
|
+
letterSpacings: {};
|
|
781
|
+
sizes: {
|
|
782
|
+
4: string;
|
|
783
|
+
6: string;
|
|
784
|
+
8: string;
|
|
785
|
+
10: string;
|
|
786
|
+
12: string;
|
|
787
|
+
16: string;
|
|
788
|
+
18: string;
|
|
789
|
+
20: string;
|
|
790
|
+
24: string;
|
|
791
|
+
28: string;
|
|
792
|
+
30: string;
|
|
793
|
+
32: string;
|
|
794
|
+
36: string;
|
|
795
|
+
40: string;
|
|
796
|
+
45: string;
|
|
797
|
+
48: string;
|
|
798
|
+
};
|
|
799
|
+
borderWidths: {};
|
|
800
|
+
borderStyles: {};
|
|
801
|
+
shadows: {
|
|
802
|
+
s: string;
|
|
803
|
+
};
|
|
804
|
+
zIndices: {};
|
|
805
|
+
transitions: {};
|
|
806
|
+
}, import("@stitches/react/types/config").DefaultThemeMap, {}>>;
|
|
646
807
|
export declare const StepSeparator: import("@stitches/react/types/styled-component").StyledComponent<"div", {
|
|
647
808
|
state?: "warning" | "error" | "default" | "in-progress" | "completed" | undefined;
|
|
648
809
|
}, {
|
|
@@ -805,7 +966,8 @@ export declare const StepSeparator: import("@stitches/react/types/styled-compone
|
|
|
805
966
|
transitions: {};
|
|
806
967
|
}, import("@stitches/react/types/config").DefaultThemeMap, {}>>;
|
|
807
968
|
export declare const tokensContainerStyles: import("@stitches/react/types/styled-component").CssComponent<never, {}, {}, import("@stitches/react/types/css-util").CSS<{}, {}, {}, {}>>;
|
|
808
|
-
export declare const
|
|
969
|
+
export declare const swappersStyles: import("@stitches/react/types/styled-component").CssComponent<never, {}, {}, import("@stitches/react/types/css-util").CSS<{}, {}, {}, {}>>;
|
|
970
|
+
export declare const swapperItemStyles: import("@stitches/react/types/styled-component").CssComponent<never, {}, {}, import("@stitches/react/types/css-util").CSS<{}, {}, {}, {}>>;
|
|
809
971
|
export declare const stepInfoStyles: import("@stitches/react/types/styled-component").CssComponent<never, {
|
|
810
972
|
tx?: boolean | "true" | undefined;
|
|
811
973
|
}, {}, import("@stitches/react/types/css-util").CSS<{}, {}, {}, {}>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepDetails.styles.d.ts","sourceRoot":"","sources":["../../../../../../src/components/StepDetails/StepDetails.styles.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+
|
|
1
|
+
{"version":3,"file":"StepDetails.styles.d.ts","sourceRoot":"","sources":["../../../../../../src/components/StepDetails/StepDetails.styles.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+DAgCpB,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+DAmBvB,CAAC;AAEH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+DASjB,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+DAarB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+DAkB3B,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+DAsBxB,CAAC;AAEH,eAAO,MAAM,qBAAqB,4IAEhC,CAAC;AAEH,eAAO,MAAM,cAAc,4IAIzB,CAAC;AAEH,eAAO,MAAM,iBAAiB,4IAG5B,CAAC;AAEH,eAAO,MAAM,cAAc;;oEAYzB,CAAC;AAEH,eAAO,MAAM,YAAY,4IAKvB,CAAC"}
|
|
@@ -1,8 +1,21 @@
|
|
|
1
|
+
import type { SwapperType } from 'rango-sdk';
|
|
1
2
|
import type { ReactNode } from 'react';
|
|
2
3
|
import type { SwapInputProps } from 'src/containers/SwapInput/SwapInput.types';
|
|
3
4
|
type BaseStep = Pick<SwapInputProps, 'chain' | 'token' | 'price'>;
|
|
5
|
+
type SwapperInfo = SwapInputProps['chain'] & {
|
|
6
|
+
type?: SwapperType;
|
|
7
|
+
};
|
|
8
|
+
export type InternalSwap = {
|
|
9
|
+
swapper: SwapperInfo;
|
|
10
|
+
from: {
|
|
11
|
+
blockchain: string;
|
|
12
|
+
};
|
|
13
|
+
to: {
|
|
14
|
+
blockchain: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
4
17
|
export type Step = {
|
|
5
|
-
swapper:
|
|
18
|
+
swapper: SwapperInfo;
|
|
6
19
|
from: BaseStep;
|
|
7
20
|
to: BaseStep;
|
|
8
21
|
error?: {
|
|
@@ -11,6 +24,7 @@ export type Step = {
|
|
|
11
24
|
};
|
|
12
25
|
alerts?: ReactNode;
|
|
13
26
|
state?: 'error' | 'warning';
|
|
27
|
+
internalSwaps?: InternalSwap[];
|
|
14
28
|
};
|
|
15
29
|
export type StepDetailsProps = {
|
|
16
30
|
step: Step;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepDetails.types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/StepDetails/StepDetails.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAE/E,KAAK,QAAQ,GAAG,IAAI,CAAC,cAAc,EAAE,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC,CAAC;AAElE,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"StepDetails.types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/StepDetails/StepDetails.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAE/E,KAAK,QAAQ,GAAG,IAAI,CAAC,cAAc,EAAE,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC,CAAC;AAElE,KAAK,WAAW,GAAG,cAAc,CAAC,OAAO,CAAC,GAAG;IAC3C,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,WAAW,CAAC;IACrB,IAAI,EAAE;QACJ,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,EAAE,EAAE;QACF,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,IAAI,GAAG;IACjB,OAAO,EAAE,WAAW,CAAC;IACrB,IAAI,EAAE,QAAQ,CAAC;IACf,EAAE,EAAE,QAAQ,CAAC;IACb,KAAK,CAAC,EAAE;QACN,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,IAAI,CAAC;IACX,YAAY,EAAE,OAAO,CAAC;IACtB,IAAI,EAAE,eAAe,GAAG,eAAe,CAAC;IACxC,KAAK,CAAC,EAAE,SAAS,GAAG,aAAa,GAAG,WAAW,GAAG,SAAS,GAAG,OAAO,CAAC;IACtE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,WAAW,CAAC;CAChC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { styled } from '../../theme';
|
|
2
2
|
|
|
3
3
|
export const StyledEllipse = styled('ellipse', {
|
|
4
|
-
cx: 12.
|
|
5
|
-
cy: 12.
|
|
6
|
-
rx: 7.
|
|
7
|
-
ry: 7.
|
|
4
|
+
cx: '12.5px',
|
|
5
|
+
cy: '12.5px',
|
|
6
|
+
rx: '7.7px',
|
|
7
|
+
ry: '7.7px',
|
|
8
8
|
strokeLinecap: 'round',
|
|
9
9
|
fill: 'none',
|
|
10
10
|
strokeDasharray: 100,
|
|
@@ -12,6 +12,7 @@ export const Container = styled('div', {
|
|
|
12
12
|
type: {
|
|
13
13
|
'quote-details': { border: 'none' },
|
|
14
14
|
'swap-progress': {
|
|
15
|
+
backgroundColor: '$neutral100',
|
|
15
16
|
$$color: '$colors$neutral100',
|
|
16
17
|
[`.${darkTheme} &`]: {
|
|
17
18
|
$$color: '$colors$neutral300',
|
|
@@ -33,10 +34,6 @@ export const Container = styled('div', {
|
|
|
33
34
|
error: { borderColor: '$error500' },
|
|
34
35
|
},
|
|
35
36
|
},
|
|
36
|
-
'& .swapper__description': {
|
|
37
|
-
fontWeight: '$medium',
|
|
38
|
-
},
|
|
39
|
-
'& div:nth-child(3)': { display: 'flex', flexDirection: 'column', flex: 1 },
|
|
40
37
|
});
|
|
41
38
|
|
|
42
39
|
export const SwapperImage = styled('div', {
|
|
@@ -86,6 +83,26 @@ export const DashedLine = styled('div', {
|
|
|
86
83
|
},
|
|
87
84
|
});
|
|
88
85
|
|
|
86
|
+
export const SwapperSeparator = styled('div', {
|
|
87
|
+
borderLeft: '1px solid transparent',
|
|
88
|
+
margin: '0 $12',
|
|
89
|
+
display: 'block',
|
|
90
|
+
height: '8px',
|
|
91
|
+
variants: {
|
|
92
|
+
state: {
|
|
93
|
+
default: {
|
|
94
|
+
borderColor: 'transparent',
|
|
95
|
+
},
|
|
96
|
+
'in-progress': { borderColor: '$info500' },
|
|
97
|
+
completed: {
|
|
98
|
+
borderColor: '$success500',
|
|
99
|
+
},
|
|
100
|
+
warning: { borderColor: '$warning500' },
|
|
101
|
+
error: { borderColor: '$error500' },
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
});
|
|
105
|
+
|
|
89
106
|
export const StepSeparator = styled('div', {
|
|
90
107
|
borderLeft: '1px dashed transparent',
|
|
91
108
|
margin: '0 $10',
|
|
@@ -114,7 +131,13 @@ export const tokensContainerStyles = css({
|
|
|
114
131
|
width: '100%',
|
|
115
132
|
});
|
|
116
133
|
|
|
117
|
-
export const
|
|
134
|
+
export const swappersStyles = css({
|
|
135
|
+
display: 'flex',
|
|
136
|
+
flexDirection: 'column',
|
|
137
|
+
justifyContent: 'center',
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
export const swapperItemStyles = css({
|
|
118
141
|
display: 'flex',
|
|
119
142
|
alignItems: 'center',
|
|
120
143
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { StepDetailsProps } from './StepDetails.types';
|
|
1
|
+
import type { InternalSwap, StepDetailsProps } from './StepDetails.types';
|
|
2
2
|
|
|
3
3
|
import { i18n } from '@lingui/core';
|
|
4
|
-
import React, { forwardRef, memo, useEffect, useRef } from 'react';
|
|
4
|
+
import React, { forwardRef, Fragment, memo, useEffect, useRef } from 'react';
|
|
5
5
|
|
|
6
6
|
import { ChainToken } from '../../components/ChainToken/ChainToken';
|
|
7
7
|
import { NextIcon } from '../../icons';
|
|
@@ -17,7 +17,9 @@ import {
|
|
|
17
17
|
stepInfoStyles,
|
|
18
18
|
StepSeparator,
|
|
19
19
|
SwapperImage,
|
|
20
|
-
|
|
20
|
+
swapperItemStyles,
|
|
21
|
+
SwapperSeparator,
|
|
22
|
+
swappersStyles,
|
|
21
23
|
tokensContainerStyles,
|
|
22
24
|
tokensStyles,
|
|
23
25
|
} from './StepDetails.styles';
|
|
@@ -33,8 +35,20 @@ const StepDetailsComponent = forwardRef<HTMLDivElement, StepDetailsProps>(
|
|
|
33
35
|
tabIndex,
|
|
34
36
|
tooltipContainer,
|
|
35
37
|
} = props;
|
|
38
|
+
|
|
39
|
+
const { from, to, swapper } = step;
|
|
36
40
|
const containerRef = useRef<HTMLDivElement>(null);
|
|
37
41
|
const isCompleted = state === 'completed' || state === 'error';
|
|
42
|
+
const swappers: InternalSwap[] = step.internalSwaps?.length
|
|
43
|
+
? step.internalSwaps
|
|
44
|
+
: [
|
|
45
|
+
{
|
|
46
|
+
from: { blockchain: from.chain.displayName },
|
|
47
|
+
to: { blockchain: to.chain.displayName },
|
|
48
|
+
swapper,
|
|
49
|
+
},
|
|
50
|
+
];
|
|
51
|
+
|
|
38
52
|
useEffect(() => {
|
|
39
53
|
const parentElement = (parentRef as React.RefObject<HTMLDivElement>)
|
|
40
54
|
?.current;
|
|
@@ -51,27 +65,63 @@ const StepDetailsComponent = forwardRef<HTMLDivElement, StepDetailsProps>(
|
|
|
51
65
|
state={state}
|
|
52
66
|
ref={containerRef}
|
|
53
67
|
tabIndex={tabIndex}>
|
|
54
|
-
|
|
55
|
-
{
|
|
56
|
-
<
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
<
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
{type === 'quote-details' && (
|
|
69
|
+
<div className={swapperItemStyles()}>
|
|
70
|
+
<SwapperImage state={state}>
|
|
71
|
+
<Image size={22} src={step.swapper.image} />
|
|
72
|
+
</SwapperImage>
|
|
73
|
+
<Typography ml={8} size="medium" variant="label">
|
|
74
|
+
{i18n.t({
|
|
75
|
+
id: 'Swap on {fromChain} via {swapper}',
|
|
76
|
+
values: {
|
|
77
|
+
fromChain: step.from.chain.displayName,
|
|
78
|
+
swapper: step.swapper.displayName,
|
|
79
|
+
},
|
|
80
|
+
})}
|
|
81
|
+
</Typography>
|
|
82
|
+
</div>
|
|
83
|
+
)}
|
|
84
|
+
|
|
85
|
+
{type === 'swap-progress' && (
|
|
86
|
+
<div className={swappersStyles()}>
|
|
87
|
+
{hasSeparator && <StepSeparator state={state} />}
|
|
88
|
+
{swappers.map((swapperItem, index) => {
|
|
89
|
+
const key = `${swapperItem.swapper.displayName}-${index}`;
|
|
90
|
+
return (
|
|
91
|
+
<Fragment key={key}>
|
|
92
|
+
<div
|
|
93
|
+
id={swapperItem.swapper.displayName}
|
|
94
|
+
className={swapperItemStyles()}>
|
|
95
|
+
<SwapperImage state={state}>
|
|
96
|
+
<Image size={22} src={swapperItem.swapper.image} />
|
|
97
|
+
</SwapperImage>
|
|
98
|
+
<Typography ml={8} size="medium" variant="label">
|
|
99
|
+
{swapperItem?.swapper.type === 'DEX'
|
|
100
|
+
? i18n.t({
|
|
101
|
+
id: 'Swap on {fromChain} via {swapper}',
|
|
102
|
+
values: {
|
|
103
|
+
fromChain: swapperItem.from.blockchain,
|
|
104
|
+
swapper: swapperItem.swapper.displayName,
|
|
105
|
+
},
|
|
106
|
+
})
|
|
107
|
+
: i18n.t({
|
|
108
|
+
id: 'Bridge to {toChain} via {swapper}',
|
|
109
|
+
values: {
|
|
110
|
+
toChain: swapperItem.to.blockchain,
|
|
111
|
+
swapper: swapperItem.swapper.displayName,
|
|
112
|
+
},
|
|
113
|
+
})}
|
|
114
|
+
</Typography>
|
|
115
|
+
</div>
|
|
116
|
+
{index !== swappers.length - 1 && (
|
|
117
|
+
<SwapperSeparator state={state} />
|
|
118
|
+
)}
|
|
119
|
+
</Fragment>
|
|
120
|
+
);
|
|
72
121
|
})}
|
|
73
|
-
</
|
|
74
|
-
|
|
122
|
+
</div>
|
|
123
|
+
)}
|
|
124
|
+
|
|
75
125
|
<div className={stepInfoStyles()}>
|
|
76
126
|
<DashedLine invisible={!hasSeparator || type === 'swap-progress'} />
|
|
77
127
|
<div className={tokensContainerStyles()}>
|
|
@@ -1,10 +1,25 @@
|
|
|
1
|
+
import type { SwapperType } from 'rango-sdk';
|
|
1
2
|
import type { ReactNode } from 'react';
|
|
2
3
|
import type { SwapInputProps } from 'src/containers/SwapInput/SwapInput.types';
|
|
3
4
|
|
|
4
5
|
type BaseStep = Pick<SwapInputProps, 'chain' | 'token' | 'price'>;
|
|
5
6
|
|
|
7
|
+
type SwapperInfo = SwapInputProps['chain'] & {
|
|
8
|
+
type?: SwapperType;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export type InternalSwap = {
|
|
12
|
+
swapper: SwapperInfo;
|
|
13
|
+
from: {
|
|
14
|
+
blockchain: string;
|
|
15
|
+
};
|
|
16
|
+
to: {
|
|
17
|
+
blockchain: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
|
|
6
21
|
export type Step = {
|
|
7
|
-
swapper:
|
|
22
|
+
swapper: SwapperInfo;
|
|
8
23
|
from: BaseStep;
|
|
9
24
|
to: BaseStep;
|
|
10
25
|
error?: {
|
|
@@ -13,6 +28,7 @@ export type Step = {
|
|
|
13
28
|
};
|
|
14
29
|
alerts?: ReactNode;
|
|
15
30
|
state?: 'error' | 'warning';
|
|
31
|
+
internalSwaps?: InternalSwap[];
|
|
16
32
|
};
|
|
17
33
|
|
|
18
34
|
export type StepDetailsProps = {
|