2020-03-27 13:59:38 -07:00
|
|
|
import React from 'react';
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import ImmutablePureComponent from 'react-immutable-pure-component';
|
|
|
|
import WhoToFollowPanel from '../features/ui/components/who_to_follow_panel';
|
|
|
|
import TrendsPanel from '../features/ui/components/trends_panel';
|
|
|
|
import LinkFooter from '../features/ui/components/link_footer';
|
|
|
|
import PromoPanel from '../features/ui/components/promo_panel';
|
|
|
|
import UserPanel from '../features/ui/components/user_panel';
|
|
|
|
import FundingPanel from '../features/ui/components/funding_panel';
|
|
|
|
import ComposeFormContainer from '../features/compose/containers/compose_form_container';
|
|
|
|
import Avatar from '../components/avatar';
|
2020-04-14 13:45:38 -07:00
|
|
|
// import GroupSidebarPanel from '../features/groups/sidebar_panel';
|
2020-03-27 13:59:38 -07:00
|
|
|
|
2020-04-01 19:20:47 -07:00
|
|
|
const mapStateToProps = state => {
|
|
|
|
const me = state.get('me');
|
|
|
|
return {
|
|
|
|
account: state.getIn(['accounts', me]),
|
2020-04-11 14:31:58 -07:00
|
|
|
hasPatron: state.getIn(['soapbox', 'extensions', 'patron']),
|
2020-04-14 11:44:40 -07:00
|
|
|
};
|
2020-04-01 19:20:47 -07:00
|
|
|
};
|
2020-03-27 13:59:38 -07:00
|
|
|
|
|
|
|
export default @connect(mapStateToProps)
|
|
|
|
class HomePage extends ImmutablePureComponent {
|
2020-04-14 11:44:40 -07:00
|
|
|
|
2020-04-15 13:21:53 -07:00
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
this.composeBlock = React.createRef();
|
|
|
|
}
|
|
|
|
|
2020-04-14 14:47:35 -07:00
|
|
|
render() {
|
2020-04-14 11:44:40 -07:00
|
|
|
const { children, account, hasPatron } = this.props;
|
2020-03-27 13:59:38 -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'>
|
|
|
|
<UserPanel />
|
2020-04-01 12:38:08 -07:00
|
|
|
{hasPatron && <FundingPanel />}
|
2020-03-27 13:59:38 -07:00
|
|
|
<PromoPanel />
|
|
|
|
<LinkFooter />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div className='columns-area__panels__main'>
|
|
|
|
<div className='columns-area columns-area--mobile'>
|
2020-04-15 13:21:53 -07:00
|
|
|
<div className='timeline-compose-block' ref={this.composeBlock}>
|
2020-03-27 13:59:38 -07:00
|
|
|
<div className='timeline-compose-block__avatar'>
|
|
|
|
<Avatar account={account} size={46} />
|
|
|
|
</div>
|
2020-04-15 13:21:53 -07:00
|
|
|
<ComposeFormContainer
|
|
|
|
shouldCondense
|
|
|
|
autoFocus={false}
|
|
|
|
clickableAreaRef={this.composeBlock}
|
|
|
|
/>
|
2020-03-27 13:59:38 -07:00
|
|
|
</div>
|
|
|
|
|
|
|
|
{children}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div className='columns-area__panels__pane columns-area__panels__pane--right'>
|
|
|
|
<div className='columns-area__panels__pane__inner'>
|
|
|
|
{/* <GroupSidebarPanel /> */}
|
|
|
|
<TrendsPanel limit={3} />
|
|
|
|
<WhoToFollowPanel limit={5} />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-04-14 11:44:40 -07:00
|
|
|
);
|
2020-03-27 13:59:38 -07:00
|
|
|
}
|
2020-04-14 11:44:40 -07:00
|
|
|
|
2020-03-27 13:59:38 -07:00
|
|
|
}
|