Skip to content

Commit

Permalink
fix: input text rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
dalechyn committed Jul 26, 2024
1 parent 5abfaa5 commit 96b4ec9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/components/TextInput.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import type { JSX } from 'hono/jsx/jsx-runtime'
import type { HtmlEscapedString } from 'hono/utils/html'

export type TextInputProps = {
placeholder?: string | undefined
}

TextInput.__type = 'text-input'
export function TextInput({ placeholder }: TextInputProps): JSX.Element {
return <meta property="fc:frame:input:text" content={placeholder} />
return [
<meta property="fc:frame:input:text" content={placeholder} />,
] as unknown as HtmlEscapedString
}
2 changes: 1 addition & 1 deletion src/utils/getButtonValues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function getButtonValues(

const buttonValues: FrameButtonValue[] = []
for (const intent of intents) {
if (!intent || !('props' in intent)) continue
if (!intent) continue
const { property } = intent.props
if (!(property as string).match(/^fc:frame:button:(1|2|3|4)$/)) continue
buttonValues.push(intent.props['data-value'])
Expand Down
3 changes: 1 addition & 2 deletions src/utils/parseIntents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ function parseIntent(

if (typeof intent?.tag === 'function' && typeof node.tag === 'function') {
if (intent.children.length > 1) throw new InvalidIntentComponentError()
if (intent.tag.name !== 'meta')
return parseIntent(node.tag(node.props), options, counter)
return parseIntent(node.tag(node.props), options, counter)
}
return intent
}
Expand Down

0 comments on commit 96b4ec9

Please sign in to comment.