Remove unused topSuggestion component
This commit is contained in:
parent
37ee60aca1
commit
cf23149ab4
2 changed files with 0 additions and 61 deletions
|
@ -1,17 +0,0 @@
|
|||
import { connect } from 'react-redux';
|
||||
import { selectIsUriResolving } from 'redux/selectors/claims';
|
||||
import { doResolveUri } from 'redux/actions/claims';
|
||||
import { makeSelectWinningUriForQuery } from 'redux/selectors/search';
|
||||
import TextareaTopSuggestion from './view';
|
||||
|
||||
const select = (state, props) => {
|
||||
const uriFromQuery = `lbry://${props.query}`;
|
||||
|
||||
return {
|
||||
isResolvingUri: selectIsUriResolving(state, uriFromQuery),
|
||||
uriFromQuery,
|
||||
winningUri: makeSelectWinningUriForQuery(props.query)(state),
|
||||
};
|
||||
};
|
||||
|
||||
export default connect(select, { doResolveUri })(TextareaTopSuggestion);
|
|
@ -1,44 +0,0 @@
|
|||
// @flow
|
||||
import TextareaSuggestionsItem from 'component/textareaSuggestionsItem';
|
||||
import LbcSymbol from 'component/common/lbc-symbol';
|
||||
import React from 'react';
|
||||
|
||||
type Props = {
|
||||
filteredTop: string,
|
||||
isResolvingUri: boolean,
|
||||
uriFromQuery: string,
|
||||
winningUri: string,
|
||||
doResolveUri: (string) => void,
|
||||
setTopSuggestion: (string) => void,
|
||||
};
|
||||
|
||||
export default function TextareaTopSuggestion(props: Props) {
|
||||
const { filteredTop, isResolvingUri, uriFromQuery, winningUri, doResolveUri, setTopSuggestion } = props;
|
||||
|
||||
React.useEffect(() => {
|
||||
if (uriFromQuery) doResolveUri(uriFromQuery);
|
||||
}, [doResolveUri, uriFromQuery]);
|
||||
|
||||
React.useEffect(() => {
|
||||
if (winningUri) setTopSuggestion(winningUri);
|
||||
}, [setTopSuggestion, winningUri]);
|
||||
|
||||
if (isResolvingUri) {
|
||||
return (
|
||||
<div className="textareaSuggestion">
|
||||
<div className="media__thumb media__thumb--resolving" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return filteredTop && filteredTop.length > 0 ? (
|
||||
<div className="textareaSuggestions__group">
|
||||
<div className="textareaSuggestions__label">
|
||||
<LbcSymbol prefix={__('Most Supported')} />
|
||||
</div>
|
||||
|
||||
<TextareaSuggestionsItem uri={filteredTop} />
|
||||
<hr className="textareaSuggestions__topSeparator" />
|
||||
</div>
|
||||
) : null;
|
||||
}
|
Loading…
Reference in a new issue