Skip to content

Commit

Permalink
build: bump
Browse files Browse the repository at this point in the history
  • Loading branch information
Majorfi committed Feb 13, 2024
1 parent 4fbe3cc commit 28281ce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 31 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@yearn-finance/web-lib",
"version": "3.0.165",
"version": "3.0.166",
"main": "./dist/index.js",
"types": "./dist/index.d.js",
"files": [
Expand Down
35 changes: 5 additions & 30 deletions src/components/LogoPopover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ import {cloneElement, useMemo, useState} from 'react';
import Link from 'next/link';
import {usePathname} from 'next/navigation';
import {motion} from 'framer-motion';
import {cl, toAddress} from '@builtbymom/web3/utils';
import {cl} from '@builtbymom/web3/utils';
import {Popover, Transition} from '@headlessui/react';

import {useIsMounted} from '../hooks/useIsMounted';
import {V3Logo} from '../icons/V3Logo';
import {ImageWithFallback} from './ImageWithFallback';
import {APPS} from './YearnApps';

import type {AnimationProps} from 'framer-motion';
Expand Down Expand Up @@ -50,24 +49,16 @@ function Logo(): ReactElement {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [typeof window, pathname]);

const vaultPageData = useMemo(() => {
const isVaultPage = useMemo(() => {
if (typeof window === 'undefined') {
return {
isVaultPage: false,
chainID: '',
vaultAddress: ''
};
return false;
}

const isVaultPage =
typeof window !== 'undefined' &&
window.location.pathname.startsWith('/vaults/') &&
window.location.pathname.split('/').length === 4;
return {
isVaultPage,
chainID: isVaultPage && window.location.pathname.split('/')[2],
vaultAddress: isVaultPage && window.location.pathname.split('/')[3]
};
return isVaultPage;
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [typeof window, pathname]);

Expand All @@ -79,27 +70,11 @@ function Logo(): ReactElement {
<MotionDiv
key={name}
name={name}
animate={shouldAnimate && !vaultPageData.isVaultPage ? 'enter' : 'exit'}>
animate={shouldAnimate && !isVaultPage ? 'enter' : 'exit'}>
{icon}
</MotionDiv>
);
})}
<MotionDiv
key={'Vaults'}
name={'Vaults'}
animate={vaultPageData.isVaultPage ? 'enter' : 'exit'}>
<ImageWithFallback
src={`https://assets.smold.app/api/token/${vaultPageData.chainID}/${toAddress(
vaultPageData.vaultAddress || ''
)}/logo-128.png`}
className={'-ml-9'}
alt={''}
smWidth={48}
smHeight={48}
width={72}
height={72}
/>
</MotionDiv>
</>
);
}
Expand Down

0 comments on commit 28281ce

Please sign in to comment.