@ -24,16 +24,6 @@ const mapStateToProps = state => ({
isSearching : state . getIn ( [ 'search' , 'submitted' ] ) || ! showTrends ,
} ) ;
// Fix strange bug on Safari where <span> (rendered by FormattedMessage) disappears
// after clicking around Explore top bar (issue #20885).
// Removing width=100% from <a> also fixes it, as well as replacing <span> with <div>
// We're choosing to wrap span with div to keep the changes local only to this tool bar.
const WrapFormattedMessage = ( { children , ... props } ) => < div > < FormattedMessage { ... props } > { children } < / F o r m a t t e d M e s s a g e > < / d i v > ;
WrapFormattedMessage . propTypes = {
children : PropTypes . any ,
} ;
export default @ connect ( mapStateToProps )
@ injectIntl
class Explore extends React . PureComponent {
@ -78,12 +68,22 @@ class Explore extends React.PureComponent {
{ isSearching ? (
< SearchResults / >
) : (
< React . Fragment >
< >
< div className = 'account__section-headline' >
< NavLink exact to = '/explore' > < WrapFormattedMessage id = 'explore.trending_statuses' defaultMessage = 'Posts' / > < / N a v L i n k >
< NavLink exact to = '/explore/tags' > < WrapFormattedMessage id = 'explore.trending_tags' defaultMessage = 'Hashtags' / > < / N a v L i n k >
< NavLink exact to = '/explore/links' > < WrapFormattedMessage id = 'explore.trending_links' defaultMessage = 'News' / > < / N a v L i n k >
{ signedIn && < NavLink exact to = '/explore/suggestions' > < WrapFormattedMessage id = 'explore.suggested_follows' defaultMessage = 'For you' / > < / N a v L i n k > }
< NavLink exact to = '/explore' >
< FormattedMessage tagName = 'div' id = 'explore.trending_statuses' defaultMessage = 'Posts' / >
< / N a v L i n k >
< NavLink exact to = '/explore/tags' >
< FormattedMessage tagName = 'div' id = 'explore.trending_tags' defaultMessage = 'Hashtags' / >
< / N a v L i n k >
< NavLink exact to = '/explore/links' >
< FormattedMessage tagName = 'div' id = 'explore.trending_links' defaultMessage = 'News' / >
< / N a v L i n k >
{ signedIn && (
< NavLink exact to = '/explore/suggestions' >
< FormattedMessage tagName = 'div' id = 'explore.suggested_follows' defaultMessage = 'For you' / >
< / N a v L i n k >
) }
< / d i v >
< Switch >
@ -97,7 +97,7 @@ class Explore extends React.PureComponent {
< title > { intl . formatMessage ( messages . title ) } < / t i t l e >
< meta name = 'robots' content = { isSearching ? 'noindex' : 'all' } / >
< / H e l m e t >
< / Re a c t . F r a g m e n t >
< / >
) }
< / d i v >
< / C o l u m n >