@rango-dev/widget-embedded 0.25.1-next.0 → 0.25.1-next.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 (42) hide show
  1. package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts.map +1 -1
  2. package/dist/components/CustomCollapsible/CustomCollapsible.styles.d.ts.map +1 -1
  3. package/dist/components/HeaderButtons/WalletButton.d.ts.map +1 -1
  4. package/dist/components/Quote/Quote.d.ts.map +1 -1
  5. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.d.ts.map +1 -1
  6. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.d.ts +1 -0
  7. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.d.ts.map +1 -1
  8. package/dist/components/SwapDetails/SwapDetails.d.ts.map +1 -1
  9. package/dist/components/SwitchFromAndTo/SwitchFromAndTo.d.ts.map +1 -0
  10. package/dist/components/SwitchFromAndTo/SwitchFromAndTo.styles.d.ts +326 -0
  11. package/dist/components/SwitchFromAndTo/SwitchFromAndTo.styles.d.ts.map +1 -0
  12. package/dist/components/SwitchFromAndTo/index.d.ts +2 -0
  13. package/dist/components/SwitchFromAndTo/index.d.ts.map +1 -0
  14. package/dist/components/TokenList/TokenList.d.ts.map +1 -1
  15. package/dist/components/TokenList/TokenList.styles.d.ts +162 -0
  16. package/dist/components/TokenList/TokenList.styles.d.ts.map +1 -1
  17. package/dist/index.js +2 -2
  18. package/dist/index.js.map +4 -4
  19. package/dist/pages/ConfirmSwapPage.d.ts.map +1 -1
  20. package/dist/pages/Home.d.ts.map +1 -1
  21. package/dist/store/quote.d.ts.map +1 -1
  22. package/package.json +7 -7
  23. package/src/components/ConfirmWalletsModal/ConfirmWallets.styles.ts +3 -2
  24. package/src/components/CustomCollapsible/CustomCollapsible.styles.ts +1 -0
  25. package/src/components/HeaderButtons/WalletButton.tsx +4 -1
  26. package/src/components/Quote/Quote.tsx +3 -9
  27. package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.tsx +4 -0
  28. package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.ts +1 -0
  29. package/src/components/RefreshModal/RefreshModal.tsx +2 -2
  30. package/src/components/SwapDetails/SwapDetails.styles.ts +1 -1
  31. package/src/components/SwapDetails/SwapDetails.tsx +9 -7
  32. package/src/components/SwitchFromAndTo/SwitchFromAndTo.styles.ts +48 -0
  33. package/src/components/SwitchFromAndTo/SwitchFromAndTo.tsx +32 -0
  34. package/src/components/SwitchFromAndTo/index.ts +1 -0
  35. package/src/components/TokenList/TokenList.styles.ts +7 -0
  36. package/src/components/TokenList/TokenList.tsx +10 -8
  37. package/src/pages/ConfirmSwapPage.tsx +1 -17
  38. package/src/pages/Home.tsx +1 -0
  39. package/src/store/quote.ts +3 -4
  40. package/dist/components/SwitchFromAndTo.d.ts.map +0 -1
  41. package/src/components/SwitchFromAndTo.tsx +0 -42
  42. /package/dist/components/{SwitchFromAndTo.d.ts → SwitchFromAndTo/SwitchFromAndTo.d.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"ConfirmSwapPage.d.ts","sourceRoot":"","sources":["../../src/pages/ConfirmSwapPage.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAuD,MAAM,OAAO,CAAC;AAmD5E,wBAAgB,eAAe,sBAuU9B"}
1
+ {"version":3,"file":"ConfirmSwapPage.d.ts","sourceRoot":"","sources":["../../src/pages/ConfirmSwapPage.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAuD,MAAM,OAAO,CAAC;AAiD5E,wBAAgB,eAAe,sBA2T9B"}
@@ -1 +1 @@
1
- {"version":3,"file":"Home.d.ts","sourceRoot":"","sources":["../../src/pages/Home.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA8B,MAAM,OAAO,CAAC;AA4BnD,eAAO,MAAM,6BAA6B,MAAM,CAAC;AAEjD,wBAAgB,IAAI,sBAyMnB"}
1
+ {"version":3,"file":"Home.d.ts","sourceRoot":"","sources":["../../src/pages/Home.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA8B,MAAM,OAAO,CAAC;AA4BnD,eAAO,MAAM,6BAA6B,MAAM,CAAC;AAEjD,wBAAgB,IAAI,sBA0MnB"}
@@ -1 +1 @@
1
- {"version":3,"file":"quote.d.ts","sourceRoot":"","sources":["../../src/store/quote.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAChF,OAAO,KAAK,EACV,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,KAAK,EACN,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,SAAS,MAAM,cAAc,CAAC;AAWrC,eAAO,MAAM,WAAW,UACf,KAAK,GAAG,IAAI,UACX,MAAM,KACb,SAAS,GAAG,IAGL,CAAC;AAEX,MAAM,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,EAAE,aAAa,GAAG,QAAQ,CAAC,CAAC;AAEhE,MAAM,MAAM,cAAc,GAAG;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,IAAI,CAAA;CAAE,CAAC;AAE5E,KAAK,cAAc,GAAG;IACpB,MAAM,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAClC,YAAY,EAAE,cAAc,CAAC;IAC7B,YAAY,EAAE,OAAO,CAAC;IACtB,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,YAAY,GAAG,IAAI,CAAC;CAC9B,CAAC;AAEF,MAAM,WAAW,UAAU;IACzB,cAAc,EAAE,cAAc,GAAG,IAAI,CAAC;IACtC,YAAY,EAAE,cAAc,GAAG,IAAI,CAAC;IACpC,WAAW,EAAE,MAAM,CAAC;I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B,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACpD;AAED,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAxBN,IAAI;iCACH,IAAI;uCAEE,IAAI;yCACF,IAAI;yCACJ,cAAc,GAAG,IAAI,KAAK,IAAI;uCAChC,cAAc,GAAG,IAAI,KAAK,IAAI;qCAChC,cAAc,KAAK,IAAI;mCACzB,cAAc,KAAK,IAAI;6GAIvC,IAAI;uCACgB,MAAM,KAAK,IAAI;wCACd,aAAa,GAAG,IAAI,KAAK,IAAI;mCAClC,WAAW,QAAQ,IAAI,KAAK,IAAI;qCAC9B,IAAI;8CACK,OAAO,KAAK,IAAI;4CAClB,MAAM,EAAE,KAAK,IAAI;8CACf,MAAM,GAAG,IAAI,KAAK,IAAI;uCAC7B,IAAI;gDACK,OAAO,KAAK,IAAI;;CA4MnD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rango-dev/widget-embedded",
3
- "version": "0.25.1-next.0",
3
+ "version": "0.25.1-next.10",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "source": "./src/index.ts",
@@ -25,13 +25,13 @@
25
25
  "@lingui/core": "4.2.1",
26
26
  "@lingui/react": "4.2.1",
27
27
  "@rango-dev/logging-core": "^0.2.0",
28
- "@rango-dev/provider-all": "^0.30.0",
28
+ "@rango-dev/provider-all": "^0.30.1-next.4",
29
29
  "@rango-dev/queue-manager-core": "^0.26.0",
30
- "@rango-dev/queue-manager-rango-preset": "^0.30.0",
30
+ "@rango-dev/queue-manager-rango-preset": "^0.30.1-next.2",
31
31
  "@rango-dev/queue-manager-react": "^0.26.0",
32
- "@rango-dev/ui": "^0.31.0",
33
- "@rango-dev/wallets-react": "^0.16.0",
34
- "@rango-dev/wallets-shared": "^0.30.0",
32
+ "@rango-dev/ui": "^0.31.1-next.3",
33
+ "@rango-dev/wallets-react": "^0.16.1-next.1",
34
+ "@rango-dev/wallets-shared": "^0.30.1-next.1",
35
35
  "bignumber.js": "^9.1.1",
36
36
  "copy-to-clipboard": "^3.3.3",
37
37
  "dayjs": "^1.11.7",
@@ -52,4 +52,4 @@
52
52
  "publishConfig": {
53
53
  "access": "public"
54
54
  }
55
- }
55
+ }
@@ -104,7 +104,7 @@ export const CustomDestination = styled('div', {
104
104
  backgroundColor: '$neutral100',
105
105
  },
106
106
  '& .collapsible_root': {
107
- backgroundColor: '$neutral200',
107
+ backgroundColor: '$neutral100',
108
108
  },
109
109
  });
110
110
 
@@ -135,7 +135,8 @@ export const CustomDestinationButton = styled('div', {
135
135
  $$color: '$colors$neutral300',
136
136
  },
137
137
  backgroundColor: '$$color',
138
-
138
+ borderBottomRightRadius: '0',
139
+ borderBottomLeftRadius: '0',
139
140
  '&:hover': {
140
141
  $$color: '$colors$info100',
141
142
  [`.${darkTheme} &`]: {
@@ -23,6 +23,7 @@ const slideUp = keyframes({
23
23
 
24
24
  export const CollapsibleRoot = styled(Collapsible.Root, {
25
25
  borderRadius: '$sm',
26
+ overflow: 'hidden',
26
27
  variants: {
27
28
  selected: {
28
29
  true: {
@@ -5,6 +5,7 @@ import { Image, Tooltip, WalletIcon } from '@rango-dev/ui';
5
5
  import React from 'react';
6
6
 
7
7
  import { useWalletList } from '../../hooks/useWalletList';
8
+ import { useAppStore } from '../../store/AppStore';
8
9
 
9
10
  import {
10
11
  ConnectedIcon,
@@ -14,7 +15,9 @@ import {
14
15
  } from './HeaderButtons.styles';
15
16
 
16
17
  function WalletButton(props: PropTypes) {
17
- const { list } = useWalletList({});
18
+ const { config } = useAppStore();
19
+
20
+ const { list } = useWalletList({ config });
18
21
  const connectedWallets = list.filter(
19
22
  (wallet) => wallet.state === 'connected'
20
23
  );
@@ -411,15 +411,9 @@ export function Quote(props: QuoteProps) {
411
411
  </ContainerInfoOutput>
412
412
  <Tooltip
413
413
  content={formatTooltipNumbers(output.usdValue)}
414
- container={container}
415
- styles={{
416
- root: { display: 'flex' },
417
- }}>
418
- <Typography
419
- color="$neutral600"
420
- ml={2}
421
- size="xsmall"
422
- variant="body">
414
+ container={container}>
415
+ <Divider size={2} direction="horizontal" />
416
+ <Typography color="$neutral600" size="xsmall" variant="body">
423
417
  {`($${roundedOutputUsdValue})`}
424
418
  </Typography>
425
419
  </Tooltip>
@@ -17,6 +17,7 @@ export function QuoteWarningsAndErrors(props: PropTypes) {
17
17
  const {
18
18
  warning,
19
19
  error,
20
+ couldChangeSettings,
20
21
  showWarningModal,
21
22
  confirmationDisabled,
22
23
  refetchQuote,
@@ -44,6 +45,9 @@ export function QuoteWarningsAndErrors(props: PropTypes) {
44
45
  ? error
45
46
  : null
46
47
  );
48
+ if (alertInfo && !couldChangeSettings) {
49
+ alertInfo.action = null;
50
+ }
47
51
 
48
52
  const showAlerts = !!alertInfo;
49
53
 
@@ -5,6 +5,7 @@ export interface PropTypes {
5
5
  warning: QuoteWarning | null;
6
6
  showWarningModal: boolean;
7
7
  confirmationDisabled: boolean;
8
+ couldChangeSettings: boolean;
8
9
  refetchQuote: () => void;
9
10
  onOpenWarningModal: () => void;
10
11
  onCloseWarningModal: () => void;
@@ -19,9 +19,9 @@ export function RefreshModal(props: PropTypes) {
19
19
  onClose={onClose}
20
20
  container={getContainer()}>
21
21
  <MessageBox
22
- title={i18n.t('Something wrong')}
22
+ title={i18n.t('Something went wrong')}
23
23
  type="error"
24
- description={i18n.t('Something Wrong. Please refresh the app')}>
24
+ description={i18n.t('Something went wrong. Please refresh the app.')}>
25
25
  <Divider size={30} />
26
26
  <RefreshButton
27
27
  variant="outlined"
@@ -92,5 +92,5 @@ export const ErrorMessages = styled('div', {
92
92
  gap: '$5',
93
93
  });
94
94
  export const MessageText = styled(Typography, {
95
- wordBreak: 'break-all',
95
+ wordBreak: 'break-word',
96
96
  });
@@ -253,13 +253,15 @@ export function SwapDetails(props: SwapDetailsProps) {
253
253
  })}`
254
254
  : ''}
255
255
  </Typography>
256
- <MessageText
257
- align="center"
258
- variant="body"
259
- size="medium"
260
- color="neutral700">
261
- {stepDetailMessage}
262
- </MessageText>
256
+ {stepDetailMessage && (
257
+ <MessageText
258
+ align="center"
259
+ variant="body"
260
+ size="medium"
261
+ color="neutral700">
262
+ <b>Reason:</b> {stepDetailMessage}
263
+ </MessageText>
264
+ )}
263
265
  </ErrorMessages>
264
266
  );
265
267
 
@@ -0,0 +1,48 @@
1
+ import { keyframes, styled } from '@rango-dev/ui';
2
+
3
+ export const ROTATE_ANIMATION_DURATION = 450;
4
+
5
+ const rotateAnimation = keyframes({
6
+ '0%': {
7
+ transform: 'rotateX(0deg) rotateY(0deg) rotateZ(0deg)',
8
+ },
9
+ '33%': {
10
+ transform: 'rotateX(0deg) rotateZ(78deg) rotateY(66deg)',
11
+ },
12
+ '66%': {
13
+ transform: 'rotateX(0deg) rotateZ(163deg) rotateY(66deg)',
14
+ },
15
+ '100%': {
16
+ transform: 'rotateX(0deg) rotateZ(180deg) rotateY(0deg)',
17
+ },
18
+ });
19
+
20
+ export const SwitchButtonContainer = styled('div', {
21
+ position: 'absolute',
22
+ bottom: '-12px',
23
+ left: '50%',
24
+ transform: 'translate(-50%, 10%)',
25
+ cursor: 'pointer',
26
+ });
27
+
28
+ export const StyledButton = styled('div', {
29
+ borderRadius: '$md',
30
+ border: '3px solid $background',
31
+ background: '$neutral100',
32
+ width: '$24',
33
+ height: '$24',
34
+ display: 'flex',
35
+ justifyContent: 'center',
36
+ alignItems: 'center',
37
+ color: '$foreground',
38
+ '&.rotate': {
39
+ '& svg': {
40
+ animation: `${rotateAnimation} ${ROTATE_ANIMATION_DURATION}ms ease-in-out forwards`,
41
+ },
42
+ },
43
+ '&:hover': {
44
+ color: '$secondary500',
45
+ transform: 'translateY(1px) scale(1.04)',
46
+ boxShadow: '1px 1px 1px 1px rgba(0, 0, 0, 0.05)',
47
+ },
48
+ });
@@ -0,0 +1,32 @@
1
+ import { ReverseIcon } from '@rango-dev/ui';
2
+ import React from 'react';
3
+
4
+ import { useQuoteStore } from '../../store/quote';
5
+
6
+ import {
7
+ ROTATE_ANIMATION_DURATION,
8
+ StyledButton,
9
+ SwitchButtonContainer,
10
+ } from './SwitchFromAndTo.styles';
11
+
12
+ export function SwitchFromAndToButton() {
13
+ const switchFromAndTo = useQuoteStore.use.switchFromAndTo();
14
+
15
+ return (
16
+ <SwitchButtonContainer>
17
+ <StyledButton
18
+ onClick={(event) => {
19
+ const button = event.currentTarget;
20
+
21
+ button.classList.add('rotate');
22
+
23
+ setTimeout(() => {
24
+ button.classList.remove('rotate');
25
+ }, ROTATE_ANIMATION_DURATION);
26
+ switchFromAndTo();
27
+ }}>
28
+ <ReverseIcon size={12} />
29
+ </StyledButton>
30
+ </SwitchButtonContainer>
31
+ );
32
+ }
@@ -0,0 +1 @@
1
+ export { SwitchFromAndToButton } from './SwitchFromAndTo';
@@ -30,6 +30,7 @@ export const tokenTitleStyles = css({
30
30
  export const tokenAddressStyles = css({
31
31
  transform: 'translateY(12px)',
32
32
  visibility: 'hidden',
33
+ display: 'flex',
33
34
  '& a': {
34
35
  display: 'flex',
35
36
  justifyContent: 'center',
@@ -157,3 +158,9 @@ export const TokenBalance = styled(Typography, {
157
158
  textOverflow: 'ellipsis',
158
159
  whiteSpace: 'nowrap',
159
160
  });
161
+
162
+ export const StyledLink = styled('a', {
163
+ '& svg:hover': {
164
+ color: '$colors$info',
165
+ },
166
+ });
@@ -31,6 +31,7 @@ import {
31
31
  ImageSection,
32
32
  List,
33
33
  Pin,
34
+ StyledLink,
34
35
  Tag,
35
36
  TagTitle,
36
37
  Title,
@@ -72,17 +73,17 @@ const renderDesc = (props: RenderDescProps) => {
72
73
  className={`${tokenAddressStyles()} ${
73
74
  !name && tokenWithoutNameStyles()
74
75
  }`}>
75
- <a
76
+ {length > 10
77
+ ? `${address.slice(0, 5)}...${address.slice(length - 6, length)}`
78
+ : address}{' '}
79
+ <Divider size={4} direction="horizontal" />
80
+ <StyledLink
76
81
  href={url}
77
82
  target="_blank"
78
83
  rel="nofollow noreferrer"
79
84
  onClick={(e) => e.stopPropagation()}>
80
- {length > 10
81
- ? `${address.slice(0, 5)}...${address.slice(length - 6, length)}`
82
- : address}{' '}
83
- <Divider size={4} direction="horizontal" />
84
- <ExternalLinkIcon color="gray" size={12} />
85
- </a>
85
+ <ExternalLinkIcon size={12} />
86
+ </StyledLink>
86
87
  </div>
87
88
  )}
88
89
  </div>
@@ -109,7 +110,7 @@ export function TokenList(props: PropTypes) {
109
110
 
110
111
  useEffect(() => {
111
112
  setTokens(list.slice(0, PAGE_SIZE));
112
- }, [list]);
113
+ }, [list.length]);
113
114
 
114
115
  const renderList = () => {
115
116
  if (!tokens.length && !!searchedFor) {
@@ -164,6 +165,7 @@ export function TokenList(props: PropTypes) {
164
165
  style={{
165
166
  width: '100%',
166
167
  overflow: 'hidden',
168
+ height: '60px',
167
169
  }}
168
170
  tab-index={index}
169
171
  key={`${token.symbol}${token.address}`}
@@ -12,9 +12,7 @@ import {
12
12
  css,
13
13
  Divider,
14
14
  IconButton,
15
- SettingsIcon,
16
15
  styled,
17
- Tooltip,
18
16
  Typography,
19
17
  WalletIcon,
20
18
  } from '@rango-dev/ui';
@@ -24,7 +22,6 @@ import { useLocation, useNavigate } from 'react-router-dom';
24
22
 
25
23
  import { getRequiredWallets } from '../components/ConfirmWalletsModal/ConfirmWallets.helpers';
26
24
  import { ConfirmWalletsModal } from '../components/ConfirmWalletsModal/ConfirmWalletsModal';
27
- import { HeaderButton } from '../components/HeaderButtons/HeaderButtons.styles';
28
25
  import { RefreshButton } from '../components/HeaderButtons/RefreshButton';
29
26
  import { Layout, PageContainer } from '../components/Layout';
30
27
  import { QuoteWarningsAndErrors } from '../components/QuoteWarningsAndErrors';
@@ -37,7 +34,6 @@ import { useQuoteStore } from '../store/quote';
37
34
  import { useUiStore } from '../store/ui';
38
35
  import { useWalletsStore } from '../store/wallets';
39
36
  import { QuoteWarningType } from '../types';
40
- import { getContainer } from '../utils/common';
41
37
  import { joinList } from '../utils/ui';
42
38
 
43
39
  const Buttons = styled('div', {
@@ -285,6 +281,7 @@ export function ConfirmSwapPage() {
285
281
  <QuoteWarningsAndErrors
286
282
  warning={quoteWarning}
287
283
  error={quoteError}
284
+ couldChangeSettings={false}
288
285
  refetchQuote={onRefresh}
289
286
  showWarningModal={showQuoteWarningModal}
290
287
  confirmationDisabled={!isActiveTab}
@@ -307,19 +304,6 @@ export function ConfirmSwapPage() {
307
304
  const wallets_url = `../${navigationRoutes.wallets}`;
308
305
  navigate(wallets_url);
309
306
  },
310
- suffix: (
311
- <Tooltip
312
- container={getContainer()}
313
- side="bottom"
314
- content={i18n.t('Settings')}>
315
- <HeaderButton
316
- size="small"
317
- variant="ghost"
318
- onClick={() => navigate('../' + navigationRoutes.settings)}>
319
- <SettingsIcon size={18} color="black" />
320
- </HeaderButton>
321
- </Tooltip>
322
- ),
323
307
  }}
324
308
  footer={
325
309
  <Buttons>
@@ -205,6 +205,7 @@ export function Home() {
205
205
  <QuoteWarningsAndErrors
206
206
  warning={quoteWarning}
207
207
  error={quoteError}
208
+ couldChangeSettings={true}
208
209
  refetchQuote={fetchQuote}
209
210
  showWarningModal={showQuoteWarningModal}
210
211
  confirmationDisabled={!isActiveTab}
@@ -247,10 +247,9 @@ export const useQuoteStore = createSelectors(
247
247
  toBlockchain: state.fromBlockchain,
248
248
  toToken: state.fromToken,
249
249
  inputAmount: state.outputAmount?.toString() || '',
250
- inputUsdValue: getUsdValue(
251
- state.toToken,
252
- state.outputAmount?.toString() || ''
253
- ),
250
+ inputUsdValue: state.toToken
251
+ ? getUsdValue(state.toToken, state.outputAmount?.toString() || '')
252
+ : new BigNumber(0),
254
253
  })),
255
254
  resetFromBlockchain: () =>
256
255
  set(() => ({
@@ -1 +0,0 @@
1
- {"version":3,"file":"SwitchFromAndTo.d.ts","sourceRoot":"","sources":["../../src/components/SwitchFromAndTo.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AA2B1B,wBAAgB,qBAAqB,sBAapC"}
@@ -1,42 +0,0 @@
1
- import { ReverseIcon, styled } from '@rango-dev/ui';
2
- import React from 'react';
3
-
4
- import { useQuoteStore } from '../store/quote';
5
-
6
- const SwitchButtonContainer = styled('div', {
7
- position: 'absolute',
8
- bottom: '-12px',
9
- left: '50%',
10
- transform: 'translate(-50%, 10%)',
11
- cursor: 'pointer',
12
- });
13
-
14
- const StyledButton = styled('div', {
15
- borderRadius: '$md',
16
- border: '3px solid $background',
17
- background: '$neutral100',
18
- width: '$24',
19
- height: '$24',
20
- display: 'flex',
21
- justifyContent: 'center',
22
- alignItems: 'center',
23
- color: '$foreground',
24
- '&:hover': {
25
- color: '$secondary500',
26
- },
27
- });
28
-
29
- export function SwitchFromAndToButton() {
30
- const switchFromAndTo = useQuoteStore.use.switchFromAndTo();
31
-
32
- return (
33
- <SwitchButtonContainer>
34
- <StyledButton
35
- onClick={() => {
36
- switchFromAndTo();
37
- }}>
38
- <ReverseIcon size={12} />
39
- </StyledButton>
40
- </SwitchButtonContainer>
41
- );
42
- }