From ab09cb3b3aed7105570c387d9c4ff18e7f5c544c Mon Sep 17 00:00:00 2001
From: Vitaly Takmazov
Date: Wed, 18 Jul 2018 13:24:00 +0300
Subject: SearchBox now works
---
vnext/src/App.js | 13 +++++++------
vnext/src/components/SearchBox.js | 12 +++++++++---
2 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/vnext/src/App.js b/vnext/src/App.js
index aa159f14..81862d4f 100644
--- a/vnext/src/App.js
+++ b/vnext/src/App.js
@@ -96,8 +96,11 @@ export default class App extends React.Component {
me().then(visitor => this.auth(visitor));
}
}
- search = (searchString) => {
- console.log(searchString);
+ search = (history, pathname, searchString) => {
+ let location = {};
+ location.pathname = pathname;
+ location.search = `?search=${searchString}`;
+ history.push(location);
}
render() {
const user = this.state.visitor;
@@ -114,7 +117,7 @@ export default class App extends React.Component {
Juick
}
-
+