-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
js: moved renderFilterControls() to js/topbar/FilterControls
- Loading branch information
Showing
2 changed files
with
73 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/** | ||
* Copyright 2017-present, The Visdom Authors | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
*/ | ||
|
||
import React from 'react'; | ||
|
||
function FilterControls(props) { | ||
const { filter, onFilterChange, onFilterClear } = props; | ||
|
||
return ( | ||
<div className="input-group navbar-btn"> | ||
<input | ||
type="text" | ||
className="form-control" | ||
data-cy="filter" | ||
placeholder="Filter text" | ||
onChange={onFilterChange} | ||
value={filter} | ||
/> | ||
<span className="input-group-btn"> | ||
<button | ||
data-toggle="tooltip" | ||
title="Clear filter" | ||
data-placement="bottom" | ||
type="button" | ||
className="btn btn-default" | ||
onClick={onFilterClear} | ||
> | ||
<span className="glyphicon glyphicon-erase" /> | ||
</button> | ||
</span> | ||
</div> | ||
); | ||
} | ||
|
||
export default FilterControls; |