This repository was archived by the owner on Aug 27, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed
Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import { FieldLabel } from "./FieldLabel"
55type InputProps < TMultiline extends boolean > = {
66 label ?: string
77 addon ?: string
8- prefix ?: JSX . Element
8+ prefixEle ?: JSX . Element
99 isBlock ?: boolean
1010 error ?: string
1111 help ?: React . ReactNode
@@ -18,7 +18,7 @@ export const Input = forwardRef(function Input<
1818 {
1919 label,
2020 addon,
21- prefix ,
21+ prefixEle ,
2222 className,
2323 isBlock,
2424 error,
@@ -31,15 +31,15 @@ export const Input = forwardRef(function Input<
3131 : React . ForwardedRef < HTMLInputElement > ,
3232) {
3333 const hasAddon = ! ! addon
34- const hasPrefix = ! ! prefix
34+ const hasPrefix = ! ! prefixEle
3535 const Component = ( multiline ? "textarea" : "input" ) as any
3636
3737 return (
3838 < div >
3939 { label && < FieldLabel label = { label } id = { inputProps . id } /> }
4040 < div className = "flex items-center relative" >
41- { prefix && (
42- < span className = "text-gray-600 absolute left-3" > { prefix } </ span >
41+ { prefixEle && (
42+ < span className = "text-gray-600 absolute left-3" > { prefixEle } </ span >
4343 ) }
4444 < Component
4545 { ...inputProps }
Original file line number Diff line number Diff line change 11import Head from "next/head"
22import { Image } from "~/components/ui/Image"
3- import { useState , useMemo } from "react"
3+ import React , { useState , useMemo } from "react"
44import { indexer } from "@crossbell/indexer"
55import { useCombobox } from "downshift"
66import { Input } from "../components/ui/Input"
@@ -80,15 +80,15 @@ export default function Home() {
8080 >
8181 < Input
8282 className = "w-full focus:border-gray-300 focus:ring-0 border-0 rounded-none"
83- prefix = {
83+ prefixEle = {
8484 < MagnifyingGlassIcon className = "w-5 h-5 text-gray-500" />
8585 }
8686 { ...getInputProps ( {
87- onKeyDown : ( event ) => {
87+ onKeyDown : ( ( event ) => {
8888 if ( event . key === "Enter" && ! items . length ) {
8989 Router . push ( `/${ inputValue } ` )
9090 }
91- } ,
91+ } ) as React . KeyboardEventHandler < HTMLInputElement > ,
9292 } ) }
9393 />
9494 < >
You can’t perform that action at this time.
0 commit comments