Skip to content

Commit

Permalink
[preview] postUrl and mockOptions in FramePreviewButton
Browse files Browse the repository at this point in the history
  • Loading branch information
FTCHD committed Oct 6, 2024
1 parent 2da2bfb commit 03844bd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions components/FramePreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ function ValidFrame({ metadata }: { metadata: FrameMetadataWithImageObject }) {
state={metadata.state}
handler={handler}
params={params}
postUrl={postUrl}
>
{button.label}
</FramePreviewButton>
Expand Down
7 changes: 5 additions & 2 deletions components/FramePreviewButton.tsx
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -18,16 +18,19 @@ export function FramePreviewButton({
state,
handler,
params,
postUrl,
}: PropsWithChildren<{
button: FrameButtonMetadata
buttonIndex: number
inputText: string
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 = {
Expand All @@ -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
}
}
Expand Down

0 comments on commit 03844bd

Please sign in to comment.