@rango-dev/ui 0.1.10-next.91 → 0.1.10

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.
Files changed (116) hide show
  1. package/README.md +1 -181
  2. package/dist/components/Alert/Alert.d.ts +3 -2
  3. package/dist/components/Alert/LoadingFailedAlert.d.ts +2 -0
  4. package/dist/components/Alert/NotFoundAlert.d.ts +7 -0
  5. package/dist/components/Alert/index.d.ts +1 -0
  6. package/dist/components/BlockchainSelector/BlockchainSelector.d.ts +1 -1
  7. package/dist/components/Button/Button.d.ts +3 -3
  8. package/dist/components/Divider/Divider.d.ts +6 -0
  9. package/dist/components/Divider/index.d.ts +1 -0
  10. package/dist/components/Header/Header.d.ts +9 -0
  11. package/dist/components/Header/index.d.ts +1 -0
  12. package/dist/components/Icon/ArrowRightIcon.d.ts +3 -0
  13. package/dist/components/Icon/ChevronRightIcon.d.ts +3 -0
  14. package/dist/components/Icon/DisconnectIcon.d.ts +3 -0
  15. package/dist/components/Icon/index.d.ts +3 -0
  16. package/dist/components/Icon/types.d.ts +1 -1
  17. package/dist/components/LiquiditySourceList/LiquiditySourceList.d.ts +3 -1
  18. package/dist/components/LiquiditySourcesSelector/LiquiditySourcesSelector.d.ts +2 -1
  19. package/dist/components/SelectableWalletList/mock.d.ts +1 -1
  20. package/dist/components/Settings/Settings.d.ts +2 -1
  21. package/dist/components/Spacer/Spacer.d.ts +1 -1
  22. package/dist/components/SwapContainer/SwapContainer.d.ts +1 -0
  23. package/dist/components/SwapDetail/Token.d.ts +16 -0
  24. package/dist/components/TextField/TextField.stories.d.ts +1 -1
  25. package/dist/components/TokenSelector/TokenSelector.d.ts +3 -0
  26. package/dist/components/Typography/Typography.d.ts +3 -2
  27. package/dist/components/index.d.ts +2 -0
  28. package/dist/containers/ConfirmSwap/ConfirmSwap.d.ts +10 -17
  29. package/dist/containers/ConfirmSwap/ConfirmSwap.stories.d.ts +1 -0
  30. package/dist/containers/ConfirmSwap/mock.d.ts +3 -0
  31. package/dist/containers/History/History.d.ts +6 -1
  32. package/dist/containers/History/index.d.ts +1 -1
  33. package/dist/containers/History/types.d.ts +3 -24
  34. package/dist/containers/SwapHistory/SwapHistory.d.ts +16 -3
  35. package/dist/containers/SwapHistory/SwapMessages.d.ts +17 -0
  36. package/dist/containers/index.d.ts +0 -1
  37. package/dist/helper/index.d.ts +1 -0
  38. package/dist/types/meta.d.ts +1 -0
  39. package/dist/ui.cjs.development.js +1455 -1033
  40. package/dist/ui.cjs.development.js.map +1 -1
  41. package/dist/ui.cjs.production.min.js +1 -1
  42. package/dist/ui.cjs.production.min.js.map +1 -1
  43. package/dist/ui.esm.js +1463 -1046
  44. package/dist/ui.esm.js.map +1 -1
  45. package/package.json +3 -2
  46. package/src/components/Alert/Alert.tsx +63 -39
  47. package/src/components/Alert/LoadingFailedAlert.tsx +11 -0
  48. package/src/components/Alert/NotFoundAlert.tsx +19 -0
  49. package/src/components/Alert/index.ts +1 -0
  50. package/src/components/BestRoute/BestRoute.tsx +28 -19
  51. package/src/components/BestRoute/mock.ts +10 -0
  52. package/src/components/BlockchainSelector/BlockchainSelector.tsx +13 -21
  53. package/src/components/Button/Button.stories.tsx +1 -1
  54. package/src/components/Button/Button.tsx +36 -23
  55. package/src/components/Chip/Chip.tsx +7 -4
  56. package/src/components/ConnectWalletsModal/mockData.ts +16 -0
  57. package/src/components/Divider/Divider.tsx +41 -0
  58. package/src/components/Divider/index.ts +1 -0
  59. package/src/components/Header/Header.tsx +39 -0
  60. package/src/components/Header/index.ts +1 -0
  61. package/src/components/Icon/ArrowRightIcon.tsx +31 -0
  62. package/src/components/Icon/ChevronRightIcon.tsx +29 -0
  63. package/src/components/Icon/DisconnectIcon.tsx +31 -0
  64. package/src/components/Icon/HistoryIcon.tsx +12 -18
  65. package/src/components/Icon/RetryIcon.tsx +13 -13
  66. package/src/components/Icon/SettingIcon.tsx +6 -14
  67. package/src/components/Icon/index.ts +3 -0
  68. package/src/components/Icon/types.tsx +1 -1
  69. package/src/components/LiquiditySourceList/LiquiditySourceList.tsx +104 -30
  70. package/src/components/LiquiditySourcesSelector/LiquiditySourcesSelector.tsx +16 -11
  71. package/src/components/Radio/Radio.tsx +5 -4
  72. package/src/components/SecondaryPage/SecondaryPage.tsx +26 -52
  73. package/src/components/SelectableWalletList/SelectableWalletList.tsx +5 -1
  74. package/src/components/SelectableWalletList/mock.ts +4 -3
  75. package/src/components/Settings/Settings.tsx +47 -12
  76. package/src/components/Spacer/Spacer.tsx +31 -1
  77. package/src/components/StatusDrawer/StatusDrawer.tsx +1 -0
  78. package/src/components/StepDetail/StepDetail.tsx +19 -7
  79. package/src/components/SwapContainer/SwapContainer.tsx +22 -17
  80. package/src/components/SwapDetail/SwapDetail.tsx +77 -115
  81. package/src/components/SwapDetail/Token.tsx +68 -0
  82. package/src/components/SwapDetail/mock.ts +1 -0
  83. package/src/components/Switch/Switch.tsx +7 -5
  84. package/src/components/TextField/TextField.tsx +3 -1
  85. package/src/components/TokenList/TokenItem.tsx +4 -1
  86. package/src/components/TokenList/TokenList.tsx +16 -18
  87. package/src/components/TokenSelector/TokenSelector.tsx +47 -10
  88. package/src/components/Typography/Typography.stories.tsx +4 -0
  89. package/src/components/Typography/Typography.tsx +20 -9
  90. package/src/components/Wallet/State.tsx +2 -3
  91. package/src/components/Wallet/Wallet.tsx +33 -6
  92. package/src/components/index.ts +2 -0
  93. package/src/containers/ConfirmSwap/ConfirmSwap.stories.tsx +11 -2
  94. package/src/containers/ConfirmSwap/ConfirmSwap.tsx +103 -119
  95. package/src/containers/ConfirmSwap/mock.ts +79 -2
  96. package/src/containers/History/History.tsx +57 -38
  97. package/src/containers/History/index.ts +1 -1
  98. package/src/containers/History/mock.ts +1 -0
  99. package/src/containers/History/types.tsx +2 -30
  100. package/src/containers/SwapHistory/SwapHistory.tsx +309 -165
  101. package/src/containers/SwapHistory/SwapMessages.tsx +116 -0
  102. package/src/containers/SwapHistory/mock.ts +1 -0
  103. package/src/containers/index.ts +0 -1
  104. package/src/helper/index.ts +14 -0
  105. package/src/theme.ts +4 -2
  106. package/src/types/meta.ts +2 -0
  107. package/dist/containers/ConfirmWallets/ConfirmWallets.d.ts +0 -18
  108. package/dist/containers/ConfirmWallets/ConfirmWallets.stories.d.ts +0 -6
  109. package/dist/containers/ConfirmWallets/index.d.ts +0 -1
  110. package/dist/containers/ConfirmWallets/mock.d.ts +0 -5
  111. package/dist/helper/swaps.d.ts +0 -5
  112. package/src/containers/ConfirmWallets/ConfirmWallets.stories.tsx +0 -26
  113. package/src/containers/ConfirmWallets/ConfirmWallets.tsx +0 -118
  114. package/src/containers/ConfirmWallets/index.ts +0 -1
  115. package/src/containers/ConfirmWallets/mock.ts +0 -222
  116. package/src/helper/swaps.ts +0 -23
