omit channels from suggested publish on search
This commit is contained in:
parent
8ccc3f8b89
commit
a43d91504f
2 changed files with 23 additions and 12 deletions
|
@ -175,6 +175,10 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (placeholder === 'publish' && !claim && uri.startsWith('lbry://@')) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<li
|
<li
|
||||||
ref={ref}
|
ref={ref}
|
||||||
|
|
|
@ -23,15 +23,22 @@ export default function SearchPage(props: Props) {
|
||||||
const urlParams = new URLSearchParams(location.search);
|
const urlParams = new URLSearchParams(location.search);
|
||||||
const urlQuery = urlParams.get('q');
|
const urlQuery = urlParams.get('q');
|
||||||
|
|
||||||
let INVALID_URI_CHARS = new RegExp(regexInvalidURI, 'gu');
|
let normalizedUri;
|
||||||
let modifiedUrlQuery = urlQuery
|
let isUriValid;
|
||||||
? urlQuery
|
if (isURIValid(urlQuery)) {
|
||||||
.trim()
|
isUriValid = true;
|
||||||
.replace(/\s+/g, '-')
|
normalizedUri = normalizeURI(urlQuery);
|
||||||
.replace(INVALID_URI_CHARS, '')
|
} else {
|
||||||
: '';
|
let INVALID_URI_CHARS = new RegExp(regexInvalidURI, 'gu');
|
||||||
const isModifiedUriValid = isURIValid(modifiedUrlQuery);
|
let modifiedUrlQuery = urlQuery
|
||||||
const normalizedModifiedUri = isModifiedUriValid && normalizeURI(modifiedUrlQuery);
|
? urlQuery
|
||||||
|
.trim()
|
||||||
|
.replace(/\s+/g, '-')
|
||||||
|
.replace(INVALID_URI_CHARS, '')
|
||||||
|
: '';
|
||||||
|
isUriValid = isURIValid(modifiedUrlQuery);
|
||||||
|
normalizedUri = isUriValid && normalizeURI(modifiedUrlQuery);
|
||||||
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (urlQuery) {
|
if (urlQuery) {
|
||||||
|
@ -44,11 +51,11 @@ export default function SearchPage(props: Props) {
|
||||||
<section className="search">
|
<section className="search">
|
||||||
{urlQuery && (
|
{urlQuery && (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
{isModifiedUriValid && (
|
{isUriValid && (
|
||||||
<header className="search__header">
|
<header className="search__header">
|
||||||
<ClaimUri uri={normalizedModifiedUri} />
|
<ClaimUri uri={normalizedUri} />
|
||||||
<div className="card">
|
<div className="card">
|
||||||
<ClaimPreview uri={normalizedModifiedUri} type="large" placeholder="publish" />
|
<ClaimPreview uri={normalizedUri} type="large" placeholder="publish" />
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
)}
|
)}
|
||||||
|
|
Loading…
Add table
Reference in a new issue