Remove isBuilding prop from SearchBox

This commit is contained in:
Maciej Ziarkowski 2019-09-09 00:44:26 +01:00
parent 5daf0796d1
commit 6625099c03
3 changed files with 3 additions and 7 deletions

View File

@ -173,7 +173,7 @@ class ColouringMap extends Component<any, ColouringMapState> { // TODO: add prop
<Fragment>
<Legend slug={cat} />
<ThemeSwitcher onSubmit={this.themeSwitch} currentTheme={this.state.theme} />
<SearchBox onLocate={this.handleLocate} isBuilding={isBuilding} />
<SearchBox onLocate={this.handleLocate} />
</Fragment>
) : null
}

View File

@ -5,9 +5,6 @@
z-index: 1000;
max-width:80%;
}
.building.search-box {
top: 0.5rem;
}
.search-box form,
.search-box .search-box-results {
border-radius: 4px;

View File

@ -8,8 +8,7 @@ import { SearchIcon } from '../components/icons';
*/
class SearchBox extends Component<any, any> { // TODO: add proper types
static propTypes = { // TODO: generate propTypes from TS
onLocate: PropTypes.func,
isBuilding: PropTypes.bool
onLocate: PropTypes.func
};
constructor(props) {
@ -159,7 +158,7 @@ class SearchBox extends Component<any, any> { // TODO: add proper types
</ul>
: null;
return (
<div className={`search-box ${this.props.isBuilding? 'building' : ''}`} onKeyDown={this.handleKeyPress}>
<div className="search-box" onKeyDown={this.handleKeyPress}>
<form onSubmit={this.search} className="form-inline">
<div onClick={this.state.smallScreen ? this.expandSearch : null}>
<SearchIcon/>