From e2c13cd1db01dcf7ba41346bb44bd4c4fb67d067 Mon Sep 17 00:00:00 2001 From: Joey Payne Date: Thu, 3 Mar 2016 12:04:39 -0700 Subject: [PATCH] Refactor SearchBar into a component --- app/components/EntrySelector.jsx | 64 ++++++++++++-------------------- app/components/SearchBar.jsx | 61 ++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+), 41 deletions(-) create mode 100644 app/components/SearchBar.jsx diff --git a/app/components/EntrySelector.jsx b/app/components/EntrySelector.jsx index 8de5afd..6bb2544 100644 --- a/app/components/EntrySelector.jsx +++ b/app/components/EntrySelector.jsx @@ -7,9 +7,9 @@ import List from 'material-ui/lib/lists/list' import ListItem from 'material-ui/lib/lists/list-item' import Description from 'material-ui/lib/svg-icons/action/description' import Add from 'material-ui/lib/svg-icons/content/add' -import Search from 'material-ui/lib/svg-icons/action/search' -import SelectableList from 'SelectableList' +import SearchBar from 'SearchBar' +import SelectableList from 'SelectableList' import Item from 'Item' import uuid from 'node-uuid' @@ -23,24 +23,13 @@ import mkdirp from 'mkdirp' import jsfile from 'jsonfile' import rmdir from 'rimraf' -const {AppBar, - AppCanvas, - FontIcon, - IconButton, - EnhancedButton, - AutoComplete, - NavigationClose, - Menu, - MenuItem, - Mixins, - RaisedButton, - FlatButton, - Dialog, - Styles, - Tab, - Tabs, - TextField, - Paper} = mui +const { + IconButton, + AutoComplete, + Styles, + TextField, + Paper +} = mui const colors = Styles.Colors @@ -81,27 +70,20 @@ export default class EntrySelector extends React.Component { render(){ return ( - - } - rightIconButton={ - - }> - {}} - onEnterKeyDown={()=>{}} - /> - - + + + } + hintText="Filter by keyword, title or tag." + innerTextFieldWidth={210} + onKeyDown={()=>{}} + onEnterKeyDown={()=>{}} + /> + } + rightIconButton={this.props.rightIconButton}> + + + + ) + } +} +