gab-social/app/javascript/gabsocial/pages/home_page.js

64 lines
1.8 KiB
JavaScript
Raw Normal View History

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