Skip to content

Commit

Permalink
feat: preview links
Browse files Browse the repository at this point in the history
tmm committed Feb 8, 2024

Verified

This commit was signed with the committer’s verified signature.
tmm awkweb
1 parent 5a05a0b commit ef29fb0
Showing 4 changed files with 25 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/actions/install-dependencies/action.yml
Original file line number Diff line number Diff line change
@@ -9,4 +9,4 @@ runs:

- name: Install dependencies
shell: bash
run: bun install
run: bun install
4 changes: 2 additions & 2 deletions example/src/index.tsx
Original file line number Diff line number Diff line change
@@ -2,9 +2,9 @@
/** @jsxImportSource hono/jsx */
/** @jsxFrag */

import { Button, Framework, TextInput } from 'farc'
import { Button, Farc, TextInput } from 'farc'

const app = new Framework()
const app = new Farc()

app.frame('/', (context, previousContext) => {
console.log(context, previousContext)
2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@ type FrameHandlerReturnType = {
intents?: Intents | undefined
}

export class Framework extends Hono {
export class Farc extends Hono {
frame(
path: string,
handler: (
21 changes: 21 additions & 0 deletions src/preview.tsx
Original file line number Diff line number Diff line change
@@ -13,6 +13,27 @@ export function Preview(props: PreviewProps) {
const { baseUrl, frame } = props
return (
<div style={{ display: 'flex', flexDirection: 'column', gap: '1rem' }}>
<div style={{ display: 'flex', fontSize: '0.75rem', gap: '0.5rem' }}>
<span>𝑭𝒂𝒓𝒄</span>
<a
href="https://docs.farcaster.xyz/reference/frames/spec"
target="_blank"
rel="noreferrer"
>
Frames Spec
</a>
<a
href="https://warpcast.com/~/developers/frames"
target="_blank"
rel="noreferrer"
>
Warpcast Frame Validator
</a>
<a href="https://github.com/wevm/farc" target="_blank" rel="noreferrer">
GitHub
</a>
</div>

<Frame {...{ ...frame, baseUrl }} />
<Devtools {...{ frame }} />
</div>

0 comments on commit ef29fb0

Please sign in to comment.