Commit 9131bf0f authored by Max Alekseenko's avatar Max Alekseenko

show tooltip only on marketplace page

parent b5242959
...@@ -26,12 +26,15 @@ const WalletTooltip = ({ children, isDisabled, isMobile }: Props) => { ...@@ -26,12 +26,15 @@ const WalletTooltip = ({ children, isDisabled, isMobile }: Props) => {
React.useEffect(() => { React.useEffect(() => {
const wasShown = window.localStorage.getItem(localStorageKey); const wasShown = window.localStorage.getItem(localStorageKey);
if (!isDisabled && !wasShown) { const isMarketplacePage = [ '/apps', '/apps/[id]' ].includes(router.pathname);
setIsTooltipShown.on(); if (!isDisabled && !wasShown && isMarketplacePage) {
window.localStorage.setItem(localStorageKey, 'true'); setTimeout(() => {
setTimeout(() => setIsTooltipShown.off(), 3000); setIsTooltipShown.on();
window.localStorage.setItem(localStorageKey, 'true');
setTimeout(() => setIsTooltipShown.off(), 5000);
}, 1000);
} }
}, [ setIsTooltipShown, localStorageKey, isDisabled ]); }, [ setIsTooltipShown, localStorageKey, isDisabled, router.pathname ]);
return ( return (
<Tooltip <Tooltip
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment