@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/dist/components/HeaderButtons/HeaderButtons.types.d.ts +0 -1
- package/dist/components/HeaderButtons/HeaderButtons.types.d.ts.map +1 -1
- package/dist/components/HeaderButtons/HomeButtons.d.ts.map +1 -1
- package/dist/hooks/useSwapInput.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
- package/src/components/HeaderButtons/HeaderButtons.types.ts +0 -1
- package/src/components/HeaderButtons/HomeButtons.tsx +18 -25
- package/src/hooks/useSwapInput.ts +6 -2
package/package.json
CHANGED
|
@@ -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
|
-
<
|
|
47
|
+
<Popover
|
|
48
|
+
align="center"
|
|
49
|
+
collisionBoundary={layoutRef}
|
|
50
|
+
collisionPadding={{ right: 20, left: 20 }}
|
|
54
51
|
container={getContainer()}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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
|
|
67
|
+
const tokensValueInvalid = !fromToken || !toToken;
|
|
67
68
|
const shouldSkipRequest =
|
|
68
|
-
|
|
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();
|