You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.5 KiB
48 lines
1.5 KiB
4 years ago
|
import React from 'react';
|
||
|
import { connect } from 'react-redux';
|
||
|
import ImmutablePureComponent from 'react-immutable-pure-component';
|
||
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||
|
import PropTypes from 'prop-types';
|
||
|
import IconButton from 'mastodon/components/icon_button';
|
||
|
import { Link } from 'react-router-dom';
|
||
|
import Avatar from 'mastodon/components/avatar';
|
||
|
import DisplayName from 'mastodon/components/display_name';
|
||
4 years ago
|
import { defineMessages, injectIntl } from 'react-intl';
|
||
|
|
||
|
const messages = defineMessages({
|
||
|
close: { id: 'lightbox.close', defaultMessage: 'Close' },
|
||
|
});
|
||
4 years ago
|
|
||
|
const mapStateToProps = (state, { accountId }) => ({
|
||
|
account: state.getIn(['accounts', accountId]),
|
||
|
});
|
||
|
|
||
|
export default @connect(mapStateToProps)
|
||
4 years ago
|
@injectIntl
|
||
4 years ago
|
class Header extends ImmutablePureComponent {
|
||
|
|
||
|
static propTypes = {
|
||
|
accountId: PropTypes.string.isRequired,
|
||
|
statusId: PropTypes.string.isRequired,
|
||
|
account: ImmutablePropTypes.map.isRequired,
|
||
|
onClose: PropTypes.func.isRequired,
|
||
4 years ago
|
intl: PropTypes.object.isRequired,
|
||
4 years ago
|
};
|
||
|
|
||
|
render () {
|
||
4 years ago
|
const { account, statusId, onClose, intl } = this.props;
|
||
4 years ago
|
|
||
|
return (
|
||
|
<div className='picture-in-picture__header'>
|
||
3 years ago
|
<Link to={`/@${account.get('acct')}/${statusId}`} className='picture-in-picture__header__account'>
|
||
4 years ago
|
<Avatar account={account} size={36} />
|
||
|
<DisplayName account={account} />
|
||
|
</Link>
|
||
|
|
||
4 years ago
|
<IconButton icon='times' onClick={onClose} title={intl.formatMessage(messages.close)} />
|
||
4 years ago
|
</div>
|
||
|
);
|
||
|
}
|
||
|
|
||
|
}
|