-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create <SearchInput> #21
Conversation
|
||
import { STATUS_CODE } from './StatusIcon'; | ||
|
||
const COMPONENT_NAME = 'ic-search-input'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't forget to change the prefix after #22 been merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#22 is based on this PR, so it'll be changed in there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
others LGTM
<RowCompBody> | ||
<Icon type="search" /> | ||
|
||
<input |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
一個小建議,希望可以將 <SearchInput>
做成 controlled component。
Like:
<SearchInput
defaultValue="default"
value="value"
onChange={() => {}} />
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果之後有需要 onChange 的時候進行搜尋或其他使用情景的話也可以快速使用。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
他目前的使用情境暫時比較不會這樣用
不過因為有保留可以透過 input
傳 prop 到 <input>
上,屆時如果臨時需要可以從這邊做成 controlled input XD
// Used as controlled input
<SearchInput
input={{
value: 'value',
onChange: (event) => {},
}}
onSearch={(searchValue) => {}} />
Purpose
Add new
<SearchInput>
to be used in CRM projectImplement
<SearchInput>
Usage
Demo