@rango-dev/widget-embedded 0.20.1-next.6 → 0.20.1-next.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rango-dev/widget-embedded",
3
- "version": "0.20.1-next.6",
3
+ "version": "0.20.1-next.7",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "source": "./src/index.ts",
@@ -8,5 +8,4 @@ export interface HomeButtonsPropTypes {
8
8
  onClickRefresh?: () => void;
9
9
  onClickHistory?: () => void;
10
10
  onClickSettings?: () => void;
11
- onClickNotifications?: () => void;
12
11
  }
@@ -20,13 +20,7 @@ import { HeaderButton } from './HeaderButtons.styles';
20
20
  import { UnreadNotificationsBadge } from './UnreadNotificationsBadge';
21
21
 
22
22
  export function HomeButtons(props: HomeButtonsPropTypes) {
23
- const {
24
- layoutRef,
25
- onClickRefresh,
26
- onClickHistory,
27
- onClickSettings,
28
- onClickNotifications,
29
- } = props;
23
+ const { layoutRef, onClickRefresh, onClickHistory, onClickSettings } = props;
30
24
 
31
25
  const {
32
26
  config: { features },
@@ -50,25 +44,24 @@ export function HomeButtons(props: HomeButtonsPropTypes) {
50
44
  </Tooltip>
51
45
 
52
46
  {!isNotificationsHidden && (
53
- <Tooltip
47
+ <Popover
48
+ align="center"
49
+ collisionBoundary={layoutRef}
50
+ collisionPadding={{ right: 20, left: 20 }}
54
51
  container={getContainer()}
55
- side="top"
56
- content={i18n.t('Notifications')}>
57
- <Popover
58
- align="center"
59
- collisionBoundary={layoutRef}
60
- collisionPadding={{ right: 20, left: 20 }}
61
- container={getContainer()}
62
- content={<NotificationContent />}>
63
- <HeaderButton
64
- size="small"
65
- variant="ghost"
66
- onClick={onClickNotifications}>
67
- <NotificationsIcon size={18} color="black" />
68
- <UnreadNotificationsBadge />
69
- </HeaderButton>
70
- </Popover>
71
- </Tooltip>
52
+ content={<NotificationContent />}>
53
+ <div>
54
+ <Tooltip
55
+ container={getContainer()}
56
+ side="top"
57
+ content={i18n.t('Notifications')}>
58
+ <HeaderButton size="small" variant="ghost">
59
+ <NotificationsIcon size={18} color="black" />
60
+ <UnreadNotificationsBadge />
61
+ </HeaderButton>
62
+ </Tooltip>
63
+ </div>
64
+ </Popover>
72
65
  )}
73
66
  <Tooltip
74
67
  container={getContainer()}
@@ -48,6 +48,7 @@ export function useSwapInput(): UseSwapInput {
48
48
  toToken,
49
49
  inputAmount,
50
50
  inputUsdValue,
51
+ quote,
51
52
  resetQuote,
52
53
  setQuote,
53
54
  } = useQuoteStore();
@@ -63,9 +64,9 @@ export function useSwapInput(): UseSwapInput {
63
64
  const [error, setError] = useState<QuoteError | null>(null);
64
65
  const [warning, setWarning] = useState<QuoteWarning | null>(null);
65
66
  const userSlippage = customSlippage ?? slippage;
66
- const hasTokensValue = !fromToken || !toToken;
67
+ const tokensValueInvalid = !fromToken || !toToken;
67
68
  const shouldSkipRequest =
68
- hasTokensValue ||
69
+ tokensValueInvalid ||
69
70
  tokensAreEqual(fromToken, toToken) ||
70
71
  !isPositiveNumber(inputAmount);
71
72
 
@@ -153,6 +154,9 @@ export function useSwapInput(): UseSwapInput {
153
154
  return;
154
155
  }
155
156
  if (shouldSkipRequest) {
157
+ if (quote) {
158
+ resetQuote();
159
+ }
156
160
  return;
157
161
  }
158
162
  resetQuote();