From 70c3adbd09fc0abd2cf72093165805f4309cebb1 Mon Sep 17 00:00:00 2001 From: Siddesh Date: Fri, 5 Apr 2024 17:11:13 +0530 Subject: [PATCH] feat(uiweb): handle different frame spec --- .../chat/ChatViewBubble/ChatViewBubble.tsx | 185 ++++++++----- .../lib/components/chat/reusables/Button.tsx | 3 + packages/uiweb/src/lib/helpers/chat/pgp.ts | 6 +- packages/uiweb/src/lib/types/index.ts | 27 +- .../src/lib/utilities/getFormattedMetadata.ts | 242 ++++++++++++------ 5 files changed, 307 insertions(+), 156 deletions(-) diff --git a/packages/uiweb/src/lib/components/chat/ChatViewBubble/ChatViewBubble.tsx b/packages/uiweb/src/lib/components/chat/ChatViewBubble/ChatViewBubble.tsx index 7f25a877b..6b2fa5d0c 100644 --- a/packages/uiweb/src/lib/components/chat/ChatViewBubble/ChatViewBubble.tsx +++ b/packages/uiweb/src/lib/components/chat/ChatViewBubble/ChatViewBubble.tsx @@ -17,7 +17,12 @@ import { ChatDataContext } from '../../../context'; import { useAccount, useChatData } from '../../../hooks'; import { ThemeContext } from '../theme/ThemeProvider'; -import { FileMessageContent, FrameDetails } from '../../../types'; +import { + FileMessageContent, + FrameButton, + FrameDetails, + IFrame, +} from '../../../types'; import { IMessagePayload, TwitterFeedReturnType } from '../exportedTypes'; import { allowedNetworks, ENV, FILE_ICON } from '../../../config'; import { @@ -142,14 +147,9 @@ const FrameRenderer = ({ useContext(ChatMainStateContext); const frameRenderer = useToast(); const proxyServer = 'https://cors-m0l8.onrender.com'; - const [metaTags, setMetaTags] = useState({ - image: '', - siteURL: '', - postURL: '', - buttons: [], - input: { name: '', content: '' }, - }); + const [FrameData, setFrameData] = useState