mirror of
https://github.com/koreanbots/core.git
synced 2025-12-15 14:10:22 +00:00
feat: added length limit for search
close: https://github.com/koreanbots/v2-testing/issues/45
This commit is contained in:
parent
fcc409d2a5
commit
ab31eb9c49
@ -27,7 +27,7 @@ const Search = (): JSX.Element => {
|
||||
}
|
||||
return <>
|
||||
<div className='relative w-full mt-5 text-black bg-white dark:text-gray-100 dark:bg-very-black flex rounded-lg'>
|
||||
<input onFocus={() => setHidden(false)} onBlur={() => setHidden(true)} className='bg-transparent flex-grow outline-none border-none shadow border-0 py-3 px-7 pr-20 h-16 text-xl' placeholder='검색...' value={query} onChange={(e)=> {
|
||||
<input maxLength={50} onFocus={() => setHidden(false)} onBlur={() => setHidden(true)} className='bg-transparent flex-grow outline-none border-none shadow border-0 py-3 px-7 pr-20 h-16 text-xl' placeholder='검색...' value={query} onChange={(e)=> {
|
||||
SearchResults(e.target.value)
|
||||
}} />
|
||||
<button className='outline-none cusor-pointer absolute right-0 top-0 mt-5 mr-5'>
|
||||
|
||||
@ -54,8 +54,8 @@ interface OauthCallback {
|
||||
}
|
||||
|
||||
export const SearchQuerySchema: Yup.SchemaOf<SearchQuery> = Yup.object({
|
||||
q: Yup.string().min(2, '최소 2글자 이상 입력해주세요.').required('검색어를 입력해주세요.'),
|
||||
page: Yup.number().positive().integer().notRequired().default(1)
|
||||
q: Yup.string().min(2, '최소 2글자 이상 입력해주세요.').max(50).required('검색어를 입력해주세요.').label('검색어'),
|
||||
page: Yup.number().positive().integer().notRequired().default(1).label('페이지')
|
||||
})
|
||||
|
||||
interface SearchQuery {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user