+
+
+
location_on
+
{getHighlightedText(location, query)}
+
+
+
event
+
{getHighlightedText(date, query)}
+
+
+
{getShortDescription(description, query).map(match => {
+ return {getHighlightedText(match, query)}...
+ })}
+
+ )
+}
+
+export default SearchRow
diff --git a/src/reducers/app.js b/src/reducers/app.js
index 4c960dd..d4f88a2 100644
--- a/src/reducers/app.js
+++ b/src/reducers/app.js
@@ -22,7 +22,8 @@ import {
FETCH_ERROR,
FETCH_SOURCE_ERROR,
SET_LOADING,
- SET_NOT_LOADING
+ SET_NOT_LOADING,
+ UPDATE_SEARCH_QUERY
} from '../actions'
function updateHighlighted (appState, action) {
@@ -229,6 +230,13 @@ function setNotLoading (appState) {
}
}
+function updateSearchQuery (appState, action) {
+ return {
+ ...appState,
+ searchQuery: action.searchQuery
+ }
+}
+
function app (appState = initial.app, action) {
switch (action.type) {
case UPDATE_HIGHLIGHTED:
@@ -275,6 +283,8 @@ function app (appState = initial.app, action) {
return setLoading(appState)
case SET_NOT_LOADING:
return setNotLoading(appState)
+ case UPDATE_SEARCH_QUERY:
+ return updateSearchQuery(appState, action)
default:
return appState
}
diff --git a/src/scss/search.scss b/src/scss/search.scss
new file mode 100644
index 0000000..deac6ee
--- /dev/null
+++ b/src/scss/search.scss
@@ -0,0 +1,97 @@
+#search-bar-icon-container {
+ position: absolute;
+ background-color: black;
+ color: #a0a0a0;
+ border: #a0a0a0 solid 0.1px;
+ top: 10px;
+ margin-left: 10px;
+ height: 24px;
+ padding: 10px;
+ &:hover {
+ cursor: pointer;
+ color: white;
+ }
+}
+
+.search-bar-overlay {
+ background-color: black;
+ height: 100vh;
+ width: 400px;
+ position: absolute;
+ transition: 0.2s ease;
+}
+
+.search-bar-input {
+ width: 300px;
+ margin: 20px;
+ line-height: 40px;
+ font-size: 15px;
+ color: gray;
+ padding-left: 15px;
+ background: black;
+ border: 1px solid #a0a0a0;
+ &:focus {
+ outline: none;
+ }
+}
+
+#close-search-overlay {
+ color: #a0a0a0;
+ vertical-align: middle;
+ font-size: 30px;
+ transition: 0.2s ease;
+ &:hover {
+ color: white;
+ cursor: pointer;
+ }
+}
+
+.folded {
+ left: -400px;
+ transition: 0.2s ease;
+}
+
+.search-outer-container {
+ position: absolute;
+ left: 110px;
+ &.narrative-mode {
+ left: 0;
+ }
+}
+
+.search-row {
+ color: white;
+ padding-left: 10px;
+ padding-right: 10px;
+ padding-top: 10px;
+ padding-bottom: 10px;
+ background-color: grey;
+ border-bottom: 1px white solid;
+ border-top: 1px white solid;
+}
+
+.search-row > p {
+ margin: 0;
+}
+
+.search-results {
+ height: calc(100% - 332px);
+ overflow: auto;
+}
+
+div.location-date-container {
+ margin-top: 10px;
+ margin-bottom: 10px;
+}
+
+div.location-date-container > div {
+ width: 50%;
+ display: inline-block;
+ vertical-align: top;
+}
+
+div.location-date-container > div > p {
+ display: inline;
+ line-height: 24px;
+ vertical-align: top;
+}
\ No newline at end of file