From cf23149ab4d29e386913259e8dd24acceca00861 Mon Sep 17 00:00:00 2001 From: Rafael Date: Thu, 9 Dec 2021 09:29:55 -0300 Subject: [PATCH] Remove unused topSuggestion component --- ui/component/textareaTopSuggestion/index.js | 17 -------- ui/component/textareaTopSuggestion/view.jsx | 44 --------------------- 2 files changed, 61 deletions(-) delete mode 100644 ui/component/textareaTopSuggestion/index.js delete mode 100644 ui/component/textareaTopSuggestion/view.jsx diff --git a/ui/component/textareaTopSuggestion/index.js b/ui/component/textareaTopSuggestion/index.js deleted file mode 100644 index ba73e5739..000000000 --- a/ui/component/textareaTopSuggestion/index.js +++ /dev/null @@ -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); diff --git a/ui/component/textareaTopSuggestion/view.jsx b/ui/component/textareaTopSuggestion/view.jsx deleted file mode 100644 index e34403777..000000000 --- a/ui/component/textareaTopSuggestion/view.jsx +++ /dev/null @@ -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 ( -
-
-
- ); - } - - return filteredTop && filteredTop.length > 0 ? ( -
-
- -
- - -
-
- ) : null; -}