From 58200132d07bc0b641c95af614b9ac02ce48c9fc Mon Sep 17 00:00:00 2001 From: Yamagishi Kazutoshi Date: Fri, 16 Dec 2022 00:20:46 +0900 Subject: [PATCH] `FormattedMessage` must be used directly (#20982) * `FormattedMessage` must be used directly * rollback --- .../mastodon/features/explore/index.js | 32 +++++++++---------- .../mastodon/locales/defaultMessages.json | 16 ++++++++++ app/javascript/mastodon/locales/en.json | 4 +++ 3 files changed, 36 insertions(+), 16 deletions(-) diff --git a/app/javascript/mastodon/features/explore/index.js b/app/javascript/mastodon/features/explore/index.js index 286170c9f..1ae249f45 100644 --- a/app/javascript/mastodon/features/explore/index.js +++ b/app/javascript/mastodon/features/explore/index.js @@ -24,16 +24,6 @@ const mapStateToProps = state => ({ isSearching: state.getIn(['search', 'submitted']) || !showTrends, }); -// Fix strange bug on Safari where (rendered by FormattedMessage) disappears -// after clicking around Explore top bar (issue #20885). -// Removing width=100% from also fixes it, as well as replacing with
-// We're choosing to wrap span with div to keep the changes local only to this tool bar. -const WrapFormattedMessage = ({ children, ...props }) =>
{children}
; -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 ? ( ) : ( - + <>
- - - - {signedIn && } + + + + + + + + + + {signedIn && ( + + + + )}
@@ -97,7 +97,7 @@ class Explore extends React.PureComponent { {intl.formatMessage(messages.title)} -
+ )}
diff --git a/app/javascript/mastodon/locales/defaultMessages.json b/app/javascript/mastodon/locales/defaultMessages.json index 445ab3894..230154eb1 100644 --- a/app/javascript/mastodon/locales/defaultMessages.json +++ b/app/javascript/mastodon/locales/defaultMessages.json @@ -2014,6 +2014,22 @@ { "defaultMessage": "Search results", "id": "explore.search_results" + }, + { + "defaultMessage": "Posts", + "id": "explore.trending_statuses" + }, + { + "defaultMessage": "Hashtags", + "id": "explore.trending_tags" + }, + { + "defaultMessage": "News", + "id": "explore.trending_links" + }, + { + "defaultMessage": "For you", + "id": "explore.suggested_follows" } ], "path": "app/javascript/mastodon/features/explore/index.json" diff --git a/app/javascript/mastodon/locales/en.json b/app/javascript/mastodon/locales/en.json index dc165e74c..05b9353bf 100644 --- a/app/javascript/mastodon/locales/en.json +++ b/app/javascript/mastodon/locales/en.json @@ -235,7 +235,11 @@ "errors.unexpected_crash.copy_stacktrace": "Copy stacktrace to clipboard", "errors.unexpected_crash.report_issue": "Report issue", "explore.search_results": "Search results", + "explore.suggested_follows": "For you", "explore.title": "Explore", + "explore.trending_links": "News", + "explore.trending_statuses": "Posts", + "explore.trending_tags": "Hashtags", "filter_modal.added.context_mismatch_explanation": "This filter category does not apply to the context in which you have accessed this post. If you want the post to be filtered in this context too, you will have to edit the filter.", "filter_modal.added.context_mismatch_title": "Context mismatch!", "filter_modal.added.expired_explanation": "This filter category has expired, you will need to change the expiration date for it to apply.",