]>
cat aescling's git repositories - mastodon.git/blob - app/javascript/themes/glitch/components/status_prepend.js
2 import React
from 'react';
3 import PropTypes
from 'prop-types';
4 import ImmutablePropTypes
from 'react-immutable-proptypes';
5 import { FormattedMessage
} from 'react-intl';
7 export default class StatusPrepend
extends React
.PureComponent
{
10 type: PropTypes
.string
.isRequired
,
11 account: ImmutablePropTypes
.map
.isRequired
,
12 parseClick: PropTypes
.func
.isRequired
,
13 notificationId: PropTypes
.number
,
16 handleClick
= (e
) => {
17 const { account
, parseClick
} = this.props
;
18 parseClick(e
, `/accounts/${+account.get('id')}`);
22 const { type
, account
} = this.props
;
25 onClick
={this.handleClick
}
26 href
={account
.get('url')}
27 className
='status__display-name'
30 dangerouslySetInnerHTML
={{
31 __html : account
.get('display_name_html') || account
.get('username'),
40 id
='status.reblogged_by'
41 defaultMessage
='{name} boosted'
42 values
={{ name : link
}}
48 id
='notification.favourite'
49 defaultMessage
='{name} favourited your status'
50 values
={{ name : link
}}
56 id
='notification.reblog'
57 defaultMessage
='{name} boosted your status'
58 values
={{ name : link
}}
66 const { Message
} = this;
67 const { type
} = this.props
;
69 return !type
? null : (
70 <aside className
={type
=== 'reblogged_by' ? 'status__prepend' : 'notification__message'}>
71 <div className
={type
=== 'reblogged_by' ? 'status__prepend-icon-wrapper' : 'notification__favourite-icon-wrapper'}>
73 className
={`fa fa-fw fa-${
74 type === 'favourite' ? 'star star-icon' : 'retweet'
75 } status__prepend-icon`}
This page took 0.080851 seconds and 4 git commands to generate.