gab-social/app/javascript/gabsocial/pages/list_page.js
mgabdev f4512b4411 Added/removed some functionality to better handle requests/load
- Removed status counting in dashboard for admins
- Added limit to notifications to only 7 days ago
- Removed ability for non-logged in users to view group, group-collection timelines
- Limited account realtime search on compose, list, chat actions
- Removed fetching of user suggestions
- Removed fetching of shortcuts
- Removed featured groups, user suggestions timeline injections
- Removed group featured panel from explore layout for non logged in users
- Removed media gallery panel from profile layout
- Removed lists, suggestions, groups panel from home page
- Removed user suggestions to list page
- Updated pro_timelie in status.rb to find only from 1 hour ago
- Updated home timeline to not include groups and to find only latest from 5 days ago
- Removed search for non logged in users
2021-01-08 21:46:03 -05:00

83 lines
2.1 KiB
JavaScript

import React from 'react'
import PropTypes from 'prop-types'
import { connect } from 'react-redux'
import ImmutablePropTypes from 'react-immutable-proptypes'
import ImmutablePureComponent from 'react-immutable-pure-component'
import { defineMessages, injectIntl } from 'react-intl'
import { openModal } from '../actions/modal'
import {
MODAL_LIST_EDITOR,
} from '../constants'
import PageTitle from '../features/ui/util/page_title'
import DefaultLayout from '../layouts/default_layout'
import WrappedBundle from '../features/ui/util/wrapped_bundle'
import {
ListDetailsPanel,
LinkFooter,
TrendsBreakingPanel,
UserSuggestionsPanel,
} from '../features/ui/util/async_components'
class ListPage extends ImmutablePureComponent {
onOpenListEditModal = () => {
const { list } = this.props
if (!list) return
this.props.dispatch(openModal(MODAL_LIST_EDITOR, {
id: list.get('id'),
}))
}
render() {
const {
children,
intl,
list,
} = this.props
const listTitle = !!list ? list.get('title') : ''
const title = intl.formatMessage(messages.list)
return (
<DefaultLayout
showBackBtn
title={title}
page='list'
actions={[
{
icon: 'cog',
onClick: this.onOpenListEditModal,
},
]}
layout={[
<WrappedBundle component={ListDetailsPanel} componentParams={{ list: list, onEdit: this.handleOnOpenListEditModal }} />,
TrendsBreakingPanel,
// UserSuggestionsPanel,
LinkFooter,
]}
>
<PageTitle path={[listTitle, title]} />
{ children }
</DefaultLayout>
)
}
}
const messages = defineMessages({
list: { id: 'list', defaultMessage: 'List' },
})
const mapStateToProps = (state, props) => ({
list: state.getIn(['lists', props.params.id]),
})
ListPage.propTypes = {
children: PropTypes.node.isRequired,
dispatch: PropTypes.func.isRequired,
intl: PropTypes.object.isRequired,
list: ImmutablePropTypes.map,
}
export default injectIntl(connect(mapStateToProps)(ListPage))