Clean homepage and export copy/paste issues, (no functional change)

This commit is contained in:
infinite-persistence 2022-04-08 17:20:30 +08:00
parent b79b7f9bde
commit 5a400ca2fa
No known key found for this signature in database
GPG key ID: B9C3252EDC3D0AA0
4 changed files with 21 additions and 31 deletions

View file

@ -8,7 +8,7 @@ import { selectActiveLivestreams } from 'redux/selectors/livestream';
import { selectFollowedTags } from 'redux/selectors/tags';
import { doToggleTagFollowDesktop } from 'redux/actions/tags';
import { selectClientSetting, selectLanguage } from 'redux/selectors/settings';
import Tags from './view';
import DiscoverPage from './view';
const select = (state, props) => {
const urlParams = new URLSearchParams(props.location.search);
@ -30,4 +30,4 @@ export default connect(select, {
doToggleTagFollowDesktop,
doResolveUri,
doFetchActiveLivestreams,
})(Tags);
})(DiscoverPage);

View file

@ -9,7 +9,7 @@ import { selectHasOdyseeMembership, selectHomepageFetched, selectUserVerifiedEma
import { selectSubscriptions } from 'redux/selectors/subscriptions';
import { selectShowMatureContent, selectHomepageData, selectClientSetting } from 'redux/selectors/settings';
import DiscoverPage from './view';
import HomePage from './view';
const select = (state) => ({
followedTags: selectFollowedTags(state),
@ -31,4 +31,4 @@ const perform = (dispatch) => ({
doOpenModal: (modal, props) => dispatch(doOpenModal(modal, props)),
});
export default connect(select, perform)(DiscoverPage);
export default connect(select, perform)(HomePage);

View file

@ -21,9 +21,12 @@ import classnames from 'classnames';
import Ads from 'web/component/ads';
import Meme from 'web/component/meme';
function resolveTitleOverride(title: string) {
return title === 'Recent From Following' ? 'Following' : title;
}
const FYP_SECTION: RowDataItem = {
id: 'FYP',
title: 'Recommended',
icon: ICONS.GLOBE,
link: `/$/${PAGES.FYP}`,
};
type HomepageOrder = { active: ?Array<string>, hidden: ?Array<string> };
@ -89,12 +92,7 @@ function HomePage(props: Props) {
if (item) {
sortedRowData.push(item);
} else if (key === 'FYP') {
sortedRowData.push({
id: 'FYP',
title: 'Recommended',
icon: ICONS.GLOBE,
link: `/$/${PAGES.FYP}`,
});
sortedRowData.push(FYP_SECTION);
}
});
} else {
@ -102,13 +100,9 @@ function HomePage(props: Props) {
// always inject FYP is homepage not customized, hide news.
if (key.id === 'FOLLOWING') {
sortedRowData.push(key);
hasMembership &&
sortedRowData.push({
id: 'FYP',
title: 'Recommended',
icon: ICONS.GLOBE,
link: `/$/${PAGES.FYP}`,
});
if (hasMembership) {
sortedRowData.push(FYP_SECTION);
}
} else if (key.id !== 'NEWS') {
sortedRowData.push(key);
}
@ -173,6 +167,10 @@ function HomePage(props: Props) {
);
const HeaderArea = () => {
function resolveTitleOverride(title: string) {
return title === 'Recent From Following' ? 'Following' : title;
}
return (
<>
{title && typeof title === 'string' && (

View file

@ -1,18 +1,10 @@
import { connect } from 'react-redux';
import { selectFollowedTags } from 'redux/selectors/tags';
import { selectUserVerifiedEmail } from 'redux/selectors/user';
import { selectSubscriptions } from 'redux/selectors/subscriptions';
import DiscoverPage from './view';
import { selectClientSetting } from 'redux/selectors/settings';
import TagsFollowingPage from './view';
import * as SETTINGS from 'constants/settings';
import { selectClientSetting } from 'redux/selectors/settings';
const select = (state) => ({
followedTags: selectFollowedTags(state),
subscribedChannels: selectSubscriptions(state),
email: selectUserVerifiedEmail(state),
tileLayout: selectClientSetting(state, SETTINGS.TILE_LAYOUT),
});
const perform = {};
export default connect(select, perform)(DiscoverPage);
export default connect(select)(TagsFollowingPage);