-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ 태그 실시간 검색 추가 및 소식 탭 디자인 수정 (#137)
* design: 검색박스 디자인 수정 * fix: 태그 실시간 검색 추가 * desing: 세미나 검색창 디자인 수정 * deisgn: 세미나 목록 디자인 수정 * design: 검색창 자동완성 배경색수정
- Loading branch information
1 parent
ad2c86c
commit c35783c
Showing
14 changed files
with
142 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,35 @@ | ||
import { Dispatch, FormEvent, SetStateAction } from 'react'; | ||
import { Dispatch, SetStateAction } from 'react'; | ||
|
||
import KeywordInput from './KeywordInput'; | ||
import TagFilter from './TagFilter'; | ||
|
||
interface SearchFormProps { | ||
disabled: boolean; | ||
onSubmit: (e: FormEvent<HTMLFormElement>) => void; | ||
search: (tags?: string[]) => void; | ||
tags: string[]; | ||
selectedTags: string[]; | ||
setSelectedTags: Dispatch<SetStateAction<string[]>>; | ||
keyword: string; | ||
setKeyword: Dispatch<SetStateAction<string>>; | ||
} | ||
|
||
export default function SearchForm({ | ||
disabled, | ||
onSubmit, | ||
search, | ||
tags, | ||
selectedTags, | ||
setSelectedTags, | ||
keyword, | ||
setKeyword, | ||
}: SearchFormProps) { | ||
return ( | ||
<form | ||
className="grid grid-cols-[auto_1fr_auto] grid-rows-auto gap-y-5 p-6 min-w-max bg-neutral-100" | ||
onSubmit={onSubmit} | ||
className="flex flex-col gap-5 p-6 min-w-max bg-neutral-100" | ||
onSubmit={(e) => { | ||
e.preventDefault(); | ||
search(); | ||
}} | ||
> | ||
<TagFilter | ||
tags={tags} | ||
selectedTags={selectedTags} | ||
setSelectedTags={setSelectedTags} | ||
disabled={disabled} | ||
/> | ||
<TagFilter tags={tags} selectedTags={selectedTags} disabled={disabled} searchTags={search} /> | ||
<KeywordInput keyword={keyword} setKeyword={setKeyword} disabled={disabled} /> | ||
<SearchButton disabled={disabled} /> | ||
</form> | ||
); | ||
} | ||
|
||
function SearchButton({ disabled }: { disabled: boolean }) { | ||
return ( | ||
<button | ||
className="col-start-3 px-3 py-[0.1875rem] rounded-[0.0625rem] bg-neutral-200 enabled:hover:bg-neutral-300 font-semibold text-xs tracking-wider" | ||
disabled={disabled} | ||
> | ||
결과 보기 | ||
</button> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.