2021-07-19 15:19:50 -07:00
|
|
|
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';
|
2021-07-26 09:46:44 -07:00
|
|
|
import { federationRestrictionsDisclosed } from 'soapbox/utils/state';
|
2021-07-19 15:19:50 -07:00
|
|
|
|
|
|
|
const mapStateToProps = state => {
|
2021-07-26 07:52:58 -07:00
|
|
|
const me = state.get('me');
|
2021-07-19 15:19:50 -07:00
|
|
|
const features = getFeatures(state.get('instance'));
|
|
|
|
|
|
|
|
return {
|
2021-07-26 07:52:58 -07:00
|
|
|
me,
|
2021-07-19 15:19:50 -07:00
|
|
|
showTrendsPanel: features.trends,
|
|
|
|
showWhoToFollowPanel: features.suggestions,
|
2021-07-26 09:46:44 -07:00
|
|
|
disclosed: federationRestrictionsDisclosed(state),
|
2021-07-19 15:19:50 -07:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
export default @connect(mapStateToProps)
|
|
|
|
class RemoteInstancePage extends ImmutablePureComponent {
|
|
|
|
|
|
|
|
render() {
|
2021-07-26 09:49:30 -07:00
|
|
|
const { me, children, showTrendsPanel, showWhoToFollowPanel, params: { instance: host }, disclosed } = this.props;
|
2021-07-19 15:19:50 -07:00
|
|
|
|
|
|
|
return (
|
|
|
|
<div className='page'>
|
|
|
|
<div className='page__columns'>
|
|
|
|
<div className='columns-area__panels'>
|
|
|
|
|
|
|
|
<div className='columns-area__panels__pane columns-area__panels__pane--left'>
|
|
|
|
<div className='columns-area__panels__pane__inner'>
|
2021-07-26 09:46:44 -07:00
|
|
|
{disclosed && <InstanceInfoPanel host={host} />}
|
2021-07-19 15:19:50 -07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div className='columns-area__panels__main'>
|
|
|
|
<div className='columns-area columns-area--mobile'>
|
|
|
|
{children}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<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' />}
|
2021-07-26 07:52:58 -07:00
|
|
|
{me && <FeaturesPanel key='features-panel' />}
|
2021-07-19 15:19:50 -07:00
|
|
|
<PromoPanel key='promo-panel' />
|
|
|
|
<LinkFooter key='link-footer' />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|