Delete SearchResultsContainer
This commit is contained in:
parent
88404f32b6
commit
640a6ab8eb
3 changed files with 3 additions and 48 deletions
|
@ -29,20 +29,8 @@ const messages = defineMessages({
|
||||||
|
|
||||||
type SearchFilter = 'accounts' | 'statuses' | 'hashtags';
|
type SearchFilter = 'accounts' | 'statuses' | 'hashtags';
|
||||||
|
|
||||||
interface ISearchResults {
|
|
||||||
value: string,
|
|
||||||
results: ImmutableMap<string, any>,
|
|
||||||
submitted: boolean,
|
|
||||||
expandSearch: (filter: SearchFilter) => void,
|
|
||||||
selectedFilter: SearchFilter,
|
|
||||||
selectFilter: (filter: SearchFilter) => void,
|
|
||||||
suggestions: ImmutableList<any>,
|
|
||||||
trendingStatuses: ImmutableList<any>,
|
|
||||||
trends: ImmutableList<any>,
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Displays search results depending on the active tab. */
|
/** Displays search results depending on the active tab. */
|
||||||
const SearchResults: React.FC<ISearchResults> = () => {
|
const SearchResults: React.FC = () => {
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
|
|
||||||
|
|
|
@ -1,33 +0,0 @@
|
||||||
import { connect } from 'react-redux';
|
|
||||||
|
|
||||||
import { fetchTrendingStatuses } from 'soapbox/actions/trending_statuses';
|
|
||||||
import { getFeatures } from 'soapbox/utils/features';
|
|
||||||
|
|
||||||
import { expandSearch, setFilter } from '../../../actions/search';
|
|
||||||
import { fetchSuggestions, dismissSuggestion } from '../../../actions/suggestions';
|
|
||||||
import SearchResults from '../components/search_results';
|
|
||||||
|
|
||||||
const mapStateToProps = state => {
|
|
||||||
const instance = state.get('instance');
|
|
||||||
|
|
||||||
return {
|
|
||||||
value: state.getIn(['search', 'submittedValue']),
|
|
||||||
results: state.getIn(['search', 'results']),
|
|
||||||
suggestions: state.getIn(['suggestions', 'items']),
|
|
||||||
trendingStatuses: state.getIn(['trending_statuses', 'items']),
|
|
||||||
trends: state.getIn(['trends', 'items']),
|
|
||||||
submitted: state.getIn(['search', 'submitted']),
|
|
||||||
selectedFilter: state.getIn(['search', 'filter']),
|
|
||||||
features: getFeatures(instance),
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
const mapDispatchToProps = dispatch => ({
|
|
||||||
fetchSuggestions: () => dispatch(fetchSuggestions()),
|
|
||||||
fetchTrendingStatuses: () => dispatch(fetchTrendingStatuses()),
|
|
||||||
expandSearch: type => dispatch(expandSearch(type)),
|
|
||||||
dismissSuggestion: account => dispatch(dismissSuggestion(account.get('id'))),
|
|
||||||
selectFilter: newActiveFilter => dispatch(setFilter(newActiveFilter)),
|
|
||||||
});
|
|
||||||
|
|
||||||
export default connect(mapStateToProps, mapDispatchToProps)(SearchResults);
|
|
|
@ -3,7 +3,7 @@ import { defineMessages, useIntl } from 'react-intl';
|
||||||
|
|
||||||
import { Column } from 'soapbox/components/ui';
|
import { Column } from 'soapbox/components/ui';
|
||||||
import Search from 'soapbox/features/compose/components/search';
|
import Search from 'soapbox/features/compose/components/search';
|
||||||
import SearchResultsContainer from 'soapbox/features/compose/containers/search_results_container';
|
import SearchResults from 'soapbox/features/compose/components/search_results';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
heading: { id: 'column.search', defaultMessage: 'Search' },
|
heading: { id: 'column.search', defaultMessage: 'Search' },
|
||||||
|
@ -16,7 +16,7 @@ const SearchPage = () => {
|
||||||
<Column label={intl.formatMessage(messages.heading)}>
|
<Column label={intl.formatMessage(messages.heading)}>
|
||||||
<div className='space-y-4'>
|
<div className='space-y-4'>
|
||||||
<Search autoFocus autoSubmit />
|
<Search autoFocus autoSubmit />
|
||||||
<SearchResultsContainer />
|
<SearchResults />
|
||||||
</div>
|
</div>
|
||||||
</Column>
|
</Column>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue