@rango-dev/widget-embedded 0.23.1-next.8 → 0.24.0
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/components/AppRouter.d.ts +1 -6
- package/dist/components/AppRouter.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts +1 -283
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.d.ts.map +1 -1
- package/dist/components/HeaderButtons/HeaderButtons.d.ts.map +1 -1
- package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts +489 -1
- package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts.map +1 -1
- package/dist/components/HeaderButtons/InProgressTransactionBadge.d.ts +4 -0
- package/dist/components/HeaderButtons/InProgressTransactionBadge.d.ts.map +1 -0
- package/dist/components/HeaderButtons/RefreshButton.d.ts.map +1 -1
- package/dist/components/HeaderButtons/UnreadNotificationsBadge.d.ts.map +1 -1
- package/dist/components/HeaderButtons/WalletButton.d.ts.map +1 -1
- package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.d.ts +1 -1
- package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.d.ts.map +1 -1
- package/dist/components/NoResult/NoResult.d.ts.map +1 -1
- package/dist/components/NoResult/NoResult.helpers.d.ts +8 -0
- package/dist/components/NoResult/NoResult.helpers.d.ts.map +1 -1
- package/dist/components/NoResult/NoResult.styles.d.ts +167 -1
- package/dist/components/NoResult/NoResult.styles.d.ts.map +1 -1
- package/dist/components/NoResult/NoResult.types.d.ts +1 -0
- package/dist/components/NoResult/NoResult.types.d.ts.map +1 -1
- package/dist/components/NotificationContent/NotificationContent.d.ts.map +1 -1
- package/dist/components/NotificationContent/NotificationContent.styles.d.ts +165 -0
- package/dist/components/NotificationContent/NotificationContent.styles.d.ts.map +1 -1
- package/dist/components/Quote/Quote.d.ts.map +1 -1
- package/dist/components/Quote/Quote.styles.d.ts.map +1 -1
- package/dist/components/Quote/Quote.types.d.ts +1 -0
- package/dist/components/Quote/Quote.types.d.ts.map +1 -1
- package/dist/components/Quote/QuoteTrigger.d.ts.map +1 -1
- package/dist/components/QuoteSkeleton/QuoteSkeleton.styles.d.ts +1 -0
- package/dist/components/QuoteSkeleton/QuoteSkeleton.styles.d.ts.map +1 -1
- package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.d.ts.map +1 -1
- package/dist/components/QuoteSkeleton/StepSkeleton.styles.d.ts +3 -1
- package/dist/components/QuoteSkeleton/StepSkeleton.styles.d.ts.map +1 -1
- package/dist/components/Quotes/Quotes.d.ts.map +1 -1
- package/dist/components/Quotes/Quotes.types.d.ts +1 -0
- package/dist/components/Quotes/Quotes.types.d.ts.map +1 -1
- package/dist/components/Quotes/SelectStrategy.d.ts.map +1 -1
- package/dist/components/Slippage/Slippage.d.ts.map +1 -1
- package/dist/components/SwapDetails/SwapDetails.d.ts.map +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.WalletState.d.ts.map +1 -1
- package/dist/components/TokenList/TokenList.d.ts.map +1 -1
- package/dist/constants/index.d.ts +1 -1
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/languages.d.ts.map +1 -1
- package/dist/constants/quote.d.ts +1 -5
- package/dist/constants/quote.d.ts.map +1 -1
- package/dist/constants/searchFor.d.ts +7 -0
- package/dist/constants/searchFor.d.ts.map +1 -0
- package/dist/containers/App/App.d.ts.map +1 -1
- package/dist/containers/App/App.styles.d.ts.map +1 -1
- package/dist/containers/ExpandedQuotes/ExpandedQuotes.d.ts.map +1 -1
- package/dist/containers/ExpandedQuotes/ExpandedQuotes.styles.d.ts +3 -1
- package/dist/containers/ExpandedQuotes/ExpandedQuotes.styles.d.ts.map +1 -1
- package/dist/containers/Inputs/Inputs.d.ts.map +1 -1
- package/dist/containers/Inputs/Inputs.types.d.ts +1 -0
- package/dist/containers/Inputs/Inputs.types.d.ts.map +1 -1
- package/dist/containers/QuoteInfo/QuoteInfo.d.ts.map +1 -1
- package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts +1 -0
- package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts.map +1 -1
- package/dist/containers/Settings/Lists.d.ts.map +1 -1
- package/dist/containers/Wallets/Wallets.d.ts.map +1 -1
- package/dist/containers/Wallets/Wallets.types.d.ts +13 -2
- package/dist/containers/Wallets/Wallets.types.d.ts.map +1 -1
- package/dist/containers/Widget/Widget.d.ts.map +1 -1
- package/dist/hooks/useBootstrap/index.d.ts +2 -0
- package/dist/hooks/useBootstrap/index.d.ts.map +1 -0
- package/dist/hooks/useBootstrap/useBootstrap.d.ts +2 -0
- package/dist/hooks/useBootstrap/useBootstrap.d.ts.map +1 -0
- package/dist/hooks/useScreenDetect.d.ts +9 -0
- package/dist/hooks/useScreenDetect.d.ts.map +1 -0
- package/dist/hooks/useSwapInput.d.ts.map +1 -1
- package/dist/hooks/useTheme.d.ts.map +1 -1
- package/dist/hooks/useWalletList.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +4 -4
- package/dist/pages/ConfirmSwapPage.d.ts.map +1 -1
- package/dist/pages/Home.d.ts.map +1 -1
- package/dist/pages/LanguagePage.d.ts.map +1 -1
- package/dist/pages/LiquiditySourcePage.d.ts.map +1 -1
- package/dist/pages/SelectSwapItemsPage.d.ts.map +1 -1
- package/dist/pages/SettingsPage.d.ts.map +1 -1
- package/dist/store/AppStore.d.ts +2 -2
- package/dist/store/app.d.ts +2 -2
- package/dist/store/slices/config.d.ts.map +1 -1
- package/dist/store/slices/data.d.ts +3 -1
- package/dist/store/slices/data.d.ts.map +1 -1
- package/dist/store/slices/settings.d.ts.map +1 -1
- package/dist/types/config.d.ts +9 -5
- package/dist/types/config.d.ts.map +1 -1
- package/dist/utils/colors.d.ts +5 -3
- package/dist/utils/colors.d.ts.map +1 -1
- package/dist/utils/common.d.ts +4 -0
- package/dist/utils/common.d.ts.map +1 -1
- package/dist/utils/configs.d.ts +2 -1
- package/dist/utils/configs.d.ts.map +1 -1
- package/dist/utils/meta.d.ts +1 -0
- package/dist/utils/meta.d.ts.map +1 -1
- package/dist/utils/swap.d.ts +2 -0
- package/dist/utils/swap.d.ts.map +1 -1
- package/dist/utils/ui.d.ts +5 -2
- package/dist/utils/ui.d.ts.map +1 -1
- package/dist/utils/wallets.d.ts +1 -1
- package/dist/utils/wallets.d.ts.map +1 -1
- package/package.json +8 -7
- package/src/components/AppRouter.tsx +1 -29
- package/src/components/ConfirmWalletsModal/ConfirmWallets.styles.ts +6 -12
- package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +7 -11
- package/src/components/ConfirmWalletsModal/WalletList.tsx +2 -2
- package/src/components/HeaderButtons/HeaderButtons.styles.ts +43 -2
- package/src/components/HeaderButtons/HeaderButtons.tsx +2 -0
- package/src/components/HeaderButtons/InProgressTransactionBadge.tsx +26 -0
- package/src/components/HeaderButtons/RefreshButton.tsx +2 -1
- package/src/components/HeaderButtons/UnreadNotificationsBadge.tsx +10 -2
- package/src/components/HeaderButtons/WalletButton.tsx +26 -6
- package/src/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.ts +1 -1
- package/src/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.tsx +4 -4
- package/src/components/NoResult/NoResult.helpers.ts +13 -0
- package/src/components/NoResult/NoResult.styles.ts +19 -1
- package/src/components/NoResult/NoResult.tsx +27 -16
- package/src/components/NoResult/NoResult.types.ts +1 -0
- package/src/components/NotificationContent/NotificationContent.styles.ts +14 -1
- package/src/components/NotificationContent/NotificationContent.tsx +49 -39
- package/src/components/Quote/Quote.styles.ts +13 -14
- package/src/components/Quote/Quote.tsx +166 -145
- package/src/components/Quote/Quote.types.ts +1 -0
- package/src/components/Quote/QuoteTrigger.tsx +19 -14
- package/src/components/QuoteSkeleton/QuoteSkeleton.styles.ts +10 -2
- package/src/components/QuoteSkeleton/QuoteSkeleton.tsx +2 -2
- package/src/components/QuoteSkeleton/QuoteSummarySkeleton.styles.ts +2 -2
- package/src/components/QuoteSkeleton/QuoteSummarySkeleton.tsx +5 -4
- package/src/components/QuoteSkeleton/StepSkeleton.styles.ts +7 -0
- package/src/components/QuoteSkeleton/StepSkeleton.tsx +1 -1
- package/src/components/QuoteWarningsAndErrors/HighValueLossWarningModal.tsx +1 -1
- package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.helpers.ts +3 -3
- package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.ts +1 -1
- package/src/components/Quotes/Quotes.tsx +33 -21
- package/src/components/Quotes/Quotes.types.ts +1 -0
- package/src/components/Quotes/SelectStrategy.tsx +27 -10
- package/src/components/Slippage/Slippage.tsx +11 -13
- package/src/components/SwapDetails/SwapDetails.tsx +3 -1
- package/src/components/SwapDetailsModal/SwapDetailsModal.WalletState.tsx +5 -1
- package/src/components/TokenList/TokenList.tsx +9 -8
- package/src/constants/errors.ts +1 -1
- package/src/constants/index.ts +1 -1
- package/src/constants/languages.ts +27 -1
- package/src/constants/quote.ts +1 -24
- package/src/constants/searchFor.ts +6 -0
- package/src/containers/App/App.styles.ts +0 -4
- package/src/containers/App/App.tsx +4 -28
- package/src/containers/ExpandedQuotes/ExpandedQuotes.styles.ts +13 -0
- package/src/containers/ExpandedQuotes/ExpandedQuotes.tsx +5 -0
- package/src/containers/Inputs/Inputs.tsx +2 -3
- package/src/containers/Inputs/Inputs.types.ts +1 -0
- package/src/containers/QuoteInfo/QuoteInfo.tsx +2 -0
- package/src/containers/QuoteInfo/QuoteInfo.types.ts +1 -0
- package/src/containers/Settings/Lists.tsx +28 -13
- package/src/containers/Wallets/Wallets.tsx +27 -10
- package/src/containers/Wallets/Wallets.types.ts +13 -2
- package/src/containers/Widget/Widget.tsx +13 -13
- package/src/hooks/useBootstrap/index.ts +1 -0
- package/src/hooks/useBootstrap/useBootstrap.ts +72 -0
- package/src/hooks/useScreenDetect.ts +49 -0
- package/src/hooks/useSwapInput.ts +7 -2
- package/src/hooks/useTheme.ts +1 -8
- package/src/hooks/useWalletList.ts +12 -0
- package/src/pages/ConfirmSwapPage.tsx +14 -5
- package/src/pages/Home.tsx +29 -7
- package/src/pages/LanguagePage.tsx +14 -1
- package/src/pages/LiquiditySourcePage.tsx +4 -3
- package/src/pages/SelectSwapItemsPage.tsx +2 -7
- package/src/pages/SettingsPage.tsx +0 -1
- package/src/store/slices/config.ts +3 -2
- package/src/store/slices/data.ts +82 -34
- package/src/store/slices/settings.ts +10 -4
- package/src/types/config.ts +9 -5
- package/src/utils/colors.ts +106 -75
- package/src/utils/common.ts +181 -0
- package/src/utils/configs.ts +12 -1
- package/src/utils/meta.ts +21 -0
- package/src/utils/swap.ts +12 -5
- package/src/utils/ui.ts +7 -5
- package/src/utils/wallets.ts +5 -47
- package/dist/hooks/useMobileDetect.d.ts +0 -3
- package/dist/hooks/useMobileDetect.d.ts.map +0 -1
- package/src/hooks/useMobileDetect.ts +0 -21
|
@@ -6,6 +6,7 @@ import { i18n } from '@lingui/core';
|
|
|
6
6
|
import {
|
|
7
7
|
Alert,
|
|
8
8
|
Divider,
|
|
9
|
+
FullExpandedQuote,
|
|
9
10
|
InfoIcon,
|
|
10
11
|
QuoteTag,
|
|
11
12
|
StepDetails,
|
|
@@ -33,7 +34,7 @@ import {
|
|
|
33
34
|
} from '../../containers/QuoteInfo/QuoteInfo.styles';
|
|
34
35
|
import { useAppStore } from '../../store/AppStore';
|
|
35
36
|
import { QuoteErrorType, QuoteWarningType } from '../../types';
|
|
36
|
-
import { getContainer } from '../../utils/common';
|
|
37
|
+
import { getContainer, getExpanded } from '../../utils/common';
|
|
37
38
|
import {
|
|
38
39
|
getBlockchainShortNameFor,
|
|
39
40
|
getSwapperDisplayName,
|
|
@@ -83,6 +84,7 @@ export function Quote(props: QuoteProps) {
|
|
|
83
84
|
tagHidden = true,
|
|
84
85
|
showModalFee = true,
|
|
85
86
|
onClickAllRoutes,
|
|
87
|
+
fullExpandedMode = false,
|
|
86
88
|
} = props;
|
|
87
89
|
const blockchains = useAppStore().blockchains();
|
|
88
90
|
const tokens = useAppStore().tokens();
|
|
@@ -298,157 +300,176 @@ export function Quote(props: QuoteProps) {
|
|
|
298
300
|
GAS_FEE_MAX_DECIMALS
|
|
299
301
|
);
|
|
300
302
|
|
|
301
|
-
|
|
302
|
-
<>
|
|
303
|
-
<SummaryContainer
|
|
304
|
-
selected={selected}
|
|
305
|
-
listItem={type === 'list-item'}
|
|
306
|
-
basic={type === 'basic'}>
|
|
307
|
-
<div className={summaryStyles()}>
|
|
308
|
-
{!tagHidden && sortedQuoteTags.length ? (
|
|
309
|
-
<>
|
|
310
|
-
<TagContainer>
|
|
311
|
-
{sortedQuoteTags.map((tag, index) => {
|
|
312
|
-
const key = `${tag.value}_${index}`;
|
|
313
|
-
return (
|
|
314
|
-
<>
|
|
315
|
-
<QuoteTag label={tag.label} key={key} value={tag.value} />
|
|
316
|
-
<Divider size={4} direction="horizontal" />
|
|
317
|
-
</>
|
|
318
|
-
);
|
|
319
|
-
})}
|
|
320
|
-
</TagContainer>
|
|
321
|
-
<Line />
|
|
322
|
-
{!showAllRoutesButton && <Divider size={4} />}
|
|
323
|
-
</>
|
|
324
|
-
) : null}
|
|
325
|
-
<div id="portal-root" className={summaryHeaderStyles()}>
|
|
326
|
-
<QuoteCostDetails
|
|
327
|
-
quote={quote}
|
|
328
|
-
time={totalTime}
|
|
329
|
-
fee={fee}
|
|
330
|
-
feeWarning={totalFee.gte(new BigNumber(GAS_FEE_MAX))}
|
|
331
|
-
showModalFee={showModalFee}
|
|
332
|
-
steps={numberOfSteps}
|
|
333
|
-
/>
|
|
303
|
+
const feeWarning = totalFee.gte(new BigNumber(GAS_FEE_MAX));
|
|
334
304
|
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
}
|
|
368
|
-
</
|
|
369
|
-
|
|
370
|
-
|
|
305
|
+
return fullExpandedMode ? (
|
|
306
|
+
<FullExpandedQuote
|
|
307
|
+
selected={selected}
|
|
308
|
+
fee={fee}
|
|
309
|
+
time={totalTime}
|
|
310
|
+
tooltipContainer={getExpanded()}
|
|
311
|
+
steps={steps}
|
|
312
|
+
tags={sortedQuoteTags}
|
|
313
|
+
feeWarning={feeWarning}
|
|
314
|
+
percentageChange={percentageChange}
|
|
315
|
+
warningLevel={priceImpactWarningLevel}
|
|
316
|
+
outputPrice={{
|
|
317
|
+
value: roundedOutput,
|
|
318
|
+
usdValue: roundedOutputUsdValue,
|
|
319
|
+
realValue: formatTooltipNumbers(output.value),
|
|
320
|
+
realUsdValue: formatTooltipNumbers(output.usdValue),
|
|
321
|
+
}}
|
|
322
|
+
/>
|
|
323
|
+
) : (
|
|
324
|
+
<SummaryContainer
|
|
325
|
+
selected={selected}
|
|
326
|
+
listItem={type === 'list-item'}
|
|
327
|
+
basic={type === 'basic'}>
|
|
328
|
+
<div className={summaryStyles()}>
|
|
329
|
+
{!tagHidden && sortedQuoteTags.length ? (
|
|
330
|
+
<>
|
|
331
|
+
<TagContainer>
|
|
332
|
+
{sortedQuoteTags.map((tag, index) => {
|
|
333
|
+
const key = `${tag.value}_${index}`;
|
|
334
|
+
return (
|
|
335
|
+
<React.Fragment key={key}>
|
|
336
|
+
<QuoteTag label={tag.label} value={tag.value} />
|
|
337
|
+
<Divider size={4} direction="horizontal" />
|
|
338
|
+
</React.Fragment>
|
|
339
|
+
);
|
|
340
|
+
})}
|
|
341
|
+
</TagContainer>
|
|
342
|
+
<Line />
|
|
343
|
+
{!showAllRoutesButton && <Divider size={4} />}
|
|
344
|
+
</>
|
|
345
|
+
) : null}
|
|
346
|
+
<div id="portal-root" className={summaryHeaderStyles()}>
|
|
347
|
+
<QuoteCostDetails
|
|
348
|
+
quote={quote}
|
|
349
|
+
time={totalTime}
|
|
350
|
+
fee={fee}
|
|
351
|
+
feeWarning={feeWarning}
|
|
352
|
+
showModalFee={showModalFee}
|
|
353
|
+
steps={numberOfSteps}
|
|
354
|
+
/>
|
|
355
|
+
|
|
356
|
+
{showAllRoutesButton && (
|
|
357
|
+
<AllRoutesButton
|
|
358
|
+
onClick={(e) => {
|
|
359
|
+
e.stopPropagation();
|
|
360
|
+
onClickAllRoutes();
|
|
361
|
+
}}
|
|
362
|
+
size="xxsmall"
|
|
363
|
+
type="secondary"
|
|
364
|
+
variant="default">
|
|
365
|
+
<Typography color="secondary" variant="label" size="medium">
|
|
366
|
+
{i18n.t('See All Routes')}
|
|
367
|
+
</Typography>
|
|
368
|
+
</AllRoutesButton>
|
|
369
|
+
)}
|
|
370
|
+
</div>
|
|
371
|
+
{type === 'basic' && (
|
|
372
|
+
<div className={basicInfoStyles()}>
|
|
373
|
+
<FrameIcon>
|
|
374
|
+
<InfoIcon size={12} color="gray" />
|
|
375
|
+
</FrameIcon>
|
|
376
|
+
<ContainerInfoOutput>
|
|
377
|
+
<BasicInfoOutput size="small" variant="body">
|
|
378
|
+
{`${roundedInput} ${steps[0].from.token.displayName} = `}
|
|
379
|
+
</BasicInfoOutput>
|
|
371
380
|
<Tooltip
|
|
372
|
-
content={formatTooltipNumbers(output.
|
|
381
|
+
content={formatTooltipNumbers(output.value)}
|
|
373
382
|
container={container}
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
variant="body">
|
|
382
|
-
{`($${roundedOutputUsdValue})`}
|
|
383
|
-
</Typography>
|
|
383
|
+
open={!output.value ? false : undefined}>
|
|
384
|
+
<BasicInfoOutput size="small" variant="body">
|
|
385
|
+
|
|
386
|
+
{`${roundedOutput} ${
|
|
387
|
+
steps[steps.length - 1].to.token.displayName
|
|
388
|
+
}`}
|
|
389
|
+
</BasicInfoOutput>
|
|
384
390
|
</Tooltip>
|
|
385
|
-
</
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
391
|
+
</ContainerInfoOutput>
|
|
392
|
+
<Tooltip
|
|
393
|
+
content={formatTooltipNumbers(output.usdValue)}
|
|
394
|
+
container={container}
|
|
395
|
+
style={{
|
|
396
|
+
display: 'flex',
|
|
397
|
+
}}>
|
|
398
|
+
<Typography
|
|
399
|
+
color="$neutral600"
|
|
400
|
+
ml={2}
|
|
401
|
+
size="xsmall"
|
|
402
|
+
variant="body">
|
|
403
|
+
{`($${roundedOutputUsdValue})`}
|
|
404
|
+
</Typography>
|
|
405
|
+
</Tooltip>
|
|
406
|
+
</div>
|
|
407
|
+
)}
|
|
408
|
+
{type === 'list-item' && (
|
|
409
|
+
<TokenAmount
|
|
410
|
+
tooltipContainer={container}
|
|
411
|
+
type="output"
|
|
412
|
+
direction="vertical"
|
|
413
|
+
price={{
|
|
414
|
+
value: roundedOutput,
|
|
415
|
+
usdValue: roundedOutputUsdValue,
|
|
416
|
+
realValue: formatTooltipNumbers(output.value),
|
|
417
|
+
realUsdValue: formatTooltipNumbers(output.usdValue),
|
|
418
|
+
}}
|
|
419
|
+
token={{
|
|
420
|
+
displayName: steps[numberOfSteps - 1].to.token.displayName,
|
|
421
|
+
image: steps[numberOfSteps - 1].to.token.image,
|
|
422
|
+
}}
|
|
423
|
+
chain={{ image: steps[numberOfSteps - 1].to.chain.image }}
|
|
424
|
+
percentageChange={percentageChange}
|
|
425
|
+
warningLevel={priceImpactWarningLevel}
|
|
426
|
+
/>
|
|
427
|
+
)}
|
|
428
|
+
{type === 'swap-preview' && (
|
|
429
|
+
<>
|
|
430
|
+
<QuoteSummary
|
|
431
|
+
from={steps[0].from}
|
|
432
|
+
to={steps[numberOfSteps - 1].to}
|
|
403
433
|
percentageChange={percentageChange}
|
|
404
434
|
warningLevel={priceImpactWarningLevel}
|
|
405
435
|
/>
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
<QuoteContainer
|
|
436
|
+
<Divider size={4} />
|
|
437
|
+
</>
|
|
438
|
+
)}
|
|
439
|
+
</div>
|
|
440
|
+
<QuoteContainer
|
|
441
|
+
selected={selected}
|
|
442
|
+
listItem={type === 'list-item'}
|
|
443
|
+
open={expanded}
|
|
444
|
+
className="quote_container"
|
|
445
|
+
onOpenChange={setExpanded}>
|
|
446
|
+
<QuoteTrigger
|
|
447
|
+
type={type}
|
|
448
|
+
quoteRef={quoteRef}
|
|
420
449
|
selected={selected}
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
/>
|
|
446
|
-
);
|
|
447
|
-
})}
|
|
448
|
-
</div>
|
|
449
|
-
</Content>
|
|
450
|
-
</QuoteContainer>
|
|
451
|
-
</SummaryContainer>
|
|
452
|
-
</>
|
|
450
|
+
setExpanded={setExpanded}
|
|
451
|
+
expanded={expanded}
|
|
452
|
+
steps={steps}
|
|
453
|
+
/>
|
|
454
|
+
<Content open={expanded}>
|
|
455
|
+
<HorizontalSeparator />
|
|
456
|
+
<div className={stepsDetailsStyles()}>
|
|
457
|
+
{steps.map((step, index) => {
|
|
458
|
+
const key = `item-${index}`;
|
|
459
|
+
return (
|
|
460
|
+
<StepDetails
|
|
461
|
+
type="quote-details"
|
|
462
|
+
key={key}
|
|
463
|
+
tooltipContainer={container}
|
|
464
|
+
step={step}
|
|
465
|
+
hasSeparator={index !== steps.length - 1}
|
|
466
|
+
state={step.state}
|
|
467
|
+
/>
|
|
468
|
+
);
|
|
469
|
+
})}
|
|
470
|
+
</div>
|
|
471
|
+
</Content>
|
|
472
|
+
</QuoteContainer>
|
|
473
|
+
</SummaryContainer>
|
|
453
474
|
);
|
|
454
475
|
}
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from '@rango-dev/ui';
|
|
12
12
|
import React from 'react';
|
|
13
13
|
|
|
14
|
-
import
|
|
14
|
+
import useScreenDetect from '../../hooks/useScreenDetect';
|
|
15
15
|
import { getContainer } from '../../utils/common';
|
|
16
16
|
import { getUniqueBlockchains } from '../../utils/quote';
|
|
17
17
|
|
|
@@ -48,7 +48,7 @@ export function QuoteTrigger(props: QuoteTriggerProps) {
|
|
|
48
48
|
const tooltipContainer = getContainer();
|
|
49
49
|
const numberOfSteps = steps.length;
|
|
50
50
|
const blockchains = getUniqueBlockchains(steps);
|
|
51
|
-
const isMobile =
|
|
51
|
+
const { isTablet, isMobile } = useScreenDetect();
|
|
52
52
|
|
|
53
53
|
return (
|
|
54
54
|
<Trigger
|
|
@@ -72,15 +72,15 @@ export function QuoteTrigger(props: QuoteTriggerProps) {
|
|
|
72
72
|
</IconContainer>
|
|
73
73
|
);
|
|
74
74
|
|
|
75
|
-
return isMobile ? (
|
|
76
|
-
|
|
75
|
+
return isMobile || isTablet ? (
|
|
76
|
+
<React.Fragment key={key}>
|
|
77
77
|
<ImageComponent
|
|
78
78
|
content={step.swapper.displayName}
|
|
79
79
|
src={step.swapper.image}
|
|
80
80
|
state={step.state}
|
|
81
81
|
/>
|
|
82
82
|
{index !== numberOfSteps - 1 && <>{arrow}</>}
|
|
83
|
-
|
|
83
|
+
</React.Fragment>
|
|
84
84
|
) : (
|
|
85
85
|
<React.Fragment key={key}>
|
|
86
86
|
{numberOfSteps <= MAX_STEPS ||
|
|
@@ -148,17 +148,22 @@ export function QuoteTrigger(props: QuoteTriggerProps) {
|
|
|
148
148
|
</Typography>
|
|
149
149
|
<Divider direction="horizontal" size={4} />
|
|
150
150
|
{blockchains.map((blockchain, index) => (
|
|
151
|
-
|
|
151
|
+
<React.Fragment key={blockchain.displayName}>
|
|
152
152
|
{blockchains.length <= MAX_BLOCKCHAINS ||
|
|
153
153
|
(blockchains.length > MAX_BLOCKCHAINS &&
|
|
154
154
|
index < MAX_BLOCKCHAINS - 1) ? (
|
|
155
|
-
<
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
155
|
+
<Tooltip
|
|
156
|
+
container={tooltipContainer}
|
|
157
|
+
side="bottom"
|
|
158
|
+
content={blockchain.displayName}
|
|
159
|
+
sideOffset={4}>
|
|
160
|
+
<ImageComponent
|
|
161
|
+
content={''}
|
|
162
|
+
src={blockchain.image}
|
|
163
|
+
open={false}
|
|
164
|
+
className={index !== 0 ? 'blockchainImage' : ''}
|
|
165
|
+
/>
|
|
166
|
+
</Tooltip>
|
|
162
167
|
) : (
|
|
163
168
|
index === MAX_BLOCKCHAINS - 1 && (
|
|
164
169
|
<Tooltip
|
|
@@ -190,7 +195,7 @@ export function QuoteTrigger(props: QuoteTriggerProps) {
|
|
|
190
195
|
</Tooltip>
|
|
191
196
|
)
|
|
192
197
|
)}
|
|
193
|
-
|
|
198
|
+
</React.Fragment>
|
|
194
199
|
))}
|
|
195
200
|
|
|
196
201
|
<Divider direction="horizontal" size={32} />
|
|
@@ -8,13 +8,21 @@ export const Container = styled('div', {
|
|
|
8
8
|
backgroundColor: '$$color',
|
|
9
9
|
borderBottomLeftRadius: '$xm',
|
|
10
10
|
borderBottomRightRadius: '$xm',
|
|
11
|
-
padding: '$15
|
|
11
|
+
padding: '$15',
|
|
12
12
|
variants: {
|
|
13
13
|
rounded: {
|
|
14
14
|
true: {
|
|
15
15
|
borderRadius: '$xm',
|
|
16
16
|
},
|
|
17
17
|
},
|
|
18
|
+
expanded: {
|
|
19
|
+
true: {
|
|
20
|
+
paddingBottom: '3px',
|
|
21
|
+
},
|
|
22
|
+
false: {
|
|
23
|
+
paddingBottom: '$12',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
18
26
|
},
|
|
19
27
|
});
|
|
20
28
|
|
|
@@ -27,7 +35,7 @@ export const Steps = styled('div', {
|
|
|
27
35
|
});
|
|
28
36
|
|
|
29
37
|
export const StepSeparator = styled('div', {
|
|
30
|
-
borderLeft: '1px dashed
|
|
38
|
+
borderLeft: '1px dashed $foreground',
|
|
31
39
|
minHeight: ' 0',
|
|
32
40
|
margin: '0px 11.5px',
|
|
33
41
|
alignSelf: 'stretch',
|
|
@@ -11,7 +11,7 @@ export function QuoteSkeleton(props: PropTypes) {
|
|
|
11
11
|
const { type, expanded, tagHidden = false } = props;
|
|
12
12
|
|
|
13
13
|
return (
|
|
14
|
-
<Container rounded={type !== 'basic'}>
|
|
14
|
+
<Container expanded={expanded} rounded={type !== 'basic'}>
|
|
15
15
|
<QuoteSummarySkeleton type={type} tagHidden={tagHidden} />
|
|
16
16
|
<Chains>
|
|
17
17
|
<Skeleton height={15} variant="rounded" />
|
|
@@ -19,7 +19,7 @@ export function QuoteSkeleton(props: PropTypes) {
|
|
|
19
19
|
|
|
20
20
|
{expanded && (
|
|
21
21
|
<Steps>
|
|
22
|
-
<Divider size={
|
|
22
|
+
<Divider size={24} />
|
|
23
23
|
<StepSkeleton />
|
|
24
24
|
<StepSkeleton />
|
|
25
25
|
<StepSkeleton separator={false} />
|
|
@@ -9,7 +9,7 @@ export const BasicSummary = styled('div', {
|
|
|
9
9
|
});
|
|
10
10
|
|
|
11
11
|
export const Output = styled('div', {
|
|
12
|
-
padding: '
|
|
12
|
+
padding: '14px $0 $20 $0',
|
|
13
13
|
display: 'flex',
|
|
14
14
|
flexDirection: 'column',
|
|
15
15
|
});
|
|
@@ -27,7 +27,7 @@ export const QuoteSummary = styled('div', {
|
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
export const QuoteSummarySeparator = styled('div', {
|
|
30
|
-
height: '$
|
|
30
|
+
height: '$24',
|
|
31
31
|
marginLeft: '13px',
|
|
32
32
|
borderLeft: '1px solid $neutral700',
|
|
33
33
|
});
|
|
@@ -41,11 +41,11 @@ export function QuoteSummarySkeleton(props: PropTypes) {
|
|
|
41
41
|
{!tagHidden && (
|
|
42
42
|
<>
|
|
43
43
|
<FlexContent>
|
|
44
|
-
<Skeleton width={65} height={
|
|
44
|
+
<Skeleton width={65} height={20} variant="rounded" />
|
|
45
45
|
<Divider size={4} direction="horizontal" />
|
|
46
|
-
<Skeleton width={65} height={
|
|
46
|
+
<Skeleton width={65} height={20} variant="rounded" />
|
|
47
47
|
<Divider size={4} direction="horizontal" />
|
|
48
|
-
<Skeleton width={65} height={
|
|
48
|
+
<Skeleton width={65} height={20} variant="rounded" />
|
|
49
49
|
</FlexContent>
|
|
50
50
|
<Line />
|
|
51
51
|
{!showAllRoutesSkeleton && <Divider size={4} />}
|
|
@@ -60,7 +60,7 @@ export function QuoteSummarySkeleton(props: PropTypes) {
|
|
|
60
60
|
<Skeleton width={60} height={10} variant="rounded" />
|
|
61
61
|
</FlexContent>
|
|
62
62
|
{showAllRoutesSkeleton && (
|
|
63
|
-
<Skeleton width={
|
|
63
|
+
<Skeleton width={85} height={24} variant="rounded" />
|
|
64
64
|
)}
|
|
65
65
|
</div>
|
|
66
66
|
|
|
@@ -88,6 +88,7 @@ export function QuoteSummarySkeleton(props: PropTypes) {
|
|
|
88
88
|
<QuoteSummarySeparator />
|
|
89
89
|
{quotePreview}
|
|
90
90
|
</SwapPreview>
|
|
91
|
+
<Divider size={12} />
|
|
91
92
|
</>
|
|
92
93
|
)}
|
|
93
94
|
</div>
|
|
@@ -11,6 +11,13 @@ export const StepTokens = styled('div', {
|
|
|
11
11
|
paddingBottom: '$10',
|
|
12
12
|
display: 'flex',
|
|
13
13
|
alignItems: 'center',
|
|
14
|
+
variants: {
|
|
15
|
+
extraSpace: {
|
|
16
|
+
true: {
|
|
17
|
+
paddingBottom: '$40',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
14
21
|
});
|
|
15
22
|
|
|
16
23
|
export const StepTokenInfo = styled('div', {
|
|
@@ -23,7 +23,7 @@ export function StepSkeleton(props: PropTypes) {
|
|
|
23
23
|
</StepTitle>
|
|
24
24
|
<StepContent>
|
|
25
25
|
<StepSeparator hideSeparator={!separator} />
|
|
26
|
-
<StepTokens>
|
|
26
|
+
<StepTokens extraSpace={separator}>
|
|
27
27
|
<StepTokenInfo>
|
|
28
28
|
<ChainToken size="small" loading chainImage="" tokenImage="" />
|
|
29
29
|
<Divider direction="horizontal" size={8} />
|
|
@@ -23,13 +23,12 @@ export function makeAlerts(
|
|
|
23
23
|
const alertInfo: AlertInfo = {
|
|
24
24
|
alertType: 'warning',
|
|
25
25
|
title: '',
|
|
26
|
-
action:
|
|
26
|
+
action: null,
|
|
27
27
|
};
|
|
28
28
|
if (error) {
|
|
29
29
|
alertInfo.alertType = 'error';
|
|
30
30
|
if (error.type === QuoteErrorType.BRIDGE_LIMIT) {
|
|
31
31
|
alertInfo.title = error.recommendation;
|
|
32
|
-
alertInfo.action = 'show-info';
|
|
33
32
|
}
|
|
34
33
|
|
|
35
34
|
if (error.type === QuoteErrorType.INSUFFICIENT_SLIPPAGE) {
|
|
@@ -50,7 +49,7 @@ export function makeAlerts(
|
|
|
50
49
|
if (warningLevel === 'high') {
|
|
51
50
|
alertInfo.alertType = 'error';
|
|
52
51
|
}
|
|
53
|
-
alertInfo.action =
|
|
52
|
+
alertInfo.action = 'show-info';
|
|
54
53
|
alertInfo.title = errorMessages().highValueLossError.title;
|
|
55
54
|
}
|
|
56
55
|
if (warning.type === QuoteWarningType.UNKNOWN_PRICE) {
|
|
@@ -67,6 +66,7 @@ export function makeAlerts(
|
|
|
67
66
|
}
|
|
68
67
|
if (warning.type === QuoteWarningType.HIGH_SLIPPAGE) {
|
|
69
68
|
alertInfo.title = i18n.t('Caution, your slippage is high.');
|
|
69
|
+
alertInfo.action = 'change-settings';
|
|
70
70
|
}
|
|
71
71
|
return alertInfo;
|
|
72
72
|
}
|