search bar displays pre-set value when ?discover=arg is passed
This commit is contained in:
parent
e0eb36d032
commit
167541b92c
2 changed files with 5 additions and 4 deletions
|
@ -190,7 +190,8 @@ var App = React.createClass({
|
||||||
},
|
},
|
||||||
render: function() {
|
render: function() {
|
||||||
var mainContent = this.getMainContent(),
|
var mainContent = this.getMainContent(),
|
||||||
headerLinks = this.getHeaderLinks();
|
headerLinks = this.getHeaderLinks(),
|
||||||
|
searchQuery = this.state.viewingPage == 'discover' && this.state.pageArgs ? this.state.pageArgs : '';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
this.state.viewingPage == 'watch' ?
|
this.state.viewingPage == 'watch' ?
|
||||||
|
@ -198,7 +199,7 @@ var App = React.createClass({
|
||||||
<div id="window" className={ this.state.drawerOpen ? 'drawer-open' : 'drawer-closed' }>
|
<div id="window" className={ this.state.drawerOpen ? 'drawer-open' : 'drawer-closed' }>
|
||||||
<Drawer onCloseDrawer={this.closeDrawer} viewingPage={this.state.viewingPage} />
|
<Drawer onCloseDrawer={this.closeDrawer} viewingPage={this.state.viewingPage} />
|
||||||
<div id="main-content" className={ headerLinks ? 'with-sub-nav' : 'no-sub-nav' }>
|
<div id="main-content" className={ headerLinks ? 'with-sub-nav' : 'no-sub-nav' }>
|
||||||
<Header onOpenDrawer={this.openDrawer} onSearch={this.onSearch} links={headerLinks} viewingPage={this.state.viewingPage} />
|
<Header onOpenDrawer={this.openDrawer} initialQuery={searchQuery} onSearch={this.onSearch} links={headerLinks} viewingPage={this.state.viewingPage} />
|
||||||
{mainContent}
|
{mainContent}
|
||||||
</div>
|
</div>
|
||||||
<Modal isOpen={this.state.modal == 'upgrade'} contentLabel="Update available"
|
<Modal isOpen={this.state.modal == 'upgrade'} contentLabel="Update available"
|
||||||
|
|
|
@ -52,7 +52,7 @@ var Header = React.createClass({
|
||||||
<Link onClick={this.props.onOpenDrawer} icon="icon-bars" className="open-drawer-link" />
|
<Link onClick={this.props.onOpenDrawer} icon="icon-bars" className="open-drawer-link" />
|
||||||
<h1>{ this.state.title }</h1>
|
<h1>{ this.state.title }</h1>
|
||||||
<div className="header-search">
|
<div className="header-search">
|
||||||
<input type="search" onChange={this.onQueryChange}
|
<input type="search" onChange={this.onQueryChange} defaultValue={this.props.initialQuery}
|
||||||
placeholder="Find movies, music, games, and more"/>
|
placeholder="Find movies, music, games, and more"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue