-
Notifications
You must be signed in to change notification settings - Fork 45
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
Feature/google search box #177
Conversation
…esource/atomic-react-components into feature/search-box-with-speech-capability
…esource/atomic-react-components into feature/search-box-with-speech-capability
…components into feature/google-search-box
import type { Props } from './types'; | ||
|
||
const Search = ({ className, inputProps, dataLists, renderListItem }: Props): Node => { | ||
const [inputValue, setInputValue] = useState(inputProps.value || ''); |
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.
inputValue --> searchString looks more contextual
searchText => { | ||
const searchValue = typeof searchText === 'string' ? searchText : inputValue; | ||
|
||
if (searchValue) { |
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.
this logic I believe would come from TypeAhead
[inputValue, dataLists, setSearchList] | ||
); | ||
|
||
const onResult = result => { |
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.
Can we make onResult more explicit? its ambiguous what it does
onSpeachRecognitionResults makes it more clear
handleSpeechEnd, | ||
}); | ||
|
||
const onSpeechClick = () => onListen(); |
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.
onListen . --> onSpeechListenHandler
<div className="search-button"> | ||
<Button> | ||
{isListening ? ( | ||
<i className="search-icon search-loader" /> |
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.
Use Icon component
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.
yes
<div className="search-box"> | ||
<Input | ||
{...inputProps} | ||
aria-label="Search" |
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.
Labels should never be hard coded.
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.
yes, I'll update
overflow: hidden; | ||
} | ||
|
||
button { |
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.
This is wrong don't style the component here
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.
Once Icon componet will be exposed then unnecessary codes will be removed.
} | ||
|
||
.search-mic { | ||
background: url(images/googlemic.png) 0 0/24px no-repeat; |
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.
this is not a good approach
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.
It's a part of the icon component. Once Icon component will be exposed then these codes will be removed.
…components into feature/google-search-box
…components into feature/google-search-box
Working on all test cases.