diff --git a/apps/u3/src/components/social/Embed.tsx b/apps/u3/src/components/social/Embed.tsx index d5560ffa..12a30e87 100644 --- a/apps/u3/src/components/social/Embed.tsx +++ b/apps/u3/src/components/social/Embed.tsx @@ -176,6 +176,7 @@ function EmbedCastFrame({ const castId: CastId = useFarcasterCastId({ cast }); const { encryptedSigner, isConnected, currFid } = useFarcasterCtx(); + const [frameText, setFrameText] = useState(''); const [frameRedirect, setFrameRedirect] = useState(''); const [frameData, setFrameData] = useState(data); @@ -196,7 +197,7 @@ function EmbedCastFrame({ url: Buffer.from(data.url), buttonIndex: index, castId, - inputText: Buffer.from(''), + inputText: Buffer.from(frameText), }, { fid: currFid, @@ -215,6 +216,7 @@ function EmbedCastFrame({ messageHash: toHex(trustedDataValue.hash), network: FARCASTER_NETWORK, buttonIndex: index, + inputText: frameText, castId: { fid: castId.fid, hash: toHex(castId.hash), @@ -248,7 +250,7 @@ function EmbedCastFrame({ setFrameRedirect(resp.data.data?.redirectUrl || ''); } }, - [frameData, currFid, encryptedSigner, castId] + [frameData, currFid, encryptedSigner, castId, frameText] ); return ( <> @@ -256,8 +258,21 @@ function EmbedCastFrame({
+ {frameData.fcFrameInputText && ( +
+ { + setFrameText(e.target.value); + }} + /> +
+ )} {isConnected && ( -
+
{[ frameData.fcFrameButton1, frameData.fcFrameButton2, diff --git a/apps/u3/src/services/social/types/index.ts b/apps/u3/src/services/social/types/index.ts index 0c1fd9d1..b79c2dba 100644 --- a/apps/u3/src/services/social/types/index.ts +++ b/apps/u3/src/services/social/types/index.ts @@ -35,6 +35,7 @@ export type FarCastEmbedMeta = { fcFrameButton4?: string; fcFrameImage?: string; fcFramePostUrl?: string; + fcFrameInputText?: string; }; export type FarCast = {