@rango-dev/widget-embedded 0.1.10-next.98 → 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 (110) hide show
  1. package/dist/App.d.ts.map +1 -1
  2. package/dist/QueueManager.d.ts.map +1 -1
  3. package/dist/components/AppRouter.d.ts +6 -1
  4. package/dist/components/AppRouter.d.ts.map +1 -1
  5. package/dist/components/AppRoutes.d.ts.map +1 -1
  6. package/dist/components/ChangeSlippageButton.d.ts.map +1 -1
  7. package/dist/components/HeaderButtons.d.ts +4 -1
  8. package/dist/components/HeaderButtons.d.ts.map +1 -1
  9. package/dist/components/Layout.d.ts.map +1 -1
  10. package/dist/components/RoutesOverview.d.ts +10 -0
  11. package/dist/components/RoutesOverview.d.ts.map +1 -0
  12. package/dist/components/SwapDetailsPlaceholder.d.ts +9 -0
  13. package/dist/components/SwapDetailsPlaceholder.d.ts.map +1 -0
  14. package/dist/components/TokenInfo.d.ts.map +1 -1
  15. package/dist/components/TokenPreview.d.ts +20 -0
  16. package/dist/components/TokenPreview.d.ts.map +1 -0
  17. package/dist/components/UpdateUrl.d.ts.map +1 -1
  18. package/dist/components/warnings/BalanceWarnings.d.ts.map +1 -1
  19. package/dist/components/warnings/HighSlippageWarning.d.ts.map +1 -1
  20. package/dist/components/warnings/MinRequiredSlippage.d.ts +1 -1
  21. package/dist/components/warnings/MinRequiredSlippage.d.ts.map +1 -1
  22. package/dist/constants/navigationRoutes.d.ts +0 -1
  23. package/dist/constants/navigationRoutes.d.ts.map +1 -1
  24. package/dist/globalStyles.d.ts.map +1 -1
  25. package/dist/hooks/useConfirmSwap.d.ts.map +1 -1
  26. package/dist/lib.d.ts.map +1 -1
  27. package/dist/pages/ConfirmSwapPage.d.ts.map +1 -1
  28. package/dist/pages/HistoryPage.d.ts.map +1 -1
  29. package/dist/pages/Home.d.ts.map +1 -1
  30. package/dist/pages/LiquiditySourcesPage.d.ts.map +1 -1
  31. package/dist/pages/SelectTokenPage.d.ts.map +1 -1
  32. package/dist/pages/SettingsPage.d.ts.map +1 -1
  33. package/dist/pages/SwapDetailsPage.d.ts.map +1 -1
  34. package/dist/pages/WalletsPage.d.ts +1 -0
  35. package/dist/pages/WalletsPage.d.ts.map +1 -1
  36. package/dist/store/bestRoute.d.ts +2 -0
  37. package/dist/store/bestRoute.d.ts.map +1 -1
  38. package/dist/store/ui.d.ts.map +1 -1
  39. package/dist/store/wallets.d.ts +14 -0
  40. package/dist/store/wallets.d.ts.map +1 -1
  41. package/dist/types/routing.d.ts +1 -1
  42. package/dist/types/swap.d.ts +6 -0
  43. package/dist/types/swap.d.ts.map +1 -1
  44. package/dist/utils/common.d.ts +1 -0
  45. package/dist/utils/common.d.ts.map +1 -1
  46. package/dist/utils/date.d.ts +3 -0
  47. package/dist/utils/date.d.ts.map +1 -0
  48. package/dist/utils/routing.d.ts +1 -0
  49. package/dist/utils/routing.d.ts.map +1 -1
  50. package/dist/utils/swap.d.ts +18 -6
  51. package/dist/utils/swap.d.ts.map +1 -1
  52. package/dist/utils/time.d.ts +4 -0
  53. package/dist/utils/time.d.ts.map +1 -0
  54. package/dist/utils/wallets.d.ts +1 -1
  55. package/dist/utils/wallets.d.ts.map +1 -1
  56. package/dist/widget-embedded.cjs.development.js +1004 -418
  57. package/dist/widget-embedded.cjs.development.js.map +1 -1
  58. package/dist/widget-embedded.cjs.production.min.js +1004 -418
  59. package/dist/widget-embedded.cjs.production.min.js.map +1 -1
  60. package/dist/widget-embedded.esm.js +1008 -423
  61. package/dist/widget-embedded.esm.js.map +1 -1
  62. package/package.json +12 -11
  63. package/readme.md +1 -2
  64. package/src/App.tsx +30 -5
  65. package/src/QueueManager.tsx +5 -2
  66. package/src/components/AppRouter.tsx +24 -13
  67. package/src/components/AppRoutes.tsx +15 -12
  68. package/src/components/ChangeSlippageButton.tsx +4 -8
  69. package/src/components/HeaderButtons.tsx +11 -4
  70. package/src/components/Layout.tsx +37 -5
  71. package/src/components/RoutesOverview.tsx +60 -0
  72. package/src/components/SwapDetailsPlaceholder.tsx +32 -0
  73. package/src/components/TokenInfo.tsx +125 -77
  74. package/src/components/TokenPreview.tsx +178 -0
  75. package/src/components/UpdateUrl.tsx +1 -3
  76. package/src/components/warnings/BalanceWarnings.tsx +1 -0
  77. package/src/components/warnings/HighSlippageWarning.tsx +4 -7
  78. package/src/components/warnings/MinRequiredSlippage.tsx +9 -4
  79. package/src/constants/navigationRoutes.ts +0 -1
  80. package/src/globalStyles.ts +3 -2
  81. package/src/hooks/useConfirmSwap.ts +2 -1
  82. package/src/hooks/useNavigateBack.ts +3 -3
  83. package/src/hooks/useTheme.ts +9 -9
  84. package/src/languages/en.json +9 -8
  85. package/src/lib.tsx +25 -3
  86. package/src/pages/ConfirmSwapPage.tsx +128 -20
  87. package/src/pages/HistoryPage.tsx +4 -4
  88. package/src/pages/Home.tsx +51 -42
  89. package/src/pages/LiquiditySourcesPage.tsx +2 -0
  90. package/src/pages/SelectTokenPage.tsx +3 -1
  91. package/src/pages/SettingsPage.tsx +3 -0
  92. package/src/pages/SwapDetailsPage.tsx +142 -6
  93. package/src/pages/WalletsPage.tsx +49 -16
  94. package/src/store/bestRoute.ts +114 -17
  95. package/src/store/ui.ts +4 -0
  96. package/src/store/wallets.ts +4 -1
  97. package/src/types/routing.ts +1 -1
  98. package/src/types/swap.ts +7 -0
  99. package/src/utils/common.ts +14 -0
  100. package/src/utils/date.ts +62 -0
  101. package/src/utils/routing.ts +23 -13
  102. package/src/utils/swap.ts +113 -11
  103. package/src/utils/time.ts +52 -0
  104. package/src/utils/wallets.ts +13 -4
  105. package/dist/components/Header.d.ts +0 -10
  106. package/dist/components/Header.d.ts.map +0 -1
  107. package/dist/pages/ConfirmWalletsPage.d.ts +0 -3
  108. package/dist/pages/ConfirmWalletsPage.d.ts.map +0 -1
  109. package/src/components/Header.tsx +0 -37
  110. package/src/pages/ConfirmWalletsPage.tsx +0 -80
