-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move search help to documentation, increase size of history panel
- Loading branch information
Jason Bulicek
committed
Oct 1, 2020
1 parent
6413b7a
commit 5a135b9
Showing
4 changed files
with
51 additions
and
93 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
This file was deleted.
Oops, something went wrong.
46 changes: 46 additions & 0 deletions
46
src/components/universalSearch/searchBar/searchHistory.jsx
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,46 @@ | ||
/* | ||
* Copyright 2018 Expedia Group | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
const SearchHistory = ({history}) => { | ||
const historyListItems = history.map((searchObject) => ( | ||
<li key={searchObject}><code><a href={`/search?${searchObject}`}>{searchObject.split('&').join(', ')}</a></code></li> | ||
)); | ||
const historyList = | ||
(<section> | ||
<div><b>History</b></div> | ||
<ul className="usb-suggestions__guide-history-list"> | ||
{historyListItems.length ? historyListItems : <li><code>No search history found - searches will be saved here</code></li>} | ||
</ul> | ||
</section>); | ||
|
||
return ( | ||
<div className="usb-suggestions__guide-wrapper pull-left"> | ||
<section> | ||
<div><b><a target="_blank" href="https://expediadotcom.github.io/haystack/docs/ui/ui_universal_search.html#simple-workflow">Need help searching? Click here</a></b></div> | ||
</section> | ||
{historyList} | ||
</div> | ||
); | ||
}; | ||
|
||
SearchHistory.propTypes = { | ||
history: PropTypes.object.isRequired | ||
}; | ||
|
||
export default SearchHistory; |