From 4b527e68feb2faa5f8d4cae03829cd9a48ce063c Mon Sep 17 00:00:00 2001 From: Yoginth Date: Fri, 13 Dec 2024 20:37:04 +0530 Subject: [PATCH] Remove Frames Completely --- apps/og/src/app/posts/[id]/page.tsx | 4 +- .../src/helpers/getCollectModuleMetadata.ts | 39 --------------- packages/helpers/getNftChainInfo.ts | 48 ------------------- 3 files changed, 1 insertion(+), 90 deletions(-) delete mode 100644 apps/og/src/helpers/getCollectModuleMetadata.ts delete mode 100644 packages/helpers/getNftChainInfo.ts diff --git a/apps/og/src/app/posts/[id]/page.tsx b/apps/og/src/app/posts/[id]/page.tsx index 2a7e062b4b88..d91036b7a673 100644 --- a/apps/og/src/app/posts/[id]/page.tsx +++ b/apps/og/src/app/posts/[id]/page.tsx @@ -1,4 +1,3 @@ -import getCollectModuleMetadata from "@helpers/getCollectModuleMetadata"; import getPostOGImages from "@helpers/getPostOGImages"; import { APP_NAME } from "@hey/data/constants"; import getAccount from "@hey/helpers/getAccount"; @@ -86,8 +85,7 @@ export const generateMetadata = async ({ "count:likes": targetPost.stats.reactions, "count:reposts": targetPost.stats.reposts, "count:quotes": targetPost.stats.quotes, - "lens:id": targetPost.id, - ...getCollectModuleMetadata(targetPost) + "lens:id": targetPost.id }, publisher: name, title: title, diff --git a/apps/og/src/helpers/getCollectModuleMetadata.ts b/apps/og/src/helpers/getCollectModuleMetadata.ts deleted file mode 100644 index e9366482dfc1..000000000000 --- a/apps/og/src/helpers/getCollectModuleMetadata.ts +++ /dev/null @@ -1,39 +0,0 @@ -import getPostOGImages from "@helpers/getPostOGImages"; -import { APP_NAME } from "@hey/data/constants"; -import allowedPostActionModules from "@hey/helpers/allowedPostActionModules"; -import getAccount from "@hey/helpers/getAccount"; -import type { Post } from "@hey/indexer"; - -const getCollectModuleMetadata = (post: Post) => { - const { actions } = post; - - if (!actions) { - return; - } - - const postAction = actions.filter((action) => - allowedPostActionModules.includes(action.__typename) - ); - - // 0 th index is the collect module - const collectModule = postAction.length ? postAction[0] : null; - - if (!collectModule) { - return; - } - - const { slugWithPrefix } = getAccount(post.author); - - return { - "eth:nft:chain": "polygon", - "eth:nft:collection": `${post.__typename} by ${slugWithPrefix} • ${APP_NAME}`, - "eth:nft:contract_address": collectModule.contract.address, - "eth:nft:creator_address": post.author.owner, - "eth:nft:media_url": getPostOGImages(post.metadata)[0], - "eth:nft:mint_count": post.stats.countOpenActions, - "eth:nft:mint_url": `https://hey.xyz/posts/${post.id}`, - "eth:nft:schema": "ERC721" - }; -}; - -export default getCollectModuleMetadata; diff --git a/packages/helpers/getNftChainInfo.ts b/packages/helpers/getNftChainInfo.ts deleted file mode 100644 index 7c9872d9b72f..000000000000 --- a/packages/helpers/getNftChainInfo.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { STATIC_IMAGES_URL } from "@hey/data/constants"; - -const getNftChainInfo = ( - chain: string -): { - logo: string; - name: string; -} => { - switch (chain) { - case "ethereum": - case "goerli": - return { - logo: `${STATIC_IMAGES_URL}/chains/ethereum.svg`, - name: chain === "ethereum" ? "Ethereum" : "Goerli" - }; - case "optimism": - case "optimism-testnet": - return { - logo: `${STATIC_IMAGES_URL}/chains/optimism.svg`, - name: chain === "optimism" ? "Optimism" : "Optimism Testnet" - }; - case "zora": - case "zora-testnet": - return { - logo: `${STATIC_IMAGES_URL}/chains/zora.svg`, - name: chain === "zora" ? "Zora" : "Zora Testnet" - }; - case "base": - case "base-testnet": - return { - logo: `${STATIC_IMAGES_URL}/chains/base.svg`, - name: chain === "base" ? "Base" : "Base Testnet" - }; - case "polygon": - case "amoy": - return { - logo: `${STATIC_IMAGES_URL}/chains/polygon.svg`, - name: chain === "polygon" ? "Polygon" : "Polygon Amoy" - }; - default: - return { - logo: `${STATIC_IMAGES_URL}/chains/ethereum.svg`, - name: "Ethereum" - }; - } -}; - -export default getNftChainInfo;