HomeTimeline: remove suggestions

dnd
Alex Gleason 2022-06-04 15:31:24 -05:00
rodzic 71362a922a
commit 4c87573972
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 10 dodań i 28 usunięć

Wyświetl plik

@ -5,17 +5,12 @@ import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import { connect } from 'react-redux';
import { Link } from 'react-router-dom';
import BundleContainer from 'soapbox/features/ui/containers/bundle_container';
import { getFeatures } from 'soapbox/utils/features';
import { expandHomeTimeline } from '../../actions/timelines';
import { Column } from '../../components/ui';
import Timeline from '../ui/components/timeline';
function FollowRecommendationsContainer() {
return import(/* webpackChunkName: "features/follow_recommendations" */'soapbox/features/follow_recommendations/components/follow_recommendations_container');
}
const messages = defineMessages({
title: { id: 'column.home', defaultMessage: 'Home' },
});
@ -92,28 +87,16 @@ class HomeTimeline extends React.PureComponent {
}
}
handleDone = e => {
this.props.dispatch(expandHomeTimeline());
this.setState({ done: true });
}
handleRefresh = () => {
const { dispatch } = this.props;
return dispatch(expandHomeTimeline());
}
render() {
const { intl, siteTitle, isLoading, loadingFailed, isEmpty, features } = this.props;
const { done } = this.state;
const showSuggestions = features.suggestions && isEmpty && !isLoading && !loadingFailed && !done;
const { intl, siteTitle } = this.props;
return (
<Column label={intl.formatMessage(messages.title)} transparent={!showSuggestions}>
{showSuggestions ? (
<BundleContainer fetchComponent={FollowRecommendationsContainer}>
{Component => <Component onDone={this.handleDone} />}
</BundleContainer>
) : (
<Column label={intl.formatMessage(messages.title)}>
<Timeline
scrollKey='home_timeline'
onLoadMore={this.handleLoadMore}
@ -122,7 +105,6 @@ class HomeTimeline extends React.PureComponent {
divideType='space'
emptyMessage={<FormattedMessage id='empty_column.home' defaultMessage='Your home timeline is empty! Visit {public} to get started and meet other users.' values={{ public: <Link to='/timeline/local'><FormattedMessage id='empty_column.home.local_tab' defaultMessage='the {site_title} tab' values={{ site_title: siteTitle }} /></Link> }} />}
/>
)}
</Column>
);
}