Merge pull request #1514 from lbryio/search-page

Search page (not modal)
This commit is contained in:
Sean Yesmunt 2018-06-04 23:03:30 -04:00 committed by GitHub
commit 850e187d4b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 14 deletions

View file

@ -48,7 +48,7 @@
"formik": "^0.10.4", "formik": "^0.10.4",
"hast-util-sanitize": "^1.1.2", "hast-util-sanitize": "^1.1.2",
"keytar": "^4.2.1", "keytar": "^4.2.1",
"lbry-redux": "lbryio/lbry-redux#a32e8835c238c0ba1081fe6979763c5b0fade76c", "lbry-redux": "lbryio/lbry-redux#02e47f922e5ba8908b5848c15b84196c87b9804d",
"localforage": "^1.7.1", "localforage": "^1.7.1",
"mixpanel-browser": "^2.17.1", "mixpanel-browser": "^2.17.1",
"moment": "^2.22.0", "moment": "^2.22.0",

View file

@ -17,6 +17,7 @@ import AuthPage from 'page/auth';
import InvitePage from 'page/invite'; import InvitePage from 'page/invite';
import BackupPage from 'page/backup'; import BackupPage from 'page/backup';
import SubscriptionsPage from 'page/subscriptions'; import SubscriptionsPage from 'page/subscriptions';
import SearchPage from 'page/search';
const route = (props, page, routesMap) => { const route = (props, page, routesMap) => {
const component = routesMap[page]; const component = routesMap[page];
@ -51,6 +52,7 @@ const Router = props => {
show: <ShowPage {...params} />, show: <ShowPage {...params} />,
wallet: <WalletPage params={params} />, wallet: <WalletPage params={params} />,
subscriptions: <SubscriptionsPage params={params} />, subscriptions: <SubscriptionsPage params={params} />,
search: <SearchPage {...params} />,
}); });
}; };

View file

@ -7,6 +7,7 @@ import {
MODALS, MODALS,
doFocusSearchInput, doFocusSearchInput,
doBlurSearchInput, doBlurSearchInput,
doSearch,
} from 'lbry-redux'; } from 'lbry-redux';
import { doNavigate } from 'redux/actions/navigation'; import { doNavigate } from 'redux/actions/navigation';
import Wunderbar from './view'; import Wunderbar from './view';
@ -27,8 +28,8 @@ const select = state => {
const perform = dispatch => ({ const perform = dispatch => ({
onSearch: query => { onSearch: query => {
dispatch(doUpdateSearchQuery(query)); dispatch(doSearch(query));
dispatch(doNotify({ id: MODALS.SEARCH })); dispatch(doNavigate(`/search`, { query }));
}, },
onSubmit: (uri, extraParams) => dispatch(doNavigate('/show', { uri, ...extraParams })), onSubmit: (uri, extraParams) => dispatch(doNavigate('/show', { uri, ...extraParams })),
updateSearchQuery: query => dispatch(doUpdateSearchQuery(query)), updateSearchQuery: query => dispatch(doUpdateSearchQuery(query)),

View file

@ -37,16 +37,8 @@ class SearchPage extends React.PureComponent<Props> {
render() { render() {
const { query, updateSearchQuery } = this.props; const { query, updateSearchQuery } = this.props;
return ( return (
<Page noPadding> <Page>
<div className="search__wrapper"> <div className="search__wrapper">
<input
ref={input => (this.input = input)}
className="search__input"
value={query}
placeholder={__('Search for anything...')}
onChange={event => updateSearchQuery(event.target.value)}
/>
{isURIValid(query) && ( {isURIValid(query) && (
<React.Fragment> <React.Fragment>
<div className="file-list__header"> <div className="file-list__header">

View file

@ -5647,9 +5647,9 @@ lazy-val@^1.0.3:
version "1.0.3" version "1.0.3"
resolved "https://registry.yarnpkg.com/lazy-val/-/lazy-val-1.0.3.tgz#bb97b200ef00801d94c317e29dc6ed39e31c5edc" resolved "https://registry.yarnpkg.com/lazy-val/-/lazy-val-1.0.3.tgz#bb97b200ef00801d94c317e29dc6ed39e31c5edc"
lbry-redux@lbryio/lbry-redux#a32e8835c238c0ba1081fe6979763c5b0fade76c: lbry-redux@lbryio/lbry-redux#02e47f922e5ba8908b5848c15b84196c87b9804d:
version "0.0.1" version "0.0.1"
resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/a32e8835c238c0ba1081fe6979763c5b0fade76c" resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/02e47f922e5ba8908b5848c15b84196c87b9804d"
dependencies: dependencies:
proxy-polyfill "0.1.6" proxy-polyfill "0.1.6"
reselect "^3.0.0" reselect "^3.0.0"