Skip to content

Commit

Permalink
refactor: Use yeth directly in the popover
Browse files Browse the repository at this point in the history
  • Loading branch information
karelianpie authored and Majorfi committed Aug 5, 2023
1 parent 00c50e8 commit 2a789bc
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 18 deletions.
17 changes: 16 additions & 1 deletion apps/common/components/AppHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {VeYfiHeader} from '@veYFI/components/header/VeYfiHeader';
import Renderable from '@yearn-finance/web-lib/components/Renderable';
import {useWeb3} from '@yearn-finance/web-lib/contexts/useWeb3';
import BalanceReminderPopover from '@common/components/BalanceReminderPopover';
import {ImageWithFallback} from '@common/components/ImageWithFallback';
import {useMenu} from '@common/contexts/useMenu';
import LogoYearn from '@common/icons/LogoYearn';
import {YBalHeader} from '@yBal/components/header/YBalHeader';
Expand Down Expand Up @@ -46,6 +47,20 @@ function Logo(): ReactElement {
function LogoPopover(): ReactElement {
const [isShowing, set_isShowing] = useState(false);

const YETH = {
name: 'yETH',
href: 'https://yeth.yearn.finance',
isDisabled: false,
icon: <ImageWithFallback
alt={'yETH'}
className={'h-8 w-8'}
width={100}
height={100}
src={`${process.env.BASE_YEARN_ASSETS_URI}/1/0x1BED97CBC3c24A4fb5C069C6E311a967386131f7/logo-128.png`}
loading={'eager'}
priority />
};

return (
<Popover
onMouseEnter={(): void => set_isShowing(true)}
Expand All @@ -70,7 +85,7 @@ function LogoPopover(): ReactElement {
<div className={'overflow-hidden border border-neutral-200 shadow-lg'}>
<div className={'relative grid grid-cols-2 bg-neutral-0 md:grid-cols-3'}>
{
Object.values(APPS)
[...Object.values(APPS), YETH]
.filter(({isDisabled}): boolean => !isDisabled)
.map(({name, href, icon}): ReactElement => {
return (
Expand Down
18 changes: 2 additions & 16 deletions apps/common/components/Apps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,14 @@ export enum AppName {
YCRV = 'yCRV',
YBAL = 'yBal',
VEYFI = 'veYFI',
YBRIBE = 'yBribe',
YETH = 'yETH'
YBRIBE = 'yBribe'
}

type TApp = {
name: AppName;
href: string;
menu: TMenu[];
manifest?: TMetaFile;
manifest: TMetaFile;
icon: ReactElement;
isDisabled?: boolean;
}
Expand Down Expand Up @@ -96,18 +95,5 @@ export const APPS: { [key in AppName]: TApp } = {
className={'h-8 w-8'}
back={'text-neutral-900'}
front={'text-neutral-0'} />
},
yETH: {
name: AppName.YETH,
href: 'https://yeth.yearn.finance',
menu: [],
icon: <ImageWithFallback
alt={'yETH'}
className={'h-8 w-8'}
width={100}
height={100}
src={`${process.env.BASE_YEARN_ASSETS_URI}/1/0x1BED97CBC3c24A4fb5C069C6E311a967386131f7/logo-128.png`}
loading={'eager'}
priority />
}
};
1 change: 1 addition & 0 deletions apps/common/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ function NetworkSelector({networks}: {networks: number[]}): ReactElement {
<div key={safeChainID} className={'relative z-50 mr-4'}>
<Listbox
value={safeChainID}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
onChange={async (value: any): Promise<void> => onSwitchChain(value.value)}>
{({open}): ReactElement => (
<>
Expand Down
2 changes: 1 addition & 1 deletion apps/common/contexts/useWallet.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {createContext, memo, useCallback, useContext, useMemo} from 'react';
import {useChainId} from 'wagmi';
import {OPT_REWARDS_TOKENS, OPT_YVAGEUR_USDC_STAKING_CONTRACT, OPT_YVALETH_FRXETH_STAKING_CONTRACT, OPT_YVALETH_WETH_STAKING_CONTRACT, OPT_YVALUSD_FRAX_STAKING_CONTRACT, OPT_YVALUSD_USDC_STAKING_CONTRACT, OPT_YVDAI_STAKING_CONTRACT, OPT_YVDOLA_USDC_STAKING_CONTRACT, OPT_YVDOLAUSDC_STAKING_CONTRACT, OPT_YVERN_DOLA_STAKING_CONTRACT, OPT_YVERN_LUSD_STAKING_CONTRACT, OPT_YVETH_STAKING_CONTRACT, OPT_YVEXA_WETH_STAKING_CONTRACT, OPT_YVFRAX_DOLA_STAKING_CONTRACT, OPT_YVIB_WETH_STAKING_CONTRACT, OPT_YVLDO_WSTETH_STAKING_CONTRACT, OPT_YVLUSD_WETH_STAKING_CONTRACT, OPT_YVMAI_ALUSD_STAKING_CONTRACT, OPT_YVMAI_DOLA_STAKING_CONTRACT, OPT_YVMAI_STAKING_CONTRACT, OPT_YVMAI_USDC_STAKING_CONTRACT, OPT_YVMAIUSDC_STAKING_CONTRACT, OPT_YVMIM_USDC_STAKING_CONTRACT, OPT_YVMTA_USDC_STAKING_CONTRACT, OPT_YVOP_USDC_STAKING_CONTRACT, OPT_YVOP_VELO_STAKING_CONTRACT, OPT_YVSNX_USDC_STAKING_CONTRACT, OPT_YVSUSCUSDC_STAKING_CONTRACT, OPT_YVTBTC_WBTC_STAKING_CONTRACT,OPT_YVTBTC_WETH_STAKING_CONTRACT, OPT_YVUSDC_STAKING_CONTRACT, OPT_YVUSDT_STAKING_CONTRACT, OPT_YVVELO_USDC_STAKING_CONTRACT, OPT_YVWUSDR_USDC_STAKING_CONTRACT} from '@vaults/constants/optRewards';
import {OPT_REWARDS_TOKENS, OPT_YVAGEUR_USDC_STAKING_CONTRACT, OPT_YVALETH_FRXETH_STAKING_CONTRACT, OPT_YVALETH_WETH_STAKING_CONTRACT, OPT_YVALUSD_FRAX_STAKING_CONTRACT, OPT_YVALUSD_USDC_STAKING_CONTRACT, OPT_YVDAI_STAKING_CONTRACT, OPT_YVDOLA_USDC_STAKING_CONTRACT, OPT_YVDOLAUSDC_STAKING_CONTRACT, OPT_YVERN_DOLA_STAKING_CONTRACT, OPT_YVERN_LUSD_STAKING_CONTRACT, OPT_YVETH_STAKING_CONTRACT, OPT_YVEXA_WETH_STAKING_CONTRACT, OPT_YVFRAX_DOLA_STAKING_CONTRACT, OPT_YVIB_WETH_STAKING_CONTRACT, OPT_YVLDO_WSTETH_STAKING_CONTRACT, OPT_YVLUSD_WETH_STAKING_CONTRACT, OPT_YVMAI_ALUSD_STAKING_CONTRACT, OPT_YVMAI_DOLA_STAKING_CONTRACT, OPT_YVMAI_STAKING_CONTRACT, OPT_YVMAI_USDC_STAKING_CONTRACT, OPT_YVMAIUSDC_STAKING_CONTRACT, OPT_YVMIM_USDC_STAKING_CONTRACT, OPT_YVMTA_USDC_STAKING_CONTRACT, OPT_YVOP_USDC_STAKING_CONTRACT, OPT_YVOP_VELO_STAKING_CONTRACT, OPT_YVSNX_USDC_STAKING_CONTRACT, OPT_YVSUSCUSDC_STAKING_CONTRACT, OPT_YVTBTC_WBTC_STAKING_CONTRACT, OPT_YVTBTC_WETH_STAKING_CONTRACT, OPT_YVUSDC_STAKING_CONTRACT, OPT_YVUSDT_STAKING_CONTRACT, OPT_YVVELO_USDC_STAKING_CONTRACT, OPT_YVWUSDR_USDC_STAKING_CONTRACT} from '@vaults/constants/optRewards';
import {useUI} from '@yearn-finance/web-lib/contexts/useUI';
import {useClientEffect} from '@yearn-finance/web-lib/hooks/useClientEffect';
import {toAddress} from '@yearn-finance/web-lib/utils/address';
Expand Down
1 change: 1 addition & 0 deletions apps/vaults/hooks/useSolverPortals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ export function useSolverPortals(): TSolverContext {
to: toAddress(to),
...rest
});
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const hash = await wagmiProvider.walletClient.sendTransaction({...tx as any, chain});
const receipt = await waitForTransaction({chainId: wagmiProvider.chainId, hash});
if (receipt.status === 'success') {
Expand Down

1 comment on commit 2a789bc

@vercel
Copy link

@vercel vercel bot commented on 2a789bc Aug 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.