62 lines
1.7 KiB
JavaScript
Raw Normal View History

2020-02-08 01:12:01 -05:00
import { Fragment } from 'react'
2020-03-24 00:39:12 -04:00
import { openModal } from '../actions/modal'
2020-02-08 01:12:01 -05:00
import GroupSidebarPanel from '../components/panel/groups_panel'
import LinkFooter from '../components/link_footer'
import WhoToFollowPanel from '../components/panel/who_to_follow_panel'
import ProgressPanel from '../components/panel/progress_panel'
2020-02-19 18:57:07 -05:00
import UserPanel from '../components/panel/user_panel'
import TrendsPanel from '../components/panel/trends_panel'
import HashtagsPanel from '../components/panel/hashtags_panel'
2020-02-24 16:56:07 -05:00
import DefaultLayout from '../layouts/default_layout'
2020-02-08 01:12:01 -05:00
import TimelineComposeBlock from '../components/timeline_compose_block'
2020-02-19 18:57:07 -05:00
import Divider from '../components/divider'
2020-03-24 00:39:12 -04:00
const mapDispatchToProps = (dispatch) => ({
onOpenHomePageSettingsModal() {
dispatch(openModal('HOME_TIMELINE_SETTINGS'))
},
})
2020-02-19 18:57:07 -05:00
2020-03-24 00:39:12 -04:00
export default
@connect(null, mapDispatchToProps)
class HomePage extends PureComponent {
static propTypes = {
onOpenHomePageSettingsModal: PropTypes.func.isRequired,
2020-03-12 12:09:15 -04:00
}
2020-03-24 00:39:12 -04:00
componentDidMount() {
document.title = '(1) Home - Gab'
2020-02-19 18:57:07 -05:00
}
2020-02-08 01:12:01 -05:00
render() {
2020-03-24 00:39:12 -04:00
const { children, onOpenHomePageSettingsModal } = this.props
return (
2020-02-17 12:50:29 -05:00
<DefaultLayout
2020-02-13 19:40:04 -05:00
title='Home'
2020-02-19 18:57:07 -05:00
actions={[
{
icon: 'ellipsis',
2020-03-24 00:39:12 -04:00
onClick: onOpenHomePageSettingsModal,
2020-02-19 18:57:07 -05:00
},
]}
2020-02-17 12:50:29 -05:00
layout={(
<Fragment>
<UserPanel />
<ProgressPanel />
2020-02-19 18:57:07 -05:00
<TrendsPanel />
<HashtagsPanel />
2020-02-17 12:50:29 -05:00
<WhoToFollowPanel />
<GroupSidebarPanel />
<LinkFooter />
</Fragment>
)}
>
2020-02-28 10:20:47 -05:00
<TimelineComposeBlock autoFocus={false} />
2020-02-19 18:57:07 -05:00
<Divider />
2020-02-08 01:12:01 -05:00
{children}
2020-02-17 12:50:29 -05:00
</DefaultLayout>
)
}
}