@@ -1,8 +1,7 @@
1
1
  import { CSSProperties } from '@stitches/react';
2
2
  import React from 'react';
3
3
  import { containsText } from '../../helper';
4
- import { styled } from '../../theme';
5
- import { LiquiditySource } from '../../types/meta';
4
+ import { LiquiditySource, LoadingStatus } from '../../types/meta';
6
5
  import { Button } from '../Button';
7
6
  import { LiquiditySourceList } from '../LiquiditySourceList';
8
7
  import { SecondaryPage } from '../SecondaryPage/SecondaryPage';
@@ -21,15 +20,19 @@ export interface PropTypes {
21
20
  onBack?: () => void;
22
21
  hasHeader?: boolean;
23
22
  listContainerStyle?: CSSProperties;
23
+ loadingStatus: LoadingStatus;
24
24
  }
25
- const ActionButton = styled(Button, {
26
- position: 'absolute',
27
- right: 0,
28
- });
29
25
 
30
26
  export function LiquiditySourcesSelector(props: PropTypes) {
31
- const { list, onChange, onBack, hasHeader, listContainerStyle, toggleAll } =
32
- props;
27
+ const {
28
+ list,
29
+ onChange,
30
+ onBack,
31
+ hasHeader,
32
+ listContainerStyle,
33
+ toggleAll,
34
+ loadingStatus,
35
+ } = props;
33
36
 
34
37
  return (
35
38
  <SecondaryPage
@@ -37,9 +40,9 @@ export function LiquiditySourcesSelector(props: PropTypes) {
37
40
  textFieldPlaceholder="Search By Name"
38
41
  title="Liquidity Sources"
39
42
  TopButton={
40
- <ActionButton variant="ghost" type="primary" onClick={toggleAll}>
41
- {list.find((item) => item.selected) ? 'Clear all' : 'Select all'}
42
- </ActionButton>
43
+ <Button variant="ghost" type="primary" onClick={toggleAll}>
44
+ {list.find((item) => item.selected) ? 'Deselect all' : 'Select all'}
45
+ </Button>
43
46
  }
44
47
  hasHeader={hasHeader}
45
48
  onBack={onBack}
@@ -49,6 +52,8 @@ export function LiquiditySourcesSelector(props: PropTypes) {
49
52
  listContainerStyle={listContainerStyle}
50
53
  list={filterLiquiditySources(list, searchedFor)}
51
54
  onChange={onChange}
55
+ loadingStatus={loadingStatus}
56
+ searchedFor={searchedFor}
52
57
  />
53
58
  )}
54
59
  </SecondaryPage>
@@ -27,14 +27,15 @@ const ItemContainer = styled('div', {
27
27
  });
28
28
  const StyledItem = styled(RadioGroup.Item, {
29
29
  padding: '0',
30
- backgroundColor: '$neutrals300',
31
30
  width: '20px',
32
31
  height: '20px',
33
32
  borderRadius: '100%',
34
- border: 'none',
35
33
  cursor: 'pointer',
34
+ backgroundColor: '$background',
35
+ border: '1px solid $neutrals400',
36
+
36
37
  '&:hover': {
37
- backgroundColor: '$neutrals400',
38
+ borderColor: '$neutrals600',
38
39
  },
39
40
  });
40
41
 
@@ -55,7 +56,7 @@ const StyledIndicator = styled(RadioGroup.Indicator, {
55
56
  width: '10px',
56
57
  height: '10px',
57
58
  borderRadius: '50%',
58
- backgroundColor: '$primary',
59
+ backgroundColor: '$success',
59
60
  },
60
61
  });
61
62
 
@@ -1,8 +1,9 @@
1
1
  import React, { ReactNode, useState } from 'react';
2
2
  import { styled } from '../../theme';
3
- import { AngleLeftIcon, SearchIcon } from '../Icon';
4
- import { TextField } from '../TextField/TextField';
5
- import { Typography } from '../Typography';
3
+ import { Divider } from '../Divider';
4
+ import { Header } from '../Header';
5
+ import { SearchIcon } from '../Icon';
6
+ import { TextField } from '../TextField';
6
7
 
7
8
  export type PropTypes = (
8
9
  | {
@@ -22,40 +23,16 @@ export type PropTypes = (
22
23
  hasHeader?: boolean;
23
24
  };
24
25
 
25
- const Container = styled('div', {
26
+ const ContentContainer = styled('div', {
27
+ overflow: 'hidden',
26
28
  display: 'flex',
27
29
  flexDirection: 'column',
28
- height: '100%',
29
- width: '100%',
30
- padding: '$12 0',
31
- position: 'relative',
32
-
33
- '@lg': {
34
- padding: '$16 0',
35
- },
36
- });
37
-
38
- const HeaderContainer = styled('div', {
39
- display: 'flex',
40
- justifyContent: 'center',
41
- alignItems: 'center',
42
- marginBottom: '$16',
43
- position: 'relative',
44
- });
45
-
46
- const BackIcon = styled(AngleLeftIcon, {
47
- position: 'absolute',
48
- left: '0',
49
- });
50
- const StyledBackIcon = styled(BackIcon, {
51
- cursor: 'pointer',
30
+ flex: '1',
31
+ padding: '0 $4',
52
32
  });
53
33
 
54
- const ContentContainer = styled('div', {
55
- flex: '1',
56
- overflowY: 'auto',
57
- overflowX: 'hidden',
58
- marginTop: '$16',
34
+ const TextFieldContainer = styled('div', {
35
+ padding: '1px',
59
36
  });
60
37
 
61
38
  export function SecondaryPage(props: PropTypes) {
@@ -63,32 +40,29 @@ export function SecondaryPage(props: PropTypes) {
63
40
  const [searchedFor, setSearchedFor] = useState('');
64
41
 
65
42
  return (
66
- <Container>
43
+ <>
67
44
  {hasHeader && (
68
- <HeaderContainer>
69
- <StyledBackIcon size={24} onClick={onBack} />
70
- <Typography variant="h4">{title}</Typography>
71
- {TopButton}
72
- </HeaderContainer>
45
+ <Header onBack={onBack} title={title || ''} suffix={TopButton} />
73
46
  )}
74
47
 
75
- {props.textField && (
76
- <div>
77
- <TextField
78
- size="large"
79
- prefix={<SearchIcon size={24} />}
80
- placeholder={props.textFieldPlaceholder}
81
- onChange={(event) => setSearchedFor(event.target.value)}
82
- value={searchedFor}
83
- autoFocus
84
- />
85
- </div>
86
- )}
87
48
  <ContentContainer>
49
+ {props.textField && (
50
+ <TextFieldContainer>
51
+ <TextField
52
+ size="large"
53
+ prefix={<SearchIcon size={24} />}
54
+ placeholder={props.textFieldPlaceholder}
55
+ onChange={(event) => setSearchedFor(event.target.value)}
56
+ value={searchedFor}
57
+ autoFocus
58
+ />
59
+ <Divider size={16} />
60
+ </TextFieldContainer>
61
+ )}
88
62
  {props.textField && props.children?.(searchedFor)}
89
63
  {!props.textField && props.children}
90
64
  </ContentContainer>
91
65
  {Footer}
92
- </Container>
66
+ </>
93
67
  );
94
68
  }
@@ -2,11 +2,11 @@ import React, { PropsWithChildren, useEffect, useState } from 'react';
2
2
  import { styled } from '../../theme';
3
3
  import { SelectableWallet } from '../../types';
4
4
  import { Typography } from '../Typography';
5
+ import { getConciseAddress } from '../../helper';
5
6
 
6
7
  const Row = styled('div', {
7
8
  display: 'flex',
8
9
  flexWrap: 'wrap',
9
- justifyContent: 'center',
10
10
  });
11
11
 
12
12
  const Circle = styled('div', {
@@ -70,6 +70,7 @@ const Container = styled('div', {
70
70
  },
71
71
  },
72
72
  });
73
+
73
74
  export interface PropTypes {
74
75
  list: SelectableWallet[];
75
76
  onChange: (w: SelectableWallet) => void;
@@ -103,6 +104,9 @@ export function SelectableWalletList({
103
104
  >
104
105
  <img src={w.image} alt={w.walletType} width={24} height={24} />
105
106
  <Typography variant="body2">{w.name}</Typography>
107
+ <Typography variant="caption">
108
+ {getConciseAddress(w.address)}
109
+ </Typography>
106
110
  <Circle checked={checked}>
107
111
  <SolidCircle checked={checked} />
108
112
  </Circle>
@@ -1,9 +1,10 @@
1
- import { WalletType } from '@rango-dev/wallets-shared';
2
- import { SelectableWallet } from '../../containers/ConfirmWallets/types';
1
+ import { Network, WalletType } from '@rango-dev/wallets-shared';
2
+ import { SelectableWallet } from '../../types';
3
3
 
4
4
  export const data: SelectableWallet[] = [
5
5
  {
6
- blockchain: 'BSC',
6
+ chain: Network.BTC,
7
+ name: Network.BTC,
7
8
  walletType: WalletType.META_MASK,
8
9
  address: '0x5423e28219d6d568dcf62a8134d623e6f4a1c2df',
9
10
  image: 'https://app.rango.exchange/wallets/metamask.svg',
@@ -4,14 +4,15 @@ import { AngleRightIcon } from '../Icon';
4
4
  import { SecondaryPage } from '../SecondaryPage/SecondaryPage';
5
5
  import { Typography } from '../Typography';
6
6
  import { Chip } from '../Chip';
7
- import { LiquiditySource } from '../../types/meta';
7
+ import { LiquiditySource, LoadingStatus } from '../../types/meta';
8
8
  import { TextField } from '../TextField';
9
9
  import { Radio } from '../Radio';
10
10
  import { Switch } from '../Switch';
11
+ import { Button } from '../Button';
11
12
 
12
13
  const BaseContainer = styled('div', {
13
14
  borderRadius: '$5',
14
- backgroundColor: '$neutrals200',
15
+ backgroundColor: '$neutrals300',
15
16
  padding: '$16',
16
17
  });
17
18
 
@@ -46,6 +47,12 @@ const LiquiditySourceNumber = styled('div', {
46
47
  const ThemesContainer = styled(BaseContainer, {
47
48
  marginTop: '$32',
48
49
  });
50
+ const Head = styled('div', {
51
+ display: 'flex',
52
+ justifyContent: 'space-between',
53
+ alignItems: 'center',
54
+ paddingBottom: '$16',
55
+ });
49
56
 
50
57
  type Theme = 'dark' | 'light' | 'auto';
51
58
 
@@ -65,6 +72,7 @@ export interface PropTypes {
65
72
  onBack: () => void;
66
73
  infiniteApprove: boolean;
67
74
  toggleInfiniteApprove: (infinite: boolean) => void;
75
+ loadingStatus: LoadingStatus;
68
76
  }
69
77
 
70
78
  export function Settings(props: PropTypes) {
@@ -83,6 +91,7 @@ export function Settings(props: PropTypes) {
83
91
  onThemeChange,
84
92
  toggleInfiniteApprove,
85
93
  infiniteApprove,
94
+ loadingStatus,
86
95
  } = props;
87
96
 
88
97
  const [selectedSlippage, setSelectedSlippage] = useState(
@@ -97,7 +106,14 @@ export function Settings(props: PropTypes) {
97
106
  const PageContent = (
98
107
  <>
99
108
  <BaseContainer>
100
- <Title variant="body1">Slippage tolerance per swap</Title>
109
+ <Head>
110
+ <Typography variant="body1">Slippage tolerance per swap</Typography>
111
+ {customSlippage ? (
112
+ <Typography variant="caption" color="error">
113
+ {customSlippage}% Custom
114
+ </Typography>
115
+ ) : undefined}
116
+ </Head>
101
117
  <SlippageChipsContainer>
102
118
  {slippages.map((slippage, index) => (
103
119
  <Chip
@@ -107,7 +123,7 @@ export function Settings(props: PropTypes) {
107
123
  changeSlippage(slippage);
108
124
  }}
109
125
  selected={!customSlippage && slippage === selectedSlippage}
110
- label={`${slippage.toString()} %`}
126
+ label={`${slippage.toString()}%`}
111
127
  style={{
112
128
  marginRight: '8px',
113
129
  }}
@@ -128,11 +144,10 @@ export function Settings(props: PropTypes) {
128
144
  customSlippage && <Typography variant="body2">%</Typography>
129
145
  }
130
146
  size="small"
131
- placeholder="Custom"
147
+ placeholder="Custom %"
132
148
  style={{
133
149
  width: '128px',
134
150
  flexGrow: 'initial',
135
- borderColor: customSlippage ? '$success' : 'initial',
136
151
  }}
137
152
  />
138
153
  </SlippageChipsContainer>
@@ -155,12 +170,32 @@ export function Settings(props: PropTypes) {
155
170
  <Typography variant="body1">Infinite Approval</Typography>
156
171
  <Switch checked={infiniteApprove} onChange={toggleInfiniteApprove} />
157
172
  </InfiniteContainer>
158
- <LiquiditySourceContainer onClick={onLiquiditySourcesClick}>
159
- <Typography variant="body1">Liquidity Sources</Typography>
160
- <LiquiditySourceNumber>
161
- <Typography variant="body2">{`( ${selectedLiquiditySources.length} / ${liquiditySources.length} )`}</Typography>
162
- <StyledAngleRight />
163
- </LiquiditySourceNumber>
173
+ <LiquiditySourceContainer>
174
+ <Button
175
+ onClick={onLiquiditySourcesClick}
176
+ align="start"
177
+ variant="ghost"
178
+ loading={loadingStatus === 'loading'}
179
+ suffix={
180
+ <LiquiditySourceNumber>
181
+ {loadingStatus === 'success' && (
182
+ <Typography variant="body2" color="neutrals800">
183
+ {liquiditySources.length !== selectedLiquiditySources.length
184
+ ? `${selectedLiquiditySources.length} / ${liquiditySources.length}`
185
+ : liquiditySources.length}
186
+ </Typography>
187
+ )}
188
+ {loadingStatus === 'failed' && (
189
+ <Typography variant="body2" color="$error500">
190
+ Loading failed
191
+ </Typography>
192
+ )}
193
+ <StyledAngleRight />
194
+ </LiquiditySourceNumber>
195
+ }
196
+ >
197
+ <Typography variant="body1">Liquidity Sources</Typography>
198
+ </Button>
164
199
  </LiquiditySourceContainer>
165
200
  </>
166
201
  );
@@ -4,6 +4,8 @@ import { styled } from '../../theme';
4
4
  const SpacerContainer = styled('div', {
5
5
  variants: {
6
6
  size: {
7
+ 4: {},
8
+ 8: {},
7
9
  12: {},
8
10
  16: {},
9
11
  18: {},
@@ -16,6 +18,34 @@ const SpacerContainer = styled('div', {
16
18
  },
17
19
  },
18
20
  compoundVariants: [
21
+ {
22
+ size: 4,
23
+ direction: 'horizontal',
24
+ css: {
25
+ width: '$4',
26
+ },
27
+ },
28
+ {
29
+ size: 4,
30
+ direction: 'vertical',
31
+ css: {
32
+ height: '$4',
33
+ },
34
+ },
35
+ {
36
+ size: 8,
37
+ direction: 'horizontal',
38
+ css: {
39
+ width: '$8',
40
+ },
41
+ },
42
+ {
43
+ size: 8,
44
+ direction: 'vertical',
45
+ css: {
46
+ height: '$8',
47
+ },
48
+ },
19
49
  {
20
50
  size: 12,
21
51
  direction: 'horizontal',
@@ -89,7 +119,7 @@ const SpacerContainer = styled('div', {
89
119
  ],
90
120
  });
91
121
  export interface PropTypes {
92
- size?: 12 | 16 | 18 | 20 | 24;
122
+ size?: 4 | 8 | 12 | 16 | 18 | 20 | 24;
93
123
  direction?: 'vertical' | 'horizontal';
94
124
  }
95
125
 
@@ -37,6 +37,7 @@ export function StatusDrawer({
37
37
  }: PropTypes) {
38
38
  return (
39
39
  <Drawer
40
+ container={document.body}
40
41
  content={
41
42
  <>
42
43
  <Header>
@@ -21,12 +21,21 @@ const Logo = styled('img', {
21
21
  borderRadius: '50%',
22
22
  });
23
23
 
24
- const ChainLogo = styled('img', {
24
+ const ChainLogo = styled('div', {
25
25
  position: 'absolute',
26
- bottom: 0,
27
- width: '$12',
28
- height: '$12',
29
- right: 0,
26
+ right: -4,
27
+ bottom: -4,
28
+ width: '$16',
29
+ height: '$16',
30
+ padding: '$2',
31
+ borderRadius: '50%',
32
+ backgroundColor: '$background',
33
+ border: '1px solid $neutrals400',
34
+
35
+ img: {
36
+ width: '100%',
37
+ display: 'block',
38
+ },
30
39
  });
31
40
  const StepContainer = styled('div', {
32
41
  display: 'flex',
@@ -60,6 +69,7 @@ const Detail = styled('div', {
60
69
  });
61
70
  const SubTitle = styled(Typography, {
62
71
  color: '$neutrals600',
72
+ display: 'block',
63
73
  });
64
74
  export interface PropTypes {
65
75
  logo: string;
@@ -82,13 +92,15 @@ export function StepDetail({
82
92
  <StepContainer direction={direction}>
83
93
  <StepLogoContainer direction={direction}>
84
94
  <Logo src={logo} alt={symbol} />
85
- <ChainLogo src={chainLogo} alt={blockchain} />
95
+ <ChainLogo>
96
+ <img src={chainLogo} alt={blockchain} />
97
+ </ChainLogo>
86
98
  </StepLogoContainer>
87
99
  <Detail pl={direction === 'horizontal'}>
88
100
  <Typography noWrap variant={direction === 'vertical' ? 'body2' : 'h6'}>
89
101
  {amount ? parseFloat(amount).toFixed(2) : '?'} {symbol}
90
102
  </Typography>
91
- <SubTitle noWrap variant="caption">
103
+ <SubTitle noWrap variant="caption" color="neutrals800">
92
104
  on {blockchain}
93
105
  </SubTitle>
94
106
  </Detail>
@@ -3,36 +3,41 @@ import React, { PropsWithChildren } from 'react';
3
3
  import { styled } from '../../theme';
4
4
 
5
5
  const MainContainer = styled('div', {
6
+ position: 'relative',
7
+ display: 'flex',
8
+ flexDirection: 'column',
6
9
  borderRadius: '$10',
7
- maxWidth: '512px',
8
10
  boxShadow: '$s',
9
- minWidth: '375px',
10
11
  width: '100%',
11
- backgroundColor: '$background',
12
- height: 'fit-content',
13
- display: 'flex',
14
- flexDirection: 'column',
15
- alignItems: 'end',
16
- padding: '$16 $24',
12
+ minWidth: '375px',
13
+ maxWidth: '512px',
14
+ maxHeight: '595px',
15
+ padding: '$16',
17
16
  boxSizing: 'border-box',
18
- position: 'relative',
19
- });
20
-
21
- const ContentContainer = styled('div', {
22
- width: '100%',
23
- // maxHeight: '600px',
17
+ backgroundColor: '$background',
18
+ variants: {
19
+ fixedHeight: {
20
+ true: {
21
+ height: '595px',
22
+ },
23
+ false: {
24
+ height: 'auto',
25
+ },
26
+ },
27
+ },
24
28
  });
25
29
 
26
30
  export interface PropTypes {
27
31
  style?: CSSProperties;
32
+ fixedHeight?: boolean;
28
33
  }
29
34
 
30
35
  export function SwapContainer(props: PropsWithChildren<PropTypes>) {
31
- const { children, style } = props;
36
+ const { children, style, fixedHeight = true } = props;
32
37
 
33
38
  return (
34
- <MainContainer style={style} id="swap-box">
35
- <ContentContainer>{children}</ContentContainer>
39
+ <MainContainer style={style} id="swap-box" fixedHeight={fixedHeight}>
40
+ {children}
36
41
  </MainContainer>
37
42
  );
38
43
  }