Skip to content
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

Merged
merged 9 commits into from
Apr 21, 2017
Merged

Create <SearchInput> #21

merged 9 commits into from
Apr 21, 2017

Conversation

zhusee2
Copy link
Contributor

@zhusee2 zhusee2 commented Apr 20, 2017

Purpose

Add new <SearchInput> to be used in CRM project

Implement

  1. Add new icons
  2. Add new <SearchInput>

Usage

const handleSearch = (searchValue) => {};

<SearchInput
    defaultValue="default input value"
    onSearch={handleSearch} />

Demo

2017-04-20 2 49 07

@zhusee2 zhusee2 requested a review from cjies April 20, 2017 06:53

import { STATUS_CODE } from './StatusIcon';

const COMPONENT_NAME = 'ic-search-input';
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

@cjies cjies left a 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
Copy link
Contributor

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={() => {}} />

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果之後有需要 onChange 的時候進行搜尋或其他使用情景的話也可以快速使用。

Copy link
Contributor Author

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) => {}} />

@zhusee2 zhusee2 merged commit ab4e856 into develop Apr 21, 2017
@zhusee2 zhusee2 deleted the feature/zhusee_search_input branch April 21, 2017 03:48
@zhusee2 zhusee2 mentioned this pull request Apr 21, 2017
@zhusee2 zhusee2 mentioned this pull request May 24, 2017
18 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants