@rango-dev/widget-embedded 0.23.1-next.15 → 0.23.1-next.16
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/QuoteWarningsAndErrors/QuoteWarningsAndErrors.helpers.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +3 -3
- package/dist/pages/Home.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.helpers.ts +2 -3
- package/src/pages/Home.tsx +10 -1
package/dist/pages/Home.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Home.d.ts","sourceRoot":"","sources":["../../src/pages/Home.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Home.d.ts","sourceRoot":"","sources":["../../src/pages/Home.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA8B,MAAM,OAAO,CAAC;AA4BnD,eAAO,MAAM,6BAA6B,MAAM,CAAC;AAEjD,wBAAgB,IAAI,sBAwMnB"}
|
package/package.json
CHANGED
|
@@ -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) {
|
package/src/pages/Home.tsx
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { SelectedQuote } from '../types';
|
|
2
|
+
|
|
1
3
|
import { i18n } from '@lingui/core';
|
|
2
4
|
import { Button, Divider, styled, WarningIcon } from '@rango-dev/ui';
|
|
3
5
|
import React, { useEffect, useState } from 'react';
|
|
@@ -114,6 +116,13 @@ export function Home() {
|
|
|
114
116
|
}
|
|
115
117
|
};
|
|
116
118
|
|
|
119
|
+
const onClickOnQuote = (quote: SelectedQuote) => {
|
|
120
|
+
if (selectedQuote?.requestId !== quote.requestId) {
|
|
121
|
+
setShowQuoteWarningModal(false);
|
|
122
|
+
setSelectedQuote(quote);
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
|
|
117
126
|
return (
|
|
118
127
|
<MainContainer>
|
|
119
128
|
<Layout
|
|
@@ -215,7 +224,7 @@ export function Home() {
|
|
|
215
224
|
{isExpandable ? (
|
|
216
225
|
<ExpandedQuotes
|
|
217
226
|
loading={fetchingQuote}
|
|
218
|
-
onClickOnQuote={
|
|
227
|
+
onClickOnQuote={onClickOnQuote}
|
|
219
228
|
fetch={fetchQuote}
|
|
220
229
|
onClickRefresh={onClickRefresh}
|
|
221
230
|
isVisible={isVisibleExpanded}
|