aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/App.js
diff options
context:
space:
mode:
Diffstat (limited to 'vnext/src/App.js')
-rw-r--r--vnext/src/App.js13
1 files changed, 7 insertions, 6 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 {
<div id="logo"><Link to="/">Juick</Link></div>
}
<div id="search">
- <SearchBox onSearch={this.search} />
+ <SearchBox pathname="/" onSearch={this.search} {...this.props} />
</div>
<nav id="global">
<ul>
@@ -196,9 +199,7 @@ export default class App extends React.Component {
</li>
</ul>
<hr />
- <form>
- <p><input type="text" name="search" className="inp" placeholder="Search..." /></p>
- </form>
+ <SearchBox pathname={`/${user.uname}/`} onSearch={this.search} {...this.props} />
<hr />
<div id="ustats">
<ul>