Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
Phase one of moving the function search into the editor search bar. A…
Browse files Browse the repository at this point in the history
…dding the UI for toggling function search. (#2121)
  • Loading branch information
wldcordeiro authored and jasonLaster committed Feb 24, 2017
1 parent 68049f2 commit d05e245
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/components/Editor/SearchBar.css
Expand Up @@ -65,6 +65,7 @@
height: 40px;
background-color: var(--theme-body-background);
border-bottom: 1px solid var(--theme-splitter-color);
padding: 0 13px;
}

.search-bottom-bar .search-modifiers {
Expand Down Expand Up @@ -101,3 +102,27 @@
.search-bottom-bar .search-modifiers button.active svg {
fill: white;
}

.search-bottom-bar .search-type-toggles {
display: flex;
align-items: center;
}

.search-bottom-bar .search-type-toggles h1 {
color: var(--theme-comment);
font-size: 12px;
margin: 0;
}

.search-bottom-bar .search-type-toggles .search-type-btn {
margin: 0 6px;
border: none;
background: transparent;
color: var(--theme-comment-alt);
}

.search-bottom-bar .search-type-toggles .search-type-btn.active {
color: var(--theme-selection-background);
font-weight: bold;
}

20 changes: 20 additions & 0 deletions src/components/Editor/SearchBar.js
Expand Up @@ -264,6 +264,10 @@ const SearchBar = React.createClass({
},

renderSearchModifiers() {
if (!isEnabled("searchModifiers")) {
return;
}

const {
modifiers: { caseSensitive, wholeWord, regexMatch },
toggleModifier } = this.props;
Expand Down Expand Up @@ -301,6 +305,21 @@ const SearchBar = React.createClass({
);
},

renderFunctionSearchToggle() {
if (!isEnabled("functionSearch")) {
return;
}

return dom.section(
{ className: "search-type-toggles" },
dom.h1(
{ className: "search-toggle-title" },
"Search for:"
),
dom.button({ className: "search-type-btn" }, "functions")
);
},

renderSearchField() {
const { searchResults: { count }} = this.props;
return dom.div(
Expand Down Expand Up @@ -331,6 +350,7 @@ const SearchBar = React.createClass({

return dom.div(
{ className: "search-bottom-bar" },
this.renderFunctionSearchToggle(),
this.renderSearchModifiers()
);
},
Expand Down

0 comments on commit d05e245

Please sign in to comment.