Skip to content

Commit 2f6cc74

Browse files
committed
[MNY-203] Dashboard: ERC20 token page title, metadata and OG updates
1 parent 777aed1 commit 2f6cc74

File tree

1 file changed

+17
-5
lines changed
  • apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]

1 file changed

+17
-5
lines changed

apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/shared-layout.tsx

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -190,25 +190,37 @@ export async function generateContractLayoutMetadata(params: {
190190
.replace("Testnet", "")
191191
.trim();
192192

193-
const title = `${contractDisplayName} | ${cleanedChainName} Smart Contract`;
193+
let title = `${contractDisplayName} | ${cleanedChainName} Smart Contract`;
194194
let description = "";
195195

196196
if (isERC721 || isERC1155) {
197197
description = `View tokens, source code, transactions, balances, and analytics for the ${contractDisplayName} smart contract on ${cleanedChainName}.`;
198198
} else if (isERC20) {
199-
description = `View ERC20 tokens, transactions, balances, source code, and analytics for the ${contractDisplayName} smart contract on ${cleanedChainName}`;
199+
title = `${contractMetadata.name} (${contractMetadata.symbol}) on ${cleanedChainName} | Buy, Swap, Bridge & Price`;
200+
description = `Buy, swap & bridge ${contractMetadata.name} (${contractMetadata.symbol}) on ${cleanedChainName} with thirdweb Bridge. View contract address, holders, analytics, transactions and live price.`;
200201
} else {
201-
description = `View tokens, transactions, balances, source code, and analytics for the ${contractDisplayName} smart contract on ${cleanedChainName}`;
202+
description = `View tokens, transactions, balances, source code, and analytics for the ${contractMetadata.name} smart contract on ${cleanedChainName}`;
202203
}
203204

204205
return {
205206
description: description,
206207
title: title,
208+
openGraph: {
209+
description: description,
210+
title: title,
211+
},
207212
};
208213
} catch {
214+
const fallbackTitle = `${shortenIfAddress(params.contractAddress)} | ${params.chainIdOrSlug}`;
215+
const fallbackDescription = `View tokens, transactions, balances, source code, and analytics for the smart contract on Chain ID ${params.chainIdOrSlug}`;
216+
209217
return {
210-
description: `View tokens, transactions, balances, source code, and analytics for the smart contract on Chain ID ${params.chainIdOrSlug}`,
211-
title: `${shortenIfAddress(params.contractAddress)} | ${params.chainIdOrSlug}`,
218+
description: fallbackDescription,
219+
title: fallbackTitle,
220+
openGraph: {
221+
description: fallbackDescription,
222+
title: fallbackTitle,
223+
},
212224
};
213225
}
214226
}

0 commit comments

Comments
 (0)