@@ -16,6 +16,7 @@ import BigNumber from 'bignumber.js';
16
16
  import { getBalanceFromWallet } from '../utils/wallets';
17
17
  import { useWalletsStore } from '../store/wallets';
18
18
  import { useTranslation } from 'react-i18next';
19
+ import { Spacer } from '@rango-dev/ui';
19
20
 
20
21
  type PropTypes = (
21
22
  | {
@@ -38,14 +39,46 @@ const Box = styled('div', {
38
39
 
39
40
  const Container = styled('div', {
40
41
  boxSizing: 'border-box',
41
- backgroundColor: '$neutrals300',
42
42
  borderRadius: '$5',
43
- padding: '$8 0',
43
+ padding: '$8 $16 $16 $16',
44
+
45
+ variants: {
46
+ type: {
47
+ filled: {
48
+ backgroundColor: '$neutrals300',
49
+ },
50
+ outlined: {
51
+ border: '1px solid $neutrals300',
52
+ },
53
+ },
54
+ },
55
+
56
+ defaultVariants: {
57
+ type: 'filled',
58
+ },
44
59
 
60
+ '.head': {
61
+ display: 'flex',
62
+ justifyContent: 'space-between',
63
+ alignItems: 'center',
64
+ minHeight: '32px',
65
+ },
45
66
  '.form': {
46
67
  display: 'flex',
47
68
  width: '100%',
48
- padding: '$8 $16',
69
+ padding: '$2 0',
70
+ '.selectors': {
71
+ width: '35%',
72
+
73
+ '._text': {
74
+ whiteSpace: 'nowrap',
75
+ overflow: 'hidden',
76
+ textOverflow: 'ellipsis',
77
+ },
78
+ },
79
+ '.amount': {
80
+ width: '30%',
81
+ },
49
82
  },
50
83
  });
51
84
 
@@ -57,7 +90,11 @@ const StyledImage = styled('img', {
57
90
  const Options = styled('div', {
58
91
  display: 'flex',
59
92
  justifyContent: 'flex-end',
60
- padding: '0 $8',
93
+
94
+ '.balance': {
95
+ display: 'flex',
96
+ alignItems: 'center',
97
+ },
61
98
  });
62
99
 
63
100
  const ImagePlaceholder = styled('span', {
@@ -68,10 +105,9 @@ const ImagePlaceholder = styled('span', {
68
105
  });
69
106
 
70
107
  const OutputContainer = styled('div', {
108
+ windth: '100%',
71
109
  height: '$48',
72
110
  borderRadius: '$5',
73
- flexGrow: 1,
74
- width: '70%',
75
111
  backgroundColor: '$background',
76
112
  border: '1px solid transparent',
77
113
  position: 'relative',
@@ -141,29 +177,39 @@ export function TokenInfo(props: PropTypes) {
141
177
 
142
178
  return (
143
179
  <Box>
144
- <div>
145
- <Typography variant="body2">{t(type)}</Typography>
146
- </div>
147
- <Container>
148
- {props.type === 'From' && (
149
- <Options>
150
- <div
151
- className="balance"
152
- onClick={() => {
153
- if (tokenBalance !== '0')
154
- setInputAmount(tokenBalanceReal.split(',').join(''));
155
- }}
156
- >
157
- <Button variant="ghost" size="small">
158
- <Typography variant="body2">{`${t('Max')}: ${tokenBalance} ${
159
- fromToken?.symbol || ''
160
- }`}</Typography>
161
- </Button>
162
- </div>
163
- </Options>
164
- )}
180
+ <Container type={props.type === 'From' ? 'filled' : 'outlined'}>
181
+ <div className="head">
182
+ <Typography variant="body2" color="neutrals800">
183
+ {t(type)}
184
+ </Typography>
185
+ {props.type === 'From' ? (
186
+ <Options>
187
+ <div
188
+ className="balance"
189
+ onClick={() => {
190
+ if (tokenBalance !== '0')
191
+ setInputAmount(tokenBalanceReal.split(',').join(''));
192
+ }}
193
+ >
194
+ <Typography variant="body3" color="neutrals600">{`${t(
195
+ 'Balance'
196
+ )}: ${tokenBalance} ${fromToken?.symbol || ''}`}</Typography>
197
+ <Spacer size={4} />
198
+ <Button type="primary" variant="ghost" size="compact">
199
+ {t('Max')}
200
+ </Button>
201
+ </div>
202
+ </Options>
203
+ ) : (
204
+ <Typography
205
+ variant="caption"
206
+ color="neutrals600"
207
+ >{`$${numberToString(props.outputUsdValue)}`}</Typography>
208
+ )}
209
+ </div>
165
210
  <div className="form">
166
211
  <Button
212
+ className="selectors"
167
213
  onClick={() => {
168
214
  navigate(`/${props.type.toLowerCase()}-chain`);
169
215
  }}
@@ -180,11 +226,14 @@ export function TokenInfo(props: PropTypes) {
180
226
  suffix={ItemSuffix}
181
227
  align="start"
182
228
  size="large"
183
- style={{ marginRight: '.5rem' }}
184
229
  >
185
- {loadingStatus === 'success' && chain ? chain.displayName : t('Chain')}
230
+ {loadingStatus === 'success' && chain
231
+ ? chain.displayName
232
+ : t('Chain')}
186
233
  </Button>
234
+ <Spacer size={12} />
187
235
  <Button
236
+ className="selectors"
188
237
  onClick={() => {
189
238
  navigate(`/${props.type.toLowerCase()}-token`);
190
239
  }}
@@ -205,57 +254,56 @@ export function TokenInfo(props: PropTypes) {
205
254
  suffix={ItemSuffix}
206
255
  size="large"
207
256
  align="start"
208
- style={{ marginRight: '.5rem' }}
209
257
  >
210
258
  {loadingStatus === 'success' && token ? token.symbol : t('Token')}
211
259
  </Button>
212
- {props.type === 'From' ? (
213
- <TextField
214
- type="number"
215
- size="large"
216
- autoFocus
217
- placeholder="0"
218
- style={{
219
- width: '70%',
220
- position: 'relative',
221
- backgroundColor: '$background !important',
222
- }}
223
- suffix={
224
- <span
225
- style={{ position: 'absolute', right: '4px', bottom: '2px' }}
226
- >
227
- <Typography variant="caption">{`$${numberToString(
228
- inputUsdValue
229
- )}`}</Typography>
230
- </span>
231
- }
232
- value={props.inputAmount || ''}
233
- onChange={
234
- props.type === 'From'
235
- ? (event) => {
236
- props.onAmountChange(event.target.value);
237
- }
238
- : undefined
239
- }
240
- />
241
- ) : (
242
- <OutputContainer>
243
- <Typography variant="body1">
244
- {bestRoute
245
- ? `≈ ${numberToString(props.outputAmount)}`
246
- : inputAmount
247
- ? '?'
248
- : '0'}
249
- </Typography>
250
- <span
251
- style={{ position: 'absolute', right: '4px', bottom: '2px' }}
252
- >
253
- <Typography variant="caption">{`$${numberToString(
254
- props.outputUsdValue
255
- )}`}</Typography>
256
- </span>
257
- </OutputContainer>
258
- )}
260
+ <Spacer size={12} />
261
+ <div className="amount">
262
+ {props.type === 'From' ? (
263
+ <TextField
264
+ type="number"
265
+ size="large"
266
+ autoFocus
267
+ placeholder="0"
268
+ style={{
269
+ position: 'relative',
270
+ backgroundColor: '$background !important',
271
+ }}
272
+ suffix={
273
+ <span
274
+ style={{
275
+ position: 'absolute',
276
+ right: '4px',
277
+ bottom: '2px',
278
+ }}
279
+ >
280
+ <Typography
281
+ variant="caption"
282
+ color="neutrals800"
283
+ >{`$${numberToString(inputUsdValue)}`}</Typography>
284
+ </span>
285
+ }
286
+ value={props.inputAmount || ''}
287
+ onChange={
288
+ props.type === 'From'
289
+ ? (event) => {
290
+ props.onAmountChange(event.target.value);
291
+ }
292
+ : undefined
293
+ }
294
+ />
295
+ ) : (
296
+ <OutputContainer>
297
+ <Typography variant="h4">
298
+ {bestRoute
299
+ ? `≈ ${numberToString(props.outputAmount)}`
300
+ : inputAmount
301
+ ? '?'
302
+ : '0'}
303
+ </Typography>
304
+ </OutputContainer>
305
+ )}
306
+ </div>
259
307
  </div>
260
308
  </Container>
261
309
  </Box>
@@ -0,0 +1,178 @@
1
+ import React from 'react';
2
+ import { Button, InfoCircleIcon, styled, Typography } from '@rango-dev/ui';
3
+ import { LoadingStatus } from '../store/meta';
4
+ import { useTranslation } from 'react-i18next';
5
+ import { Spacer } from '@rango-dev/ui';
6
+ import BigNumber from 'bignumber.js';
7
+ import { numberToString } from '../utils/numbers';
8
+
9
+ const Box = styled('div', {
10
+ display: 'flex',
11
+ flexDirection: 'column',
12
+ width: '100%',
13
+ });
14
+
15
+ const Container = styled('div', {
16
+ boxSizing: 'border-box',
17
+ borderRadius: '$5',
18
+ padding: '$8 $16 $16 $16',
19
+
20
+ variants: {
21
+ type: {
22
+ filled: {
23
+ backgroundColor: '$neutrals300',
24
+ },
25
+ outlined: {
26
+ border: '1px solid $neutrals300',
27
+ },
28
+ },
29
+ },
30
+
31
+ defaultVariants: {
32
+ type: 'filled',
33
+ },
34
+
35
+ '.head': {
36
+ display: 'flex',
37
+ justifyContent: 'space-between',
38
+ alignItems: 'center',
39
+ minHeight: '32px',
40
+ },
41
+ '.form': {
42
+ display: 'flex',
43
+ width: '100%',
44
+ padding: '$2 0',
45
+ '.selectors': {
46
+ width: '35%',
47
+
48
+ '._text': {
49
+ whiteSpace: 'nowrap',
50
+ overflow: 'hidden',
51
+ textOverflow: 'ellipsis',
52
+ },
53
+ },
54
+ '.amount': {
55
+ width: '30%',
56
+ },
57
+ },
58
+ });
59
+
60
+ const StyledImage = styled('img', {
61
+ width: '$24',
62
+ maxHeight: '$24',
63
+ });
64
+
65
+ const ImagePlaceholder = styled('span', {
66
+ width: '24px',
67
+ height: '24px',
68
+ backgroundColor: '$neutrals300',
69
+ borderRadius: '99999px',
70
+ });
71
+
72
+ const OutputContainer = styled('div', {
73
+ windth: '100%',
74
+ height: '$48',
75
+ borderRadius: '$5',
76
+ backgroundColor: '$background',
77
+ border: '1px solid transparent',
78
+ position: 'relative',
79
+ display: 'flex',
80
+ alignItems: 'center',
81
+ paddingLeft: '$8',
82
+ paddingRight: '$8',
83
+ });
84
+
85
+ interface PropTypes {
86
+ label: string;
87
+ amount: string;
88
+ usdValue?: BigNumber;
89
+ loadingStatus: LoadingStatus;
90
+ chain: {
91
+ displayName: string;
92
+ logo: string;
93
+ };
94
+ token: {
95
+ symbol: string;
96
+ image: string;
97
+ };
98
+ }
99
+
100
+ export function TokenPreview(props: PropTypes) {
101
+ const { chain, token, loadingStatus } = props;
102
+ const { t } = useTranslation();
103
+
104
+ const ItemSuffix = (
105
+ <div
106
+ style={{
107
+ display: 'flex',
108
+ justifyContent: 'center',
109
+ alignItems: 'center',
110
+ }}
111
+ >
112
+ {loadingStatus === 'failed' && <InfoCircleIcon color="error" size={24} />}
113
+ </div>
114
+ );
115
+
116
+ return (
117
+ <Box>
118
+ <Container type={'outlined'}>
119
+ <div className="head">
120
+ <Typography variant="body2" color="neutrals800">
121
+ {props.label}
122
+ </Typography>
123
+ {props.usdValue && (
124
+ <Typography
125
+ variant="caption"
126
+ color="neutrals600"
127
+ >{`$${numberToString(props.usdValue)}`}</Typography>
128
+ )}
129
+ </div>
130
+ <div className="form">
131
+ <Button
132
+ className="selectors"
133
+ variant="outlined"
134
+ loading={loadingStatus === 'loading'}
135
+ prefix={
136
+ loadingStatus === 'success' && chain ? (
137
+ <StyledImage src={chain.logo} />
138
+ ) : (
139
+ <ImagePlaceholder />
140
+ )
141
+ }
142
+ suffix={ItemSuffix}
143
+ align="start"
144
+ size="large"
145
+ >
146
+ {loadingStatus === 'success' && chain
147
+ ? chain.displayName
148
+ : t('Chain')}
149
+ </Button>
150
+ <Spacer size={12} />
151
+ <Button
152
+ className="selectors"
153
+ variant="outlined"
154
+ loading={loadingStatus === 'loading'}
155
+ prefix={
156
+ loadingStatus === 'success' && token ? (
157
+ <StyledImage src={token.image} />
158
+ ) : (
159
+ <ImagePlaceholder />
160
+ )
161
+ }
162
+ suffix={ItemSuffix}
163
+ size="large"
164
+ align="start"
165
+ >
166
+ {loadingStatus === 'success' && token ? token.symbol : t('Token')}
167
+ </Button>
168
+ <Spacer size={12} />
169
+ <div className="amount">
170
+ <OutputContainer>
171
+ <Typography variant="h4">{props.amount}</Typography>
172
+ </OutputContainer>
173
+ </div>
174
+ </div>
175
+ </Container>
176
+ </Box>
177
+ );
178
+ }
@@ -52,9 +52,7 @@ export function UpdateUrl() {
52
52
  fromAmount = '';
53
53
  if (
54
54
  loadingStatus !== 'success' &&
55
- ![navigationRoutes.confirmWallets, navigationRoutes.confirmSwap].includes(
56
- location.pathname
57
- )
55
+ location.pathname != navigationRoutes.confirmSwap
58
56
  ) {
59
57
  fromChainString = searchParamsRef.current[SearchParams.FROM_CHAIN];
60
58
  fromTokenString = searchParamsRef.current[SearchParams.FROM_TOKEN];
@@ -23,6 +23,7 @@ const ListItem = styled('li', {
23
23
 
24
24
  const Message = styled(Typography, {
25
25
  display: 'block',
26
+ color: '$warning500 !important',
26
27
  });
27
28
 
28
29
  export function BalanceWarnings({ messages }: PropTypes) {
@@ -1,4 +1,4 @@
1
- import { Alert, Typography } from '@rango-dev/ui';
1
+ import { Alert } from '@rango-dev/ui';
2
2
  import React from 'react';
3
3
  import { ChangeSlippageButton } from '../ChangeSlippageButton';
4
4
 
@@ -10,12 +10,9 @@ export function HighSlippageWarning(props: PropTypes) {
10
10
  const { selectedSlippage } = props;
11
11
 
12
12
  return (
13
- <Alert type="warning">
14
- <Typography variant="body2">
15
- Caution, your slippage is high (=
16
- {selectedSlippage}). Your trade may be front run.
17
- <ChangeSlippageButton />
18
- </Typography>
13
+ <Alert type="warning" footer={<ChangeSlippageButton />}>
14
+ Caution, your slippage is high (=
15
+ {selectedSlippage}). Your trade may be front run.
19
16
  </Alert>
20
17
  );
21
18
  }
@@ -1,18 +1,23 @@
1
- import { Typography } from '@rango-dev/ui';
1
+ import { Spacer, Typography, styled } from '@rango-dev/ui';
2
2
  import React from 'react';
3
3
  import { ChangeSlippageButton } from '../ChangeSlippageButton';
4
4
 
5
5
  interface PropTypes {
6
- minRequiredSlippage: number | null;
6
+ minRequiredSlippage: string | null;
7
7
  }
8
8
 
9
+ const StyledMessage = styled(Typography, {
10
+ color: '$error500 !important',
11
+ });
12
+
9
13
  export function MinRequiredSlippage({ minRequiredSlippage }: PropTypes) {
10
14
  return (
11
- <Typography variant="body2">
15
+ <StyledMessage variant="body2">
12
16
  We recommend you to increase slippage to at least &nbsp;
13
17
  {minRequiredSlippage}
14
18
  &nbsp; for this route.
19
+ <Spacer size={8} direction="vertical" />
15
20
  <ChangeSlippageButton />
16
- </Typography>
21
+ </StyledMessage>
17
22
  );
18
23
  }
@@ -9,6 +9,5 @@ export const navigationRoutes = {
9
9
  swaps: '/swaps',
10
10
  wallets: '/wallets',
11
11
  confirmSwap: '/confirm-swap',
12
- confirmWallets: '/confirm-wallets',
13
12
  swapDetails: '/swaps/:requestId',
14
13
  };
@@ -2,9 +2,10 @@ import { globalCss } from '@rango-dev/ui';
2
2
 
3
3
  export const globalStyles = globalCss({
4
4
  '*': {
5
- '&::-webkit-scrollbar': { width: '$8' },
5
+ '&::-webkit-scrollbar': { width: '$8', height: '$8' },
6
6
  '&::-webkit-scrollbar-thumb': {
7
7
  backgroundColor: '$neutrals400',
8
+ borderRadius: '$10',
8
9
  },
9
10
  '&::-webkit-scrollbar-thumb:hover': {
10
11
  backgroundColor: '$neutrals500',
@@ -20,7 +21,7 @@ export const globalFont = (fontFamily: string) =>
20
21
  "url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap')",
21
22
  "url('https://fonts.cdnfonts.com/css/times-new-roman')",
22
23
  ],
23
- [`.font_${fontFamily.replace(/ /g, '')} ._text`]: {
24
+ body: {
24
25
  fontFamily,
25
26
  },
26
27
  })();
@@ -93,6 +93,7 @@ export function useConfirmSwap(): ConfirmSwap {
93
93
  meta
94
94
  );
95
95
 
96
+ //@ts-ignore
96
97
  return newSwap;
97
98
  }
98
99
  return;
@@ -228,7 +229,7 @@ export function useConfirmSwap(): ConfirmSwap {
228
229
  false,
229
230
  meta
230
231
  );
231
-
232
+ //@ts-ignore
232
233
  return newSwap;
233
234
  } else if (!proceedAnywayRef.current) {
234
235
  proceedAnywayRef.current = true;
@@ -8,6 +8,8 @@ export function useNavigateBack() {
8
8
  navigationRoutes;
9
9
 
10
10
  const navigateBackFrom = (currentRoute: string) => {
11
+ if (currentRoute === navigationRoutes.swapDetails)
12
+ return navigate(navigationRoutes.swaps, { replace: true });
11
13
  if (
12
14
  !isRouterInContext ||
13
15
  (window.history.state && window.history.state.idx > 0)
@@ -23,7 +25,7 @@ export function useNavigateBack() {
23
25
  navigationRoutes.settings,
24
26
  navigationRoutes.wallets,
25
27
  navigationRoutes.swaps,
26
- navigationRoutes.confirmWallets,
28
+ navigationRoutes.confirmSwap,
27
29
  ].includes(currentRoute)
28
30
  )
29
31
  navigate(navigationRoutes.home, { replace: true });
@@ -31,8 +33,6 @@ export function useNavigateBack() {
31
33
  navigate(navigationRoutes.settings, { replace: true });
32
34
  else if (currentRoute === navigationRoutes.swapDetails)
33
35
  navigate(navigationRoutes.swaps, { replace: true });
34
- else if (currentRoute === navigationRoutes.confirmSwap)
35
- navigate(navigationRoutes.confirmWallets, { replace: true });
36
36
  }
37
37
  };
38
38
 
@@ -14,16 +14,16 @@ export function useTheme({
14
14
  warning = '#F5A623',
15
15
  success = '#0070F3',
16
16
  fontFamily = 'Robot',
17
- borderRadius = 5,
17
+ borderRadius = 8,
18
18
  }: Colors & { borderRadius?: number; fontFamily?: string }) {
19
19
  const theme = useSettingsStore.use.theme();
20
20
  const fetchMeta = useMetaStore.use.fetchMeta();
21
21
  const colors = {
22
22
  neutrals200: '#FAFAFA',
23
- neutrals300: '#EAEAEA',
24
- neutrals400: '#999999',
25
- neutrals500: '#888888',
26
- neutrals600: '#666666',
23
+ neutrals300: '#f2f2f2',
24
+ neutrals400: '#dedede',
25
+ neutrals500: '#cccccc',
26
+ neutrals600: '#acacac',
27
27
  neutrals700: '#444444',
28
28
  neutrals800: '#333333',
29
29
  neutrals900: '#111111',
@@ -69,10 +69,10 @@ export function useTheme({
69
69
  neutrals200: '#111111',
70
70
  neutrals300: '#333333',
71
71
  neutrals400: '#444444',
72
- neutrals500: '#666666',
73
- neutrals600: '#888888',
74
- neutrals700: '#999999',
75
- neutrals800: '#EAEAEA',
72
+ neutrals500: '#acacac',
73
+ neutrals600: '#cccccc',
74
+ neutrals700: '#dedede',
75
+ neutrals800: '#f2f2f2',
76
76
  neutrals900: '#FAFAFA',
77
77
  foreground: background,
78
78
  background: foreground,
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "swap": "SWAP",
3
- "Connect Wallet":"Connect Wallet",
4
- "Powered By":"Powered By",
5
- "From":"From",
6
- "To":"To",
7
- "Max":"Max",
3
+ "Connect Wallet": "Connect Wallet",
4
+ "Powered By": "Powered By",
5
+ "From": "You sell",
6
+ "To": "You receive",
7
+ "Balance": "Balance",
8
+ "Max": "Max",
8
9
  "Chain": "Chain",
9
10
  "Token": "Token",
10
- "Source" :"Source",
11
- "Destination" :"Destination",
12
- "Select Wallet":"Select Wallet"
11
+ "Source": "Source",
12
+ "Destination": "Destination",
13
+ "Select Wallet": "Connect Your Wallet"
13
14
  }