From 5de9d5f560fa907f5d06b74ff891db63ef8c1911 Mon Sep 17 00:00:00 2001
From: Karelian Pie
{prefix}
{' OK '}
@@ -50,7 +50,7 @@ function StatusLine({
{suffix}
{onClick ?
{content}
diff --git a/components/VaultEntity.AnomaliesSection.tsx b/components/VaultEntity.AnomaliesSection.tsx index 0d24d80..29c9f73 100755 --- a/components/VaultEntity.AnomaliesSection.tsx +++ b/components/VaultEntity.AnomaliesSection.tsx @@ -1,5 +1,5 @@ import React, {ReactElement, ReactNode, useEffect, useState} from 'react'; -import {performBatchedUpdates} from '@yearn-finance/web-lib/utils'; +import {performBatchedUpdates} from '@yearn-finance/web-lib'; import StatusLine from 'components/StatusLine'; import type {TAnomalies, TAnomaliesSection} from 'types/types'; diff --git a/components/VaultEntity.tsx b/components/VaultEntity.tsx index 091f915..78e3a5d 100755 --- a/components/VaultEntity.tsx +++ b/components/VaultEntity.tsx @@ -1,15 +1,13 @@ import React, {ReactElement, ReactNode, useState} from 'react'; import Image from 'next/image'; -import {useSettings, useWeb3} from '@yearn-finance/web-lib/contexts'; -import {copyToClipboard, format, toAddress} from '@yearn-finance/web-lib/utils'; -import {AddressWithActions} from '@yearn-finance/web-lib/components'; +import {IconCopy, IconLinkOut, TAddress, copyToClipboard, formatAmount, getNetwork, toAddress, useWeb3} from '@yearn-finance/web-lib'; import {useYearn} from 'contexts/useYearn'; import AnomaliesSection from 'components/VaultEntity.AnomaliesSection'; import StatusLine from 'components/StatusLine'; import ModalFix from 'components/modals/ModalFix'; import Code from 'components/Code'; import type {TFixModalData, TSettings} from 'types/types'; -import {Copy, LinkOut} from '@yearn-finance/web-lib/icons'; +import {AddressWithActions} from 'components/common/AddressWithActions'; const defaultFixModalData: TFixModalData = { isOpen: false, @@ -28,7 +26,6 @@ function VaultEntity({ }: { vault: any, settings: TSettings, noStrategies?: boolean }): ReactElement | null { const {aggregatedData} = useYearn(); const {chainID} = useWeb3(); - const {networks} = useSettings(); const [fixModalData, set_fixModalData] = useState copyToClipboard('contracts')}
- className={'cursor-copy rounded-md bg-neutral-200 py-1 px-2 text-sm'}>
+ className={'cursor-copy rounded-md bg-neutral-200 px-2 py-1 text-sm'}>
{'contracts'}
{' object in the '}
copyToClipboard('b2c.json')}
- className={'cursor-copy rounded-md bg-neutral-200 py-1 px-2 text-sm'}>
+ className={'cursor-copy rounded-md bg-neutral-200 px-2 py-1 text-sm'}>
{'b2c.json'}
{'file.'}
,
copyToClipboard('_vault_v0.4.3.json')}
- className={'cursor-copy rounded-md bg-neutral-200 py-1 px-2 text-sm'}>
+ className={'cursor-copy rounded-md bg-neutral-200 px-2 py-1 text-sm'}>
{'_vault_v0.4.3.json'}
{' to '}
copyToClipboard(`${vault.address}.json`)}
- className={'cursor-copy rounded-md bg-neutral-200 py-1 px-2 text-sm'}>
+ className={'cursor-copy rounded-md bg-neutral-200 px-2 py-1 text-sm'}>
{`${vault.address}.json`}
,
@@ -126,8 +123,8 @@ function VaultEntity({
,
copyToClipboard(currentStrategy.name)}
- className={'cursor-copy rounded-md bg-neutral-200 py-1 px-2 text-sm'}>
+ className={'cursor-copy rounded-md bg-neutral-200 px-2 py-1 text-sm'}>
{currentStrategy.name}
{' should belong to.'}
@@ -165,7 +162,7 @@ function VaultEntity({
{'3a. If the file exists, append the address of the strategy to the file, under "addresses": '}
copyToClipboard(currentStrategy.address)}
- className={'cursor-copy rounded-md bg-neutral-200 py-1 px-2 text-sm'}>
+ className={'cursor-copy rounded-md bg-neutral-200 px-2 py-1 text-sm'}>
{currentStrategy.address}
,
@@ -173,7 +170,7 @@ function VaultEntity({
{'3b. If the file does not exists, create a new one and append the address of the strategy to the file, under "addresses": '}
copyToClipboard(currentStrategy.address)}
- className={'cursor-copy rounded-md bg-neutral-200 py-1 px-2 text-sm'}>
+ className={'cursor-copy rounded-md bg-neutral-200 px-2 py-1 text-sm'}>
{currentStrategy.address}
@@ -200,7 +197,7 @@ function VaultEntity({
{'2. Add missing vault file with the filename '}
copyToClipboard(`${vault.address}.json`)}
- className={'cursor-copy rounded-md bg-neutral-200 py-1 px-2 text-sm'}>
+ className={'cursor-copy rounded-md bg-neutral-200 px-2 py-1 text-sm'}>
{`${vault.address}.json`}
@@ -217,7 +214,7 @@ function VaultEntity({
const hasStrategiesAnomaly = noStrategies;
const hasRiskAnomaly = vaultData?.strategies.some((strategy): boolean => (strategy?.risk?.riskGroup || 'Others') === 'Others');
- const riskScores = (vaultData?.strategies ?? []).map((strategy): { strategy: { address: string; name: string; }; sum: number; isValid: boolean } => {
+ const riskScores = (vaultData?.strategies ?? []).map((strategy): { strategy: { address: TAddress; name: string; }; sum: number; isValid: boolean } => {
const sum = (
(strategy?.risk?.riskDetails?.TVLImpact || 0)
+ (strategy?.risk?.riskDetails?.auditScore || 0)
@@ -367,14 +364,14 @@ function VaultEntity({
suffix: (
{'for vault '}
-
+
{vault.symbol || 'not_set'}
- {toENS(address, truncate > 0, truncate)}
+{option.label}
+