Skip to content

Commit

Permalink
build: bump
Browse files Browse the repository at this point in the history
  • Loading branch information
Majorfi committed Feb 9, 2024
1 parent a8aa022 commit 3eeeeb4
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 14 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.136",
"version": "3.0.137",
"main": "./dist/index.js",
"types": "./dist/index.d.js",
"files": [
Expand Down
22 changes: 18 additions & 4 deletions src/components/LogoPopover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,34 @@ function MotionDiv({animate, name, children}: TMotionDiv): ReactElement {
function Logo(): ReactElement {
const {pathname} = useRouter();

const currentHost = useMemo(() => {
if (typeof window === 'undefined') {
return 'yearn.fi';
}
return window.location.host;
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [typeof window]);

const isYearnFi = useMemo(() => {
return currentHost === 'yearn.fi' || currentHost.includes('localhost:');
}, [currentHost]);

return (
<>
{Object.values(APPS).map(({name, pathCheck, icon}): ReactElement => {
{Object.values(APPS).map(({name, host, icon}): ReactElement => {
const shouldAnimate = currentHost.includes(host) || (isYearnFi && pathname.includes(host));
return (
<MotionDiv
key={name}
name={name}
animate={pathname.includes(pathCheck) ? 'enter' : 'exit'}>
animate={shouldAnimate ? 'enter' : 'exit'}>
{icon}
</MotionDiv>
);
})}
<MotionDiv
name={'yearn'}
animate={pathname === '/' ? 'enter' : 'exit'}>
animate={isYearnFi && pathname === '/' ? 'enter' : 'exit'}>
<LogoYearn
className={'size-8'}
back={'text-primary'}
Expand All @@ -70,7 +84,7 @@ export function LogoPopover(): ReactElement {

const currentApp = useMemo(() => {
const pageURI = router.pathname.toLowerCase();
return Object.values(APPS).find(({pathCheck}): boolean => pageURI.includes(pathCheck)) || APPS.Vaults;
return Object.values(APPS).find(({host}): boolean => pageURI.includes(host)) || APPS.Vaults;
}, [router]);

return (
Expand Down
18 changes: 9 additions & 9 deletions src/components/YearnApps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const APPS = {
V3: {
name: 'V3 Vaults',
href: 'https://yearn.fi/v3',
pathCheck: 'yearn.fi/v3',
host: 'v3',
icon: (
<LogoYearn
className={'size-8'}
Expand All @@ -20,7 +20,7 @@ export const APPS = {
Juiced: {
name: 'Juiced Vaults',
href: 'https://juiced.yearn.fi',
pathCheck: 'juiced.yearn.fi',
host: 'juiced.yearn.fi',
icon: (
<Image
className={'size-8'}
Expand All @@ -36,7 +36,7 @@ export const APPS = {
Vaults: {
name: 'Vaults',
href: 'https://yearn.fi/vaults',
pathCheck: 'yearn.fi/vaults',
host: 'vaults',
icon: (
<LogoYearn
className={'size-8'}
Expand All @@ -48,7 +48,7 @@ export const APPS = {
yCRV: {
name: 'yCRV',
href: 'https://ycrv.yearn.fi',
pathCheck: 'ycrv.yearn.fi',
host: 'ycrv.yearn.fi',
icon: (
<ImageWithFallback
alt={'yCRV'}
Expand All @@ -64,7 +64,7 @@ export const APPS = {
veYFI: {
name: 'veYFI',
href: 'https://veyfi.yearn.fi',
pathCheck: 'veyfi.yearn.fi',
host: 'veyfi.yearn.fi',
icon: (
<ImageWithFallback
alt={'veYFI'}
Expand All @@ -80,7 +80,7 @@ export const APPS = {
yETH: {
name: 'yETH',
href: 'https://yeth.yearn.fi',
pathCheck: 'yeth.yearn.fi',
host: 'yeth.yearn.fi',
icon: (
<ImageWithFallback
alt={'yETH'}
Expand All @@ -96,7 +96,7 @@ export const APPS = {
yPrisma: {
name: 'yPrisma',
href: 'https://yprisma.yearn.fi',
pathCheck: 'yprisma.yearn.fi',
host: 'yprisma.yearn.fi',
icon: (
<ImageWithFallback
priority
Expand All @@ -111,7 +111,7 @@ export const APPS = {
yBribe: {
name: 'yBribe',
href: 'https://ybribe.yearn.fi',
pathCheck: 'ybribe.yearn.fi',
host: 'ybribe.yearn.fi',
icon: (
<LogoYearn
className={'size-8'}
Expand All @@ -123,7 +123,7 @@ export const APPS = {
yFactory: {
name: 'yFactory',
href: 'https://factory.yearn.fi',
pathCheck: 'factory.yearn.fi',
host: 'factory.yearn.fi',
icon: (
<LogoYearn
className={'size-8'}
Expand Down

0 comments on commit 3eeeeb4

Please sign in to comment.