Skip to content

Commit

Permalink
feat: bump
Browse files Browse the repository at this point in the history
  • Loading branch information
Majorfi committed Jun 20, 2024
1 parent 6b51409 commit da330ab
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 15 deletions.
Binary file modified bun.lockb
Binary file not shown.
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@yearn-finance/web-lib",
"version": "3.0.86",
"version": "3.0.88",
"main": "./dist/index.js",
"types": "./dist/index.d.js",
"files": [
Expand All @@ -26,6 +26,7 @@
},
"dependencies": {
"@babel/core": "^7.24.7",
"@builtbymom/web3": "^0.0.122",
"@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "^19.2.2",
"@headlessui/react": "^2.0.4",
Expand All @@ -45,11 +46,13 @@
"eslint-plugin-react-hooks": "^4.6.2",
"ethers": "5.7.2",
"eventemitter3": "^5.0.1",
"framer-motion": "^11.2.11",
"graphql": "^16.8.2",
"graphql-request": "^7.0.1",
"husky": "^9.0.11",
"lint-staged": "^15.2.7",
"next": "^14.2.4",
"next-seo": "^6.5.0",
"nprogress": "^0.2.0",
"prettier": "^3.3.2",
"react-hot-toast": "2.4.1",
Expand Down Expand Up @@ -96,4 +99,4 @@
"viem": "1.19.9",
"wagmi": "1.4.7"
}
}
}
3 changes: 1 addition & 2 deletions src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {IconWallet} from '../icons/IconWallet';
import {Button} from './Button';

import type {AnchorHTMLAttributes, DetailedHTMLProps, ReactElement} from 'react';
import type {Chain} from 'viem';

const Link = (
props: DetailedHTMLProps<AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement> & {tag: ReactElement}
Expand Down Expand Up @@ -90,7 +89,7 @@ function NetworkSelector({networks}: {networks: number[]}): ReactElement {
const noFork = config.chains.filter(({id}): boolean => id !== 1337);
return noFork
.filter(({id}): boolean => id !== 1337 && ((networks.length > 0 && networks.includes(id)) || true))
.map((network: Chain): TNetwork => ({value: network.id, label: network.name}));
.map((network): TNetwork => ({value: network.id, label: network.name}));
}, [connectors, networks]);

const currentNetwork = useMemo((): TNetwork | undefined => {
Expand Down
11 changes: 5 additions & 6 deletions src/components/ModalMobileMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, {cloneElement, Fragment, useEffect, useMemo, useRef, useState} from 'react';
import {useAccount, useConnect} from 'wagmi';
import {useConnect} from 'wagmi';
import {useWeb3} from '@builtbymom/web3/contexts/useWeb3';
import {truncateHex} from '@builtbymom/web3/utils/tools.address';
import {getConfig, retrieveConfig} from '@builtbymom/web3/utils/wagmi';
Expand Down Expand Up @@ -75,8 +75,7 @@ function Modal(props: TModal): ReactElement {

export function ModalMobileMenu(props: TModalMobileMenu): ReactElement {
const {isOpen, onClose, shouldUseWallets = true, shouldUseNetworks = true, children} = props;
const {onSwitchChain, isActive, address, ens, lensProtocolHandle, onDesactivate, onConnect} = useWeb3();
const {chain} = useAccount();
const {onSwitchChain, isActive, address, ens, lensProtocolHandle, onDesactivate, onConnect, chainID} = useWeb3();
const [walletIdentity, set_walletIdentity] = useState('Connect a wallet');
const detectedWalletProvider = useInjectedWallet();
const {connectors} = useConnect();
Expand All @@ -86,11 +85,11 @@ export function ModalMobileMenu(props: TModalMobileMenu): ReactElement {
try {
const config = retrieveConfig();
const noFork = config.chains.filter(({id}): boolean => id !== 1337);
return noFork.map((network: Chain): TNetwork => ({value: network.id, label: network.name}));
return noFork.map((network): TNetwork => ({value: network.id, label: network.name}));
} catch (error) {
const config = getConfig({chains: props.supportedNetworks as any[]});
const noFork = config.chains.filter(({id}): boolean => id !== 1337);
return noFork.map((network: Chain): TNetwork => ({value: network.id, label: network.name}));
return noFork.map((network): TNetwork => ({value: network.id, label: network.name}));
}
}, [connectors, props.supportedNetworks]);

Expand Down Expand Up @@ -154,7 +153,7 @@ export function ModalMobileMenu(props: TModalMobileMenu): ReactElement {
className={'yearn--select-no-arrow yearn--select-reset !pr-6 text-sm'}>
{supportedNetworks.map((network): ReactElement => {
const label = network.label || `Unknown chain (${network.value})`;
const selectedID = chain?.id || 1;
const selectedID = chainID || 1;
const isSelected = selectedID === network.value;
return (
<option
Expand Down
10 changes: 5 additions & 5 deletions src/contexts/useYearn.helper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ export function useYearnTokens({
});
});

const {wrappedToken} = getNetwork(safeChainID).contracts;
if (wrappedToken) {
const {nativeCurrency} = getNetwork(safeChainID);
if (nativeCurrency) {
tokens.push({
address: toAddress(ETH_TOKEN_ADDRESS),
chainID: safeChainID,
decimals: wrappedToken.decimals,
name: wrappedToken.coinName,
symbol: wrappedToken.coinSymbol
decimals: nativeCurrency.decimals,
name: nativeCurrency.name,
symbol: nativeCurrency.symbol
});
}
return tokens;
Expand Down

0 comments on commit da330ab

Please sign in to comment.