From 03844bd46071427990403c7f1dc665762575ea3a Mon Sep 17 00:00:00 2001 From: FTCHD Date: Sun, 6 Oct 2024 20:45:09 +0300 Subject: [PATCH] [preview] postUrl and mockOptions in FramePreviewButton --- components/FramePreview.tsx | 1 + components/FramePreviewButton.tsx | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/components/FramePreview.tsx b/components/FramePreview.tsx index 5e982586..08cd1061 100644 --- a/components/FramePreview.tsx +++ b/components/FramePreview.tsx @@ -109,6 +109,7 @@ function ValidFrame({ metadata }: { metadata: FrameMetadataWithImageObject }) { state={metadata.state} handler={handler} params={params} + postUrl={postUrl} > {button.label} diff --git a/components/FramePreviewButton.tsx b/components/FramePreviewButton.tsx index bf3ab6e9..0a4c8a6b 100644 --- a/components/FramePreviewButton.tsx +++ b/components/FramePreviewButton.tsx @@ -1,6 +1,6 @@ 'use client' import type { FrameButtonMetadata } from '@/lib/farcaster' -import { previewLoadingAtom, previewParametersAtom } from '@/lib/store' +import { mockOptionsAtom, previewLoadingAtom, previewParametersAtom } from '@/lib/store' import { useAtom, useAtomValue } from 'jotai' import { type PropsWithChildren, useCallback } from 'react' import { @@ -18,6 +18,7 @@ export function FramePreviewButton({ state, handler, params, + postUrl, }: PropsWithChildren<{ button: FrameButtonMetadata buttonIndex: number @@ -25,9 +26,11 @@ export function FramePreviewButton({ state: any handler: string | undefined params: string | undefined + postUrl: string }>) { const [, setPreviewData] = useAtom(previewParametersAtom) const previewLoading = useAtomValue(previewLoadingAtom) + const mockOptions = useAtomValue(mockOptionsAtom) const actionCallback = useCallback(() => { const newData = { @@ -51,7 +54,7 @@ export function FramePreviewButton({ break } default: { - toast.error('Use the Warpcast Frames Validator to test transactions!') + toast.error('Use the Warpcast Frames Validator to test this feature!') break } }