bigbuffet-rw/app/soapbox/features/groups/timeline/components/panel.js

38 lines
1.2 KiB
JavaScript
Raw Normal View History

2020-03-27 13:59:38 -07:00
import React from 'react';
import ImmutablePureComponent from 'react-immutable-pure-component';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { injectIntl, defineMessages } from 'react-intl';
2020-05-28 15:52:07 -07:00
import Icon from 'soapbox/components/icon';
2020-03-27 13:59:38 -07:00
const messages = defineMessages({
2020-04-14 11:44:40 -07:00
group_archived: { id: 'group.detail.archived_group', defaultMessage: 'Archived group' },
group_admin: { id: 'groups.detail.role_admin', defaultMessage: 'You\'re an admin' },
2020-03-27 13:59:38 -07:00
});
export default @injectIntl
class GroupPanel extends ImmutablePureComponent {
2020-04-14 11:44:40 -07:00
2020-03-27 13:59:38 -07:00
static propTypes = {
2020-04-14 11:44:40 -07:00
group: ImmutablePropTypes.map,
relationships: ImmutablePropTypes.map,
2020-03-27 13:59:38 -07:00
}
render() {
2020-04-14 11:44:40 -07:00
const { group, relationships, intl } = this.props;
2020-03-27 13:59:38 -07:00
2020-04-14 11:44:40 -07:00
return (
<div className='group__panel'>
<h1 className='group__panel__title'>
{group.get('title')}
{group.get('archived') && <Icon id='lock' title={intl.formatMessage(messages.group_archived)} />}
</h1>
2020-03-27 13:59:38 -07:00
2020-04-14 11:44:40 -07:00
{relationships.get('admin') && <span className='group__panel__label'>{intl.formatMessage(messages.group_admin)}</span>}
2020-03-27 13:59:38 -07:00
2020-04-14 11:44:40 -07:00
<div className='group__panel__description'>{group.get('description')}</div>
</div>
);
2020-03-27 13:59:38 -07:00
}
2020-04-14 11:44:40 -07:00
2020-03-27 13:59:38 -07:00
}