@ -9,8 +9,6 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component' ;
import AlternateEmailIcon from '@/material-icons/400-24px/alternate_email.svg?react' ;
import RepeatIcon from '@/material-icons/400-24px/repeat.svg?react' ;
import StarIcon from '@/material-icons/400-24px/star-fill.svg?react' ;
import { AnimatedNumber } from 'mastodon/components/animated_number' ;
import EditedTimestamp from 'mastodon/components/edited_timestamp' ;
import { getHashtagBarForStatus } from 'mastodon/components/hashtag_bar' ;
@ -143,10 +141,7 @@ class DetailedStatus extends ImmutablePureComponent {
let media = '' ;
let applicationLink = '' ;
let reblogLink = '' ;
const reblogIcon = 'retweet' ;
const reblogIconComponent = RepeatIcon ;
let favouriteLink = '' ;
let edited = '' ;
if ( this . props . measureHeight ) {
outerStyle . height = ` ${ this . state . height } px ` ;
@ -218,68 +213,53 @@ class DetailedStatus extends ImmutablePureComponent {
}
if ( status . get ( 'application' ) ) {
applicationLink = < > · < a className = 'detailed-status__application' href = { status . getIn ( [ 'application' , 'website' ] ) } target = '_blank' rel = 'noopener noreferrer' > { status . getIn ( [ 'application' , 'name' ] ) } < / a > < / > ;
applicationLink = < > · < a className = 'detailed-status__application' href = { status . getIn ( [ 'application' , 'website' ] ) } target = '_blank' rel = 'noopener noreferrer' > { status . getIn ( [ 'application' , 'name' ] ) } < / a > < / > ;
}
const visibilityLink = < > · < VisibilityIcon visibility = { status . get ( 'visibility' ) } / > < / > ;
const visibilityLink = < > · < VisibilityIcon visibility = { status . get ( 'visibility' ) } / > < / > ;
if ( [ 'private' , 'direct' ] . includes ( status . get ( 'visibility' ) ) ) {
reblogLink = '' ;
} else if ( this . props . history ) {
reblogLink = (
< >
{ ' · ' }
< Link to = { ` /@ ${ status . getIn ( [ 'account' , 'acct' ] ) } / ${ status . get ( 'id' ) } /reblogs ` } className = 'detailed-status__link' >
< Icon id = { reblogIcon } icon = { reblogIconComponent } / >
< span className = 'detailed-status__reblogs' >
< AnimatedNumber value = { status . get ( 'reblogs_count' ) } / >
< / span >
< / Link >
< / >
< Link to = { ` /@ ${ status . getIn ( [ 'account' , 'acct' ] ) } / ${ status . get ( 'id' ) } /reblogs ` } className = 'detailed-status__link' >
< span className = 'detailed-status__reblogs' >
< AnimatedNumber value = { status . get ( 'reblogs_count' ) } / >
< / span >
< FormattedMessage id = 'status.reblogs' defaultMessage = '{count, plural, one {boost} other {boosts}}' values = { { count : status . get ( 'reblogs_count' ) } } / >
< / Link >
) ;
} else {
reblogLink = (
< >
{ ' · ' }
< a href = { ` /interact/ ${ status . get ( 'id' ) } ?type=reblog ` } className = 'detailed-status__link' onClick = { this . handleModalLink } >
< Icon id = { reblogIcon } icon = { reblogIconComponent } / >
< span className = 'detailed-status__reblogs' >
< AnimatedNumber value = { status . get ( 'reblogs_count' ) } / >
< / span >
< / a >
< / >
< a href = { ` /interact/ ${ status . get ( 'id' ) } ?type=reblog ` } className = 'detailed-status__link' onClick = { this . handleModalLink } >
< span className = 'detailed-status__reblogs' >
< AnimatedNumber value = { status . get ( 'reblogs_count' ) } / >
< / span >
< FormattedMessage id = 'status.reblogs' defaultMessage = '{count, plural, one {boost} other {boosts}}' values = { { count : status . get ( 'reblogs_count' ) } } / >
< / a >
) ;
}
if ( this . props . history ) {
favouriteLink = (
< Link to = { ` /@ ${ status . getIn ( [ 'account' , 'acct' ] ) } / ${ status . get ( 'id' ) } /favourites ` } className = 'detailed-status__link' >
< Icon id = 'star' icon = { StarIcon } / >
< span className = 'detailed-status__favorites' >
< AnimatedNumber value = { status . get ( 'favourites_count' ) } / >
< / span >
< FormattedMessage id = 'status.favourites' defaultMessage = '{count, plural, one {favorite} other {favorites}}' values = { { count : status . get ( 'favourites_count' ) } } / >
< / Link >
) ;
} else {
favouriteLink = (
< a href = { ` /interact/ ${ status . get ( 'id' ) } ?type=favourite ` } className = 'detailed-status__link' onClick = { this . handleModalLink } >
< Icon id = 'star' icon = { StarIcon } / >
< span className = 'detailed-status__favorites' >
< AnimatedNumber value = { status . get ( 'favourites_count' ) } / >
< / span >
< FormattedMessage id = 'status.favourites' defaultMessage = '{count, plural, one {favorite} other {favorites}}' values = { { count : status . get ( 'favourites_count' ) } } / >
< / a >
) ;
}
if ( status . get ( 'edited_at' ) ) {
edited = (
< >
{ ' · ' }
< EditedTimestamp statusId = { status . get ( 'id' ) } timestamp = { status . get ( 'edited_at' ) } / >
< / >
) ;
}
const { statusContentProps , hashtagBar } = getHashtagBarForStatus ( status ) ;
const expanded = ! status . get ( 'hidden' ) || status . get ( 'spoiler_text' ) . length === 0 ;
@ -310,9 +290,23 @@ class DetailedStatus extends ImmutablePureComponent {
{ expanded && hashtagBar }
< div className = 'detailed-status__meta' >
< a className = 'detailed-status__datetime' href = { ` /@ ${ status . getIn ( [ 'account' , 'acct' ] ) } / ${ status . get ( 'id' ) } ` } target = '_blank' rel = 'noopener noreferrer' >
< FormattedDate value = { new Date ( status . get ( 'created_at' ) ) } year = 'numeric' month = 'short' day = '2-digit' hour = '2-digit' minute = '2-digit' / >
< / a > { edited } { visibilityLink } { applicationLink } { reblogLink } · { favouriteLink }
< div className = 'detailed-status__meta__line' >
< a className = 'detailed-status__datetime' href = { ` /@ ${ status . getIn ( [ 'account' , 'acct' ] ) } / ${ status . get ( 'id' ) } ` } target = '_blank' rel = 'noopener noreferrer' >
< FormattedDate value = { new Date ( status . get ( 'created_at' ) ) } year = 'numeric' month = 'short' day = '2-digit' hour = '2-digit' minute = '2-digit' / >
< / a >
{ visibilityLink }
{ applicationLink }
< / div >
{ status . get ( 'edited_at' ) && < div className = 'detailed-status__meta__line' > < EditedTimestamp statusId = { status . get ( 'id' ) } timestamp = { status . get ( 'edited_at' ) } / > < / div > }
< div className = 'detailed-status__meta__line' >
{ reblogLink }
·
{ favouriteLink }
< / div >
< / div >
< / div >
< / div >