@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.
@@ -1 +1 @@
1
- {"version":3,"file":"Home.d.ts","sourceRoot":"","sources":["../../src/pages/Home.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA8B,MAAM,OAAO,CAAC;AA4BnD,eAAO,MAAM,6BAA6B,MAAM,CAAC;AAEjD,wBAAgB,IAAI,sBAiMnB"}
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rango-dev/widget-embedded",
3
- "version": "0.23.1-next.15",
3
+ "version": "0.23.1-next.16",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "source": "./src/index.ts",
@@ -48,4 +48,4 @@
48
48
  "publishConfig": {
49
49
  "access": "public"
50
50
  }
51
- }
51
+ }
@@ -23,13 +23,12 @@ export function makeAlerts(
23
23
  const alertInfo: AlertInfo = {
24
24
  alertType: 'warning',
25
25
  title: '',
26
- action: 'show-info',
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 = null;
52
+ alertInfo.action = 'show-info';
54
53
  alertInfo.title = errorMessages().highValueLossError.title;
55
54
  }
56
55
  if (warning.type === QuoteWarningType.UNKNOWN_PRICE) {
@@ -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={(quote) => setSelectedQuote(quote)}
227
+ onClickOnQuote={onClickOnQuote}
219
228
  fetch={fetchQuote}
220
229
  onClickRefresh={onClickRefresh}
221
230
  isVisible={isVisibleExpanded}