import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import classNames from 'classnames'; import { Helmet } from 'react-helmet'; import { List as ImmutableList } from 'immutable'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { connect } from 'react-redux'; import { fetchServer, fetchExtendedDescription, fetchDomainBlocks } from 'flavours/glitch/actions/server'; import Column from 'flavours/glitch/components/column'; import { Icon } from 'flavours/glitch/components/icon'; import { ServerHeroImage } from 'flavours/glitch/components/server_hero_image'; import { Skeleton } from 'flavours/glitch/components/skeleton'; import Account from 'flavours/glitch/containers/account_container'; import LinkFooter from 'flavours/glitch/features/ui/components/link_footer'; import ChevronRightIcon from 'mastodon/../material-icons/400-24px/chevron_right.svg?react'; import ExpandMoreIcon from 'mastodon/../material-icons/400-24px/expand_more.svg?react'; const messages = defineMessages({ title: { id: 'column.about', defaultMessage: 'About' }, rules: { id: 'about.rules', defaultMessage: 'Server rules' }, blocks: { id: 'about.blocks', defaultMessage: 'Moderated servers' }, silenced: { id: 'about.domain_blocks.silenced.title', defaultMessage: 'Limited' }, silencedExplanation: { id: 'about.domain_blocks.silenced.explanation', defaultMessage: 'You will generally not see profiles and content from this server, unless you explicitly look it up or opt into it by following.' }, suspended: { id: 'about.domain_blocks.suspended.title', defaultMessage: 'Suspended' }, suspendedExplanation: { id: 'about.domain_blocks.suspended.explanation', defaultMessage: 'No data from this server will be processed, stored or exchanged, making any interaction or communication with users from this server impossible.' }, }); const severityMessages = { silence: { title: messages.silenced, explanation: messages.silencedExplanation, }, suspend: { title: messages.suspended, explanation: messages.suspendedExplanation, }, }; const mapStateToProps = state => ({ server: state.getIn(['server', 'server']), extendedDescription: state.getIn(['server', 'extendedDescription']), domainBlocks: state.getIn(['server', 'domainBlocks']), }); class Section extends PureComponent { static propTypes = { title: PropTypes.string, children: PropTypes.node, open: PropTypes.bool, onOpen: PropTypes.func, }; state = { collapsed: !this.props.open, }; handleClick = () => { const { onOpen } = this.props; const { collapsed } = this.state; this.setState({ collapsed: !collapsed }, () => onOpen && onOpen()); }; render () { const { title, children } = this.props; const { collapsed } = this.state; return (
{(block.get('comment') || '').length > 0 ? block.get('comment') :