diff --git a/apps/common/schemas/yDaemonVaultsSchemas.ts b/apps/common/schemas/yDaemonVaultsSchemas.ts index 770f35997..a3580f638 100644 --- a/apps/common/schemas/yDaemonVaultsSchemas.ts +++ b/apps/common/schemas/yDaemonVaultsSchemas.ts @@ -70,6 +70,14 @@ export const yDaemonVaultSchema = z.object({ .catch('Legacy'), symbol: z.string(), name: z.string(), + description: z + .string() + .default( + 'Sorry, we don\'t have a description for this asset right now. But did you know the correct word for a blob of toothpaste is a "nurdle". Fascinating! We\'ll work on updating the asset description, but at least you learnt something interesting. Catch ya later nurdles.' + ) + .catch( + 'Sorry, we don\'t have a description for this asset right now. But did you know the correct word for a blob of toothpaste is a "nurdle". Fascinating! We\'ll work on updating the asset description, but at least you learnt something interesting. Catch ya later nurdles.' + ), category: z .literal('Curve') .or(z.literal('Volatile')) diff --git a/apps/vaults-v3/components/details/tabs/VaultDetailsAbout.tsx b/apps/vaults-v3/components/details/tabs/VaultDetailsAbout.tsx index 8f95dc3d0..6deee4403 100755 --- a/apps/vaults-v3/components/details/tabs/VaultDetailsAbout.tsx +++ b/apps/vaults-v3/components/details/tabs/VaultDetailsAbout.tsx @@ -37,14 +37,15 @@ export function VaultDetailsAbout({currentVault}: {currentVault: TYDaemonVault}) const {token, apr} = currentVault; function getVaultDescription(): string { + if (currentVault.description) { + return parseMarkdown(currentVault.description.replaceAll('{{token}}', currentVault.token.symbol)); + } if (token.description) { - return parseMarkdown(token.description); + return parseMarkdown(token.description.replaceAll('{{token}}', currentVault.token.symbol)); } - return 'Sorry, we don\'t have a description for this asset right now. But did you know the correct word for a blob of toothpaste is a "nurdle". Fascinating! We\'ll work on updating the asset description, but at least you learnt something interesting. Catch ya later nurdles.'; + return currentVault.description; } - console.log(apr); - return (
@@ -111,75 +112,3 @@ export function VaultDetailsAbout({currentVault}: {currentVault: TYDaemonVault})
); } - -export function VaultDetailsAboutCard({currentVault}: {currentVault: TYDaemonVault}): ReactElement { - const {token, apr} = currentVault; - - function getVaultDescription(): string { - if (token.description) { - return parseMarkdown(token.description); - } - return 'Sorry, we don\'t have a description for this asset right now. But did you know the correct word for a blob of toothpaste is a "nurdle". Fascinating! We\'ll work on updating the asset description, but at least you learnt something interesting. Catch ya later nurdles.'; - } - return ( -
- - {'About'} - -
-
-

-

-
-
- {'APR'} - {'Fees'} -
-
- - - {formatPercent(apr.points.weekAgo * 100, 0)} - - - - - {formatPercent(apr.points.monthAgo * 100, 0)} - - - - - - {formatPercent(apr.points.inception * 100, 0)} - - - - - - {formatPercent((apr.fees.management || 0) * 100, 0)} - - - - - {formatPercent((apr.fees.performance || 0) * 100, 0)} - - - {currentVault.category === 'Velodrome' || currentVault.category === 'Aerodrome' ? ( - - - {formatPercent(currentVault.apr.fees.keepVelo * 100, 0)} - - - ) : null} -
-
-
-
- ); -} diff --git a/apps/vaults/components/details/tabs/VaultDetailsAbout.tsx b/apps/vaults/components/details/tabs/VaultDetailsAbout.tsx index 46adcc824..0e91cf946 100755 --- a/apps/vaults/components/details/tabs/VaultDetailsAbout.tsx +++ b/apps/vaults/components/details/tabs/VaultDetailsAbout.tsx @@ -82,10 +82,13 @@ export function VaultDetailsAbout({ const {token, apr} = currentVault; function getVaultDescription(): string { + if (currentVault.description) { + return parseMarkdown(currentVault.description.replaceAll('{{token}}', currentVault.token.symbol)); + } if (token.description) { - return parseMarkdown(token.description); + return parseMarkdown(token.description.replaceAll('{{token}}', currentVault.token.symbol)); } - return 'Sorry, we don\'t have a description for this asset right now. But did you know the correct word for a blob of toothpaste is a "nurdle". Fascinating! We\'ll work on updating the asset description, but at least you learnt something interesting. Catch ya later nurdles.'; + return currentVault.description; } return ( diff --git a/pages/vaults-v3/[chainID]/[address].tsx b/pages/vaults-v3/[chainID]/[address].tsx index 9d1ff3de2..74c325c8f 100755 --- a/pages/vaults-v3/[chainID]/[address].tsx +++ b/pages/vaults-v3/[chainID]/[address].tsx @@ -55,7 +55,7 @@ function Index(): ReactElement | null { } refresh(tokensToRefresh); } - }, [currentVault?.address, currentVault?.token.address, address, isActive, refresh, currentVault?.chainID]); + }, [currentVault?.address, currentVault?.token?.address, address, isActive, refresh, currentVault?.chainID]); if (isLoadingVault || !router.query.address) { return ( @@ -122,7 +122,7 @@ function Index(): ReactElement | null { )}>