From 01071372710de8ecc7a033442b3cec07eeedd115 Mon Sep 17 00:00:00 2001 From: Adw8 Date: Wed, 5 Feb 2025 19:54:28 +0530 Subject: [PATCH] Remove title and description from page metadata --- src/app/api/tweet/route.ts | 8 +++++--- src/app/memes/[id]/page.tsx | 4 +--- src/components/AIServiceCard.tsx | 2 -- src/components/TweetForm.tsx | 4 ++-- src/utils/verifyTweet.ts | 10 +++++----- 5 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/app/api/tweet/route.ts b/src/app/api/tweet/route.ts index 82108cd..dcc902f 100644 --- a/src/app/api/tweet/route.ts +++ b/src/app/api/tweet/route.ts @@ -17,7 +17,7 @@ export async function POST(req: NextRequest): Promise { const { handle, txSignature } = extractData(data.html); if (!handle || !txSignature) { return NextResponse.json( - { error: 'Verification failed' }, + { error: 'Could not extract tweet data' }, { status: 500 } ) } @@ -25,13 +25,14 @@ export async function POST(req: NextRequest): Promise { const isSigVerified = await verifySignatureInTweet(txSignature); const isHandleCorrect = handle === process.env.NEXT_PUBLIC_ACCOUNT_HANDLE; + // TODO: Verify dynamic page URL in tweet const isVerified = isSigVerified && isHandleCorrect; if (!isVerified) { throw new Error('Tweet is not valid'); } - const { isFourth } = await saveTweet({ transactionSignature: txSignature }); - if (isFourth) { + const { isFourthUser } = await saveTweet({ transactionSignature: txSignature }); + if (isFourthUser) { createTokenLockForRecipient(); } @@ -61,6 +62,7 @@ const extractData = (tweet: string | object) => { }; }; +// TODO: Implement function to create lock for a recipient const createTokenLockForRecipient = () => { console.log('Lock created'); } diff --git a/src/app/memes/[id]/page.tsx b/src/app/memes/[id]/page.tsx index 6611728..2acb110 100644 --- a/src/app/memes/[id]/page.tsx +++ b/src/app/memes/[id]/page.tsx @@ -17,8 +17,6 @@ export async function generateMetadata( const meme = getMeme(params.id); return { - title: '', - description: '', metadataBase: new URL(baseUrl), openGraph: { type: 'website', @@ -42,7 +40,7 @@ export default function MemePage({ params }: Props) {
Generated image
diff --git a/src/components/AIServiceCard.tsx b/src/components/AIServiceCard.tsx index 15fe33c..c0d8d75 100644 --- a/src/components/AIServiceCard.tsx +++ b/src/components/AIServiceCard.tsx @@ -5,8 +5,6 @@ import BN from 'bn.js'; import Big from 'big.js'; import dynamic from 'next/dynamic' -import TweetUrlForm from './TweetForm'; - interface AIServiceCardProps { title: string description: string diff --git a/src/components/TweetForm.tsx b/src/components/TweetForm.tsx index ad8571b..f020319 100644 --- a/src/components/TweetForm.tsx +++ b/src/components/TweetForm.tsx @@ -5,7 +5,7 @@ import React, { useState } from 'react' const TweetUrlForm: React.FC = () => { const [inputText, setInputText] = useState('') - const handleGenerate = async (): Promise => { + const handleVerify = async (): Promise => { try { const response = await fetch('/api/tweet', { method: 'POST', @@ -43,7 +43,7 @@ const TweetUrlForm: React.FC = () => { rows={4} />