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

80 lines
1.6 KiB
JavaScript
Raw Normal View History

2020-02-22 23:26:23 +00:00
import { Fragment } from 'react'
2020-03-25 03:08:43 +00:00
import { openModal } from '../actions/modal'
2020-02-22 23:26:23 +00:00
import LinkFooter from '../components/link_footer'
import GroupsPanel from '../components/panel/groups_panel'
2020-03-25 03:08:43 +00:00
import WhoToFollowPanel from '../components/panel/who_to_follow_panel'
2020-02-24 21:56:07 +00:00
import DefaultLayout from '../layouts/default_layout'
2020-02-22 23:26:23 +00:00
2020-03-25 03:08:43 +00:00
const mapDispatchToProps = dispatch => ({
onOpenGroupCreateModal() {
dispatch(openModal('GROUP_CREATE'))
},
})
export default
@connect(null, mapDispatchToProps)
class GroupsPage extends PureComponent {
static propTypes = {
onOpenGroupCreateModal: PropTypes.func.isRequired,
}
2020-02-22 23:26:23 +00:00
2020-03-12 16:09:15 +00:00
componentDidMount() {
document.title = 'Groups - Gab'
}
2020-02-22 23:26:23 +00:00
handleClickNewList () {
console.log("handleClickNewList")
}
handleClickEditLists () {
console.log("handleClickEditLists")
}
render() {
2020-03-25 03:08:43 +00:00
const { children, onOpenGroupCreateModal } = this.props
2020-02-22 23:26:23 +00:00
const tabs = [
{
title: 'Featured',
to: '/groups'
},
2020-03-05 15:44:17 +00:00
{
title: 'New',
to: '/groups/new'
},
2020-02-22 23:26:23 +00:00
{
title: 'My Groups',
to: '/groups/browse/member'
},
{ // only if is_pro
title: 'Admin',
to: '/groups/browse/admin'
},
]
return (
<DefaultLayout
title='Groups'
actions={[
{
2020-03-25 03:08:43 +00:00
icon: 'group-add',
onClick: onOpenGroupCreateModal
2020-02-22 23:26:23 +00:00
},
]}
layout={(
<Fragment>
2020-03-25 03:08:43 +00:00
<WhoToFollowPanel />
2020-02-22 23:26:23 +00:00
<GroupsPanel slim />
<LinkFooter />
</Fragment>
)}
tabs={tabs}
showBackBtn
>
{ children }
</DefaultLayout>
)
}
}