forked from mastodon/mastodon
-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7236d1a
commit a338368
Showing
3 changed files
with
37 additions
and
2 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
app/javascript/flavours/glitch/components/mentions_placeholder.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import ImmutablePropTypes from 'react-immutable-proptypes'; | ||
|
||
import { Permalink } from 'flavours/glitch/components/permalink'; | ||
|
||
export const MentionsPlaceholder = ({ status }) => { | ||
if (status.get('spoiler_text').length === 0 || !status.get('mentions')) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<div className='status__content'> | ||
{status.get('mentions').map(item => ( | ||
<Permalink | ||
to={`/@${item.get('acct')}`} | ||
href={item.get('url')} | ||
key={item.get('id')} | ||
className='mention' | ||
> | ||
@<span>{item.get('username')}</span> | ||
</Permalink> | ||
)).reduce((aggregate, item) => [...aggregate, item, ' '], [])} | ||
</div> | ||
); | ||
}; | ||
|
||
MentionsPlaceholder.propTypes = { | ||
status: ImmutablePropTypes.map.isRequired, | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters