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.

41 lines
1.5 KiB

  1. import PureRenderMixin from 'react-addons-pure-render-mixin';
  2. import ImmutablePropTypes from 'react-immutable-proptypes';
  3. const Header = React.createClass({
  4. propTypes: {
  5. account: ImmutablePropTypes.map.isRequired
  6. },
  7. mixins: [PureRenderMixin],
  8. render () {
  9. const { account } = this.props;
  10. let displayName = account.get('display_name');
  11. if (displayName.length === 0) {
  12. displayName = account.get('username');
  13. }
  14. return (
  15. <div style={{ flex: '0 0 auto', background: '#2f3441', textAlign: 'center', backgroundImage: `url(${account.get('header')})`, backgroundSize: 'cover' }}>
  16. <div style={{ background: 'rgba(47, 52, 65, 0.8)', padding: '30px 10px' }}>
  17. <a href={account.get('url')} target='_blank' rel='noopener' style={{ display: 'block', color: 'inherit', textDecoration: 'none' }}>
  18. <div style={{ width: '90px', margin: '0 auto', marginBottom: '15px' }}>
  19. <img src={account.get('avatar')} alt='' style={{ display: 'block', width: '90px', height: '90px', borderRadius: '90px' }} />
  20. </div>
  21. <span style={{ color: '#fff', fontSize: '20px', lineHeight: '27px', fontWeight: '500', display: 'block' }}>{displayName}</span>
  22. </a>
  23. <span style={{ fontSize: '14px', fontWeight: '400', display: 'block', color: '#2b90d9', marginBottom: '15px' }}>@{account.get('acct')}</span>
  24. <p style={{ color: '#616b86', fontSize: '14px' }}>{account.get('note')}</p>
  25. </div>
  26. </div>
  27. );
  28. }
  29. });
  30. export default Header;