enable top claim on search page for everyone
This commit is contained in:
parent
5a1eecfc4b
commit
1711dc6601
1 changed files with 17 additions and 4 deletions
|
@ -11,6 +11,7 @@ import SearchOptions from 'component/searchOptions';
|
||||||
import Button from 'component/button';
|
import Button from 'component/button';
|
||||||
import ClaimUri from 'component/claimUri';
|
import ClaimUri from 'component/claimUri';
|
||||||
import Ads from 'web/component/ads';
|
import Ads from 'web/component/ads';
|
||||||
|
import ClaimEffectiveAmount from 'component/claimEffectiveAmount';
|
||||||
import { formatLbryUrlForWeb } from 'util/url';
|
import { formatLbryUrlForWeb } from 'util/url';
|
||||||
import { useHistory } from 'react-router';
|
import { useHistory } from 'react-router';
|
||||||
|
|
||||||
|
@ -85,9 +86,11 @@ export default function SearchPage(props: Props) {
|
||||||
.replace(INVALID_URI_CHARS, '');
|
.replace(INVALID_URI_CHARS, '');
|
||||||
const uriFromQuery = `lbry://${modifiedUrlQuery}`;
|
const uriFromQuery = `lbry://${modifiedUrlQuery}`;
|
||||||
|
|
||||||
|
const stringifiedOptions = JSON.stringify(additionalOptions);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (urlQuery) {
|
if (urlQuery) {
|
||||||
search(urlQuery, additionalOptions);
|
const jsonOptions = JSON.parse(stringifiedOptions);
|
||||||
|
search(urlQuery, jsonOptions);
|
||||||
}
|
}
|
||||||
}, [search, urlQuery]);
|
}, [search, urlQuery]);
|
||||||
|
|
||||||
|
@ -96,7 +99,7 @@ export default function SearchPage(props: Props) {
|
||||||
<section className="search">
|
<section className="search">
|
||||||
{urlQuery && (
|
{urlQuery && (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
{!SIMPLE_SITE && isValid && (
|
{isValid && (
|
||||||
<header className="search__header">
|
<header className="search__header">
|
||||||
<div className="claim-preview__actions--header">
|
<div className="claim-preview__actions--header">
|
||||||
<ClaimUri uri={uriFromQuery} noShortUrl />
|
<ClaimUri uri={uriFromQuery} noShortUrl />
|
||||||
|
@ -111,7 +114,17 @@ export default function SearchPage(props: Props) {
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="card">
|
<div className="card">
|
||||||
<ClaimPreview uri={uriFromQuery} type="large" placeholder="publish" />
|
<ClaimPreview
|
||||||
|
uri={uriFromQuery}
|
||||||
|
type="large"
|
||||||
|
placeholder="publish"
|
||||||
|
properties={claim => (
|
||||||
|
<span className="claim-preview__custom-properties">
|
||||||
|
<span className="help--inline">{__('Current winning amount')}</span>
|
||||||
|
<ClaimEffectiveAmount uri={uriFromQuery} />
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
)}
|
)}
|
||||||
|
@ -119,7 +132,7 @@ export default function SearchPage(props: Props) {
|
||||||
<ClaimList
|
<ClaimList
|
||||||
uris={uris}
|
uris={uris}
|
||||||
loading={isSearching}
|
loading={isSearching}
|
||||||
header={<SearchOptions additionalOptions={additionalOptions} />}
|
header={SIMPLE_SITE && <SearchOptions additionalOptions={additionalOptions} />}
|
||||||
injectedItem={SHOW_ADS && !isAuthenticated && IS_WEB && <Ads type="video" />}
|
injectedItem={SHOW_ADS && !isAuthenticated && IS_WEB && <Ads type="video" />}
|
||||||
headerAltControls={
|
headerAltControls={
|
||||||
<Fragment>
|
<Fragment>
|
||||||
|
|
Loading…
Reference in a new issue