Always display FeaturesPanel at the top of the column

This commit is contained in:
Alex Gleason 2021-09-17 17:12:53 -05:00
parent 9b822a6c12
commit 5e30423b5c
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
3 changed files with 3 additions and 11 deletions

View File

@ -43,9 +43,9 @@ class DefaultPage extends ImmutablePureComponent {
<div className='columns-area__panels__pane columns-area__panels__pane--right'>
<div className='columns-area__panels__pane__inner'>
{me ? <FeaturesPanel key='features-panel' /> : <SignUpPanel key='sign-up-panel' />}
{showTrendsPanel && <TrendsPanel limit={3} key='trends-panel' />}
{showWhoToFollowPanel && <WhoToFollowPanel limit={5} key='wtf-panel' />}
{me ? <FeaturesPanel key='features-panel' /> : <SignUpPanel key='sign-up-panel' />}
<PromoPanel key='promo-panel' />
<LinkFooter key='link-footer' />
</div>

View File

@ -86,9 +86,9 @@ class HomePage extends ImmutablePureComponent {
<div className='columns-area__panels__pane columns-area__panels__pane--right'>
<div className='columns-area__panels__pane__inner'>
{me ? <FeaturesPanel key='features-panel' /> : <SignUpPanel key='sign-up-panel' />}
{showTrendsPanel && <TrendsPanel limit={3} key='trends-panel' />}
{showWhoToFollowPanel && <WhoToFollowPanel limit={5} key='wtf-panel' />}
{me ? <FeaturesPanel key='features-panel' /> : <SignUpPanel key='sign-up-panel' />}
<PromoPanel key='promo-panel' />
<LinkFooter key='link-footer' />
</div>

View File

@ -1,12 +1,9 @@
import React from 'react';
import { connect } from 'react-redux';
import ImmutablePureComponent from 'react-immutable-pure-component';
import WhoToFollowPanel from 'soapbox/features/ui/components/who_to_follow_panel';
import TrendsPanel from 'soapbox/features/ui/components/trends_panel';
import PromoPanel from 'soapbox/features/ui/components/promo_panel';
import FeaturesPanel from 'soapbox/features/ui/components/features_panel';
import LinkFooter from 'soapbox/features/ui/components/link_footer';
import { getFeatures } from 'soapbox/utils/features';
import InstanceInfoPanel from 'soapbox/features/ui/components/instance_info_panel';
import InstanceModerationPanel from 'soapbox/features/ui/components/instance_moderation_panel';
import { federationRestrictionsDisclosed } from 'soapbox/utils/state';
@ -15,12 +12,9 @@ import { isAdmin } from 'soapbox/utils/accounts';
const mapStateToProps = state => {
const me = state.get('me');
const account = state.getIn(['accounts', me]);
const features = getFeatures(state.get('instance'));
return {
me,
showTrendsPanel: features.trends,
showWhoToFollowPanel: features.suggestions,
disclosed: federationRestrictionsDisclosed(state),
isAdmin: isAdmin(account),
};
@ -30,7 +24,7 @@ export default @connect(mapStateToProps)
class RemoteInstancePage extends ImmutablePureComponent {
render() {
const { me, children, showTrendsPanel, showWhoToFollowPanel, params: { instance: host }, disclosed, isAdmin } = this.props;
const { me, children, params: { instance: host }, disclosed, isAdmin } = this.props;
return (
<div className='page'>
@ -52,8 +46,6 @@ class RemoteInstancePage extends ImmutablePureComponent {
<div className='columns-area__panels__pane columns-area__panels__pane--right'>
<div className='columns-area__panels__pane__inner'>
{showTrendsPanel && <TrendsPanel limit={3} key='trends-panel' />}
{showWhoToFollowPanel && <WhoToFollowPanel limit={5} key='wtf-panel' />}
{me && <FeaturesPanel key='features-panel' />}
<PromoPanel key='promo-panel' />
<LinkFooter key='link-footer' />