diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2023-10-27 04:47:04 +0200 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2023-10-28 20:01:42 +0200 |
commit | 61b9fbd7d2a8f6c6447b3a586397d33e5070c6c7 (patch) | |
tree | ffa0df28e8e1ad998d370a9d9f6600c31ec3f0ec | |
parent | eae5c7334ae61c463edd2e3cd03115b897f6e92b (diff) |
Change favourites to likesfeature-like
11 files changed, 63 insertions, 124 deletions
diff --git a/app/javascript/mastodon/components/status_action_bar.jsx b/app/javascript/mastodon/components/status_action_bar.jsx index 24017473903..ce44162c598 100644 --- a/app/javascript/mastodon/components/status_action_bar.jsx +++ b/app/javascript/mastodon/components/status_action_bar.jsx @@ -2,7 +2,6 @@ import PropTypes from 'prop-types'; import { defineMessages, injectIntl } from 'react-intl'; -import classNames from 'classnames'; import { withRouter } from 'react-router-dom'; import ImmutablePropTypes from 'react-immutable-proptypes'; @@ -11,12 +10,12 @@ import { connect } from 'react-redux'; import { ReactComponent as BookmarkIcon } from '@material-symbols/svg-600/outlined/bookmark-fill.svg'; import { ReactComponent as BookmarkBorderIcon } from '@material-symbols/svg-600/outlined/bookmark.svg'; +import { ReactComponent as FavoriteActiveIcon } from '@material-symbols/svg-600/outlined/favorite-fill.svg'; +import { ReactComponent as FavoriteIcon } from '@material-symbols/svg-600/outlined/favorite.svg'; import { ReactComponent as MoreHorizIcon } from '@material-symbols/svg-600/outlined/more_horiz.svg'; import { ReactComponent as RepeatIcon } from '@material-symbols/svg-600/outlined/repeat.svg'; import { ReactComponent as ReplyIcon } from '@material-symbols/svg-600/outlined/reply.svg'; import { ReactComponent as ReplyAllIcon } from '@material-symbols/svg-600/outlined/reply_all.svg'; -import { ReactComponent as StarIcon } from '@material-symbols/svg-600/outlined/star-fill.svg'; -import { ReactComponent as StarBorderIcon } from '@material-symbols/svg-600/outlined/star.svg'; import { ReactComponent as VisibilityIcon } from '@material-symbols/svg-600/outlined/visibility.svg'; import { PERMISSION_MANAGE_USERS, PERMISSION_MANAGE_FEDERATION } from 'mastodon/permissions'; @@ -44,6 +43,7 @@ const messages = defineMessages({ cancel_reblog_private: { id: 'status.cancel_reblog_private', defaultMessage: 'Unboost' }, cannot_reblog: { id: 'status.cannot_reblog', defaultMessage: 'This post cannot be boosted' }, favourite: { id: 'status.favourite', defaultMessage: 'Favorite' }, + removeFavourite: { id: 'status.unfavourite', defaultMessage: 'Remove like' }, bookmark: { id: 'status.bookmark', defaultMessage: 'Bookmark' }, removeBookmark: { id: 'status.remove_bookmark', defaultMessage: 'Remove bookmark' }, open: { id: 'status.open', defaultMessage: 'Expand this status' }, @@ -275,11 +275,8 @@ class StatusActionBar extends ImmutablePureComponent { } if (signedIn) { - menu.push(null); - - menu.push({ text: intl.formatMessage(status.get('bookmarked') ? messages.removeBookmark : messages.bookmark), action: this.handleBookmarkClick }); - if (writtenByMe && pinnableStatus) { + menu.push(null); menu.push({ text: intl.formatMessage(status.get('pinned') ? messages.unpin : messages.pin), action: this.handlePinClick }); } @@ -380,9 +377,9 @@ class StatusActionBar extends ImmutablePureComponent { return ( <div className='status__action-bar'> <IconButton className='status__action-bar__button' title={replyTitle} icon={isReply ? 'reply' : replyIcon} iconComponent={isReply ? ReplyIcon : replyIconComponent} onClick={this.handleReplyClick} counter={status.get('replies_count')} /> - <IconButton className={classNames('status__action-bar__button', { reblogPrivate })} disabled={!publicStatus && !reblogPrivate} active={status.get('reblogged')} title={reblogTitle} icon='retweet' iconComponent={RepeatIcon} onClick={this.handleReblogClick} counter={withCounters ? status.get('reblogs_count') : undefined} /> - <IconButton className='status__action-bar__button star-icon' animate active={status.get('favourited')} title={intl.formatMessage(messages.favourite)} icon='star' iconComponent={status.get('favourited') ? StarIcon : StarBorderIcon} onClick={this.handleFavouriteClick} counter={withCounters ? status.get('favourites_count') : undefined} /> - <IconButton className='status__action-bar__button bookmark-icon' disabled={!signedIn} active={status.get('bookmarked')} title={intl.formatMessage(messages.bookmark)} icon='bookmark' iconComponent={status.get('bookmarked') ? BookmarkIcon : BookmarkBorderIcon} onClick={this.handleBookmarkClick} /> + <IconButton className='status__action-bar__button' disabled={!publicStatus && !reblogPrivate} active={status.get('reblogged')} title={reblogTitle} icon='retweet' iconComponent={RepeatIcon} onClick={this.handleReblogClick} counter={withCounters ? status.get('reblogs_count') : undefined} /> + <IconButton className='status__action-bar__button star-icon' active={status.get('favourited')} title={intl.formatMessage(status.get('favourited') ? messages.removeFavourite : messages.favourite)} icon='star' iconComponent={status.get('favourited') ? FavoriteActiveIcon : FavoriteIcon} onClick={this.handleFavouriteClick} counter={withCounters ? status.get('favourites_count') : undefined} /> + <IconButton className='status__action-bar__button bookmark-icon' disabled={!signedIn} active={status.get('bookmarked')} title={intl.formatMessage(status.get('bookmarked') ? messages.removeBookmark : messages.bookmark)} icon='bookmark' iconComponent={status.get('bookmarked') ? BookmarkIcon : BookmarkBorderIcon} onClick={this.handleBookmarkClick} /> {filterButton} diff --git a/app/javascript/mastodon/features/favourited_statuses/index.jsx b/app/javascript/mastodon/features/favourited_statuses/index.jsx index d3c3cc9f091..36d8f610844 100644 --- a/app/javascript/mastodon/features/favourited_statuses/index.jsx +++ b/app/javascript/mastodon/features/favourited_statuses/index.jsx @@ -8,7 +8,7 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { connect } from 'react-redux'; -import { ReactComponent as StarIcon } from '@material-symbols/svg-600/outlined/star-fill.svg'; +import { ReactComponent as FavoriteIcon } from '@material-symbols/svg-600/outlined/favorite-fill.svg'; import { debounce } from 'lodash'; import { addColumn, removeColumn, moveColumn } from 'mastodon/actions/columns'; @@ -81,7 +81,7 @@ class Favourites extends ImmutablePureComponent { <Column bindToDocument={!multiColumn} ref={this.setRef} label={intl.formatMessage(messages.heading)}> <ColumnHeader icon='star' - iconComponent={StarIcon} + iconComponent={FavoriteIcon} title={intl.formatMessage(messages.heading)} onPin={this.handlePin} onMove={this.handleMove} diff --git a/app/javascript/mastodon/features/notifications/components/notification.jsx b/app/javascript/mastodon/features/notifications/components/notification.jsx index ad7308b26fc..b33fc8567a8 100644 --- a/app/javascript/mastodon/features/notifications/components/notification.jsx +++ b/app/javascript/mastodon/features/notifications/components/notification.jsx @@ -9,13 +9,13 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { ReactComponent as EditIcon } from '@material-symbols/svg-600/outlined/edit.svg'; +import { ReactComponent as FavoriteIcon } from '@material-symbols/svg-600/outlined/favorite-fill.svg'; import { ReactComponent as FlagIcon } from '@material-symbols/svg-600/outlined/flag-fill.svg'; import { ReactComponent as HomeIcon } from '@material-symbols/svg-600/outlined/home-fill.svg'; import { ReactComponent as InsertChartIcon } from '@material-symbols/svg-600/outlined/insert_chart.svg'; import { ReactComponent as PersonIcon } from '@material-symbols/svg-600/outlined/person-fill.svg'; import { ReactComponent as PersonAddIcon } from '@material-symbols/svg-600/outlined/person_add-fill.svg'; import { ReactComponent as RepeatIcon } from '@material-symbols/svg-600/outlined/repeat.svg'; -import { ReactComponent as StarIcon } from '@material-symbols/svg-600/outlined/star-fill.svg'; import { HotKeys } from 'react-hotkeys'; import { Icon } from 'mastodon/components/icon'; @@ -194,7 +194,7 @@ class Notification extends ImmutablePureComponent { <HotKeys handlers={this.getHandlers()}> <div className={classNames('notification notification-favourite focusable', { unread })} tabIndex={0} aria-label={notificationForScreenReader(intl, intl.formatMessage(messages.favourite, { name: notification.getIn(['account', 'acct']) }), notification.get('created_at'))}> <div className='notification__message'> - <Icon id='star' icon={StarIcon} className='star-icon' /> + <Icon id='star' icon={FavoriteIcon} className='star-icon' /> <span title={notification.get('created_at')}> <FormattedMessage id='notification.favourite' defaultMessage='{name} favorited your status' values={{ name: link }} /> diff --git a/app/javascript/mastodon/features/status/components/action_bar.jsx b/app/javascript/mastodon/features/status/components/action_bar.jsx index eac0bab7e18..a72432d9b72 100644 --- a/app/javascript/mastodon/features/status/components/action_bar.jsx +++ b/app/javascript/mastodon/features/status/components/action_bar.jsx @@ -3,7 +3,6 @@ import { PureComponent } from 'react'; import { defineMessages, injectIntl } from 'react-intl'; -import classNames from 'classnames'; import { withRouter } from 'react-router-dom'; import ImmutablePropTypes from 'react-immutable-proptypes'; @@ -11,12 +10,12 @@ import { connect } from 'react-redux'; import { ReactComponent as BookmarkIcon } from '@material-symbols/svg-600/outlined/bookmark-fill.svg'; import { ReactComponent as BookmarkBorderIcon } from '@material-symbols/svg-600/outlined/bookmark.svg'; +import { ReactComponent as FavoriteActiveIcon } from '@material-symbols/svg-600/outlined/favorite-fill.svg'; +import { ReactComponent as FavoriteIcon } from '@material-symbols/svg-600/outlined/favorite.svg'; import { ReactComponent as MoreHorizIcon } from '@material-symbols/svg-600/outlined/more_horiz.svg'; import { ReactComponent as RepeatIcon } from '@material-symbols/svg-600/outlined/repeat.svg'; import { ReactComponent as ReplyIcon } from '@material-symbols/svg-600/outlined/reply.svg'; import { ReactComponent as ReplyAllIcon } from '@material-symbols/svg-600/outlined/reply_all.svg'; -import { ReactComponent as StarIcon } from '@material-symbols/svg-600/outlined/star-fill.svg'; -import { ReactComponent as StarBorderIcon } from '@material-symbols/svg-600/outlined/star.svg'; import { PERMISSION_MANAGE_USERS, PERMISSION_MANAGE_FEDERATION } from 'mastodon/permissions'; import { WithRouterPropTypes } from 'mastodon/utils/react_router'; @@ -36,8 +35,10 @@ const messages = defineMessages({ reblog_private: { id: 'status.reblog_private', defaultMessage: 'Boost with original visibility' }, cancel_reblog_private: { id: 'status.cancel_reblog_private', defaultMessage: 'Unboost' }, cannot_reblog: { id: 'status.cannot_reblog', defaultMessage: 'This post cannot be boosted' }, - favourite: { id: 'status.favourite', defaultMessage: 'Favorite' }, + favourite: { id: 'status.like', defaultMessage: 'Like' }, + removeFavourite: { id: 'status.remove_like', defaultMessage: 'Remove like' }, bookmark: { id: 'status.bookmark', defaultMessage: 'Bookmark' }, + removeBookmark: { id: 'status.remove_bookmark', defaultMessage: 'Remove bookmark' }, more: { id: 'status.more', defaultMessage: 'More' }, mute: { id: 'status.mute', defaultMessage: 'Mute @{name}' }, muteConversation: { id: 'status.mute_conversation', defaultMessage: 'Mute conversation' }, @@ -304,9 +305,9 @@ class ActionBar extends PureComponent { return ( <div className='detailed-status__action-bar'> <div className='detailed-status__button'><IconButton title={intl.formatMessage(messages.reply)} icon={status.get('in_reply_to_account_id') === status.getIn(['account', 'id']) ? 'reply' : replyIcon} iconComponent={status.get('in_reply_to_account_id') === status.getIn(['account', 'id']) ? ReplyIcon : replyIconComponent} onClick={this.handleReplyClick} /></div> - <div className='detailed-status__button'><IconButton className={classNames({ reblogPrivate })} disabled={!publicStatus && !reblogPrivate} active={status.get('reblogged')} title={reblogTitle} icon='retweet' iconComponent={RepeatIcon} onClick={this.handleReblogClick} /></div> - <div className='detailed-status__button'><IconButton className='star-icon' animate active={status.get('favourited')} title={intl.formatMessage(messages.favourite)} icon='star' iconComponent={status.get('favourited') ? StarIcon : StarBorderIcon} onClick={this.handleFavouriteClick} /></div> - <div className='detailed-status__button'><IconButton className='bookmark-icon' disabled={!signedIn} active={status.get('bookmarked')} title={intl.formatMessage(messages.bookmark)} icon='bookmark' iconComponent={status.get('bookmarked') ? BookmarkIcon : BookmarkBorderIcon} onClick={this.handleBookmarkClick} /></div> + <div className='detailed-status__button'><IconButton disabled={!publicStatus && !reblogPrivate} active={status.get('reblogged')} title={reblogTitle} icon='retweet' iconComponent={RepeatIcon} onClick={this.handleReblogClick} /></div> + <div className='detailed-status__button'><IconButton className='star-icon animated' active={status.get('favourited')} title={intl.formatMessage(status.get('favourited') ? messages.removeFavourite : messages.favourite)} icon='star' iconComponent={status.get('favourited') ? FavoriteActiveIcon : FavoriteIcon} onClick={this.handleFavouriteClick} /></div> + <div className='detailed-status__button'><IconButton className='bookmark-icon animated' disabled={!signedIn} active={status.get('bookmarked')} title={intl.formatMessage(status.get('bookmarked') ? messages.removeBookmark : messages.bookmark)} icon='bookmark' iconComponent={status.get('bookmarked') ? BookmarkIcon : BookmarkBorderIcon} onClick={this.handleBookmarkClick} /></div> <div className='detailed-status__action-bar-dropdown'> <DropdownMenuContainer icon='ellipsis-h' iconComponent={MoreHorizIcon} status={status} items={menu} direction='left' title={intl.formatMessage(messages.more)} /> diff --git a/app/javascript/mastodon/features/status/components/detailed_status.jsx b/app/javascript/mastodon/features/status/components/detailed_status.jsx index d8d9559127d..c1dd95492e5 100644 --- a/app/javascript/mastodon/features/status/components/detailed_status.jsx +++ b/app/javascript/mastodon/features/status/components/detailed_status.jsx @@ -9,8 +9,8 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { ReactComponent as AlternateEmailIcon } from '@material-symbols/svg-600/outlined/alternate_email.svg'; +import { ReactComponent as FavoriteIcon } from '@material-symbols/svg-600/outlined/favorite-fill.svg'; import { ReactComponent as RepeatIcon } from '@material-symbols/svg-600/outlined/repeat.svg'; -import { ReactComponent as StarIcon } from '@material-symbols/svg-600/outlined/star-fill.svg'; import { AnimatedNumber } from 'mastodon/components/animated_number'; import EditedTimestamp from 'mastodon/components/edited_timestamp'; @@ -255,7 +255,7 @@ class DetailedStatus extends ImmutablePureComponent { if (this.props.history) { favouriteLink = ( <Link to={`/@${status.getIn(['account', 'acct'])}/${status.get('id')}/favourites`} className='detailed-status__link'> - <Icon id='star' icon={StarIcon} /> + <Icon id='star' icon={FavoriteIcon} /> <span className='detailed-status__favorites'> <AnimatedNumber value={status.get('favourites_count')} /> </span> @@ -264,7 +264,7 @@ class DetailedStatus extends ImmutablePureComponent { } else { favouriteLink = ( <a href={`/interact/${status.get('id')}?type=favourite`} className='detailed-status__link' onClick={this.handleModalLink}> - <Icon id='star' icon={StarIcon} /> + <Icon id='star' icon={FavoriteIcon} /> <span className='detailed-status__favorites'> <AnimatedNumber value={status.get('favourites_count')} /> </span> diff --git a/app/javascript/mastodon/features/ui/components/navigation_panel.jsx b/app/javascript/mastodon/features/ui/components/navigation_panel.jsx index 4b0e03a0fd8..706ae59fd41 100644 --- a/app/javascript/mastodon/features/ui/components/navigation_panel.jsx +++ b/app/javascript/mastodon/features/ui/components/navigation_panel.jsx @@ -7,13 +7,13 @@ import { Link } from 'react-router-dom'; import { ReactComponent as AlternateEmailIcon } from '@material-symbols/svg-600/outlined/alternate_email.svg'; import { ReactComponent as BookmarksIcon } from '@material-symbols/svg-600/outlined/bookmarks-fill.svg'; +import { ReactComponent as FavoriteIcon } from '@material-symbols/svg-600/outlined/favorite-fill.svg'; import { ReactComponent as HomeIcon } from '@material-symbols/svg-600/outlined/home-fill.svg'; import { ReactComponent as ListAltIcon } from '@material-symbols/svg-600/outlined/list_alt.svg'; import { ReactComponent as MoreHorizIcon } from '@material-symbols/svg-600/outlined/more_horiz.svg'; import { ReactComponent as PublicIcon } from '@material-symbols/svg-600/outlined/public.svg'; import { ReactComponent as SearchIcon } from '@material-symbols/svg-600/outlined/search.svg'; import { ReactComponent as SettingsIcon } from '@material-symbols/svg-600/outlined/settings-fill.svg'; -import { ReactComponent as StarIcon } from '@material-symbols/svg-600/outlined/star-fill.svg'; import { ReactComponent as TagIcon } from '@material-symbols/svg-600/outlined/tag.svg'; import { WordmarkLogo } from 'mastodon/components/logo'; @@ -115,8 +115,8 @@ class NavigationPanel extends Component { {signedIn && ( <> <ColumnLink transparent to='/conversations' icon='at' iconComponent={AlternateEmailIcon} text={intl.formatMessage(messages.direct)} /> + <ColumnLink transparent to='/favourites' icon='star' iconComponent={FavoriteIcon} text={intl.formatMessage(messages.favourites)} /> <ColumnLink transparent to='/bookmarks' icon='bookmarks' iconComponent={BookmarksIcon} text={intl.formatMessage(messages.bookmarks)} /> - <ColumnLink transparent to='/favourites' icon='star' iconComponent={StarIcon} text={intl.formatMessage(messages.favourites)} /> <ColumnLink transparent to='/lists' icon='list-ul' iconComponent={ListAltIcon} text={intl.formatMessage(messages.lists)} /> <ListPanel /> diff --git a/app/javascript/mastodon/locales/en.json b/app/javascript/mastodon/locales/en.json index 4399b999513..f035a41414e 100644 --- a/app/javascript/mastodon/locales/en.json +++ b/app/javascript/mastodon/locales/en.json @@ -113,7 +113,7 @@ "column.direct": "Private mentions", "column.directory": "Browse profiles", "column.domain_blocks": "Blocked domains", - "column.favourites": "Favorites", + "column.favourites": "Liked posts", "column.firehose": "Live feeds", "column.follow_requests": "Follow requests", "column.home": "Home", @@ -231,8 +231,8 @@ "empty_column.direct": "You don't have any private mentions yet. When you send or receive one, it will show up here.", "empty_column.domain_blocks": "There are no blocked domains yet.", "empty_column.explore_statuses": "Nothing is trending right now. Check back later!", - "empty_column.favourited_statuses": "You don't have any favorite posts yet. When you favorite one, it will show up here.", - "empty_column.favourites": "No one has favorited this post yet. When someone does, they will show up here.", + "empty_column.favourited_statuses": "You haven't liked any posts yet. When you like one, it will show up here.", + "empty_column.favourites": "No one has liked this post yet. When someone does, they will show up here.", "empty_column.follow_requests": "You don't have any follow requests yet. When you receive one, it will show up here.", "empty_column.followed_tags": "You have not followed any hashtags yet. When you do, they will show up here.", "empty_column.hashtag": "There is nothing in this hashtag yet.", @@ -314,7 +314,7 @@ "home.pending_critical_update.link": "See updates", "home.pending_critical_update.title": "Critical security update available!", "home.show_announcements": "Show announcements", - "interaction_modal.description.favourite": "With an account on Mastodon, you can favorite this post to let the author know you appreciate it and save it for later.", + "interaction_modal.description.favourite": "With an account on Mastodon, you can like this post to let the author know you appreciate it and save it for later.", "interaction_modal.description.follow": "With an account on Mastodon, you can follow {name} to receive their posts in your home feed.", "interaction_modal.description.reblog": "With an account on Mastodon, you can boost this post to share it with your own followers.", "interaction_modal.description.reply": "With an account on Mastodon, you can respond to this post.", @@ -325,7 +325,7 @@ "interaction_modal.on_this_server": "On this server", "interaction_modal.sign_in": "You are not logged in to this server. Where is your account hosted?", "interaction_modal.sign_in_hint": "Tip: That's the website where you signed up. If you don't remember, look for the welcome e-mail in your inbox. You can also enter your full username! (e.g. @Mastodon@mastodon.social)", - "interaction_modal.title.favourite": "Favorite {name}'s post", + "interaction_modal.title.favourite": "Like {name}'s post", "interaction_modal.title.follow": "Follow {name}", "interaction_modal.title.reblog": "Boost {name}'s post", "interaction_modal.title.reply": "Reply to {name}'s post", @@ -341,8 +341,8 @@ "keyboard_shortcuts.direct": "to open private mentions column", "keyboard_shortcuts.down": "Move down in the list", "keyboard_shortcuts.enter": "Open post", - "keyboard_shortcuts.favourite": "Favorite post", - "keyboard_shortcuts.favourites": "Open favorites list", + "keyboard_shortcuts.favourite": "Like post", + "keyboard_shortcuts.favourites": "Open liked posts", "keyboard_shortcuts.federated": "Open federated timeline", "keyboard_shortcuts.heading": "Keyboard shortcuts", "keyboard_shortcuts.home": "Open home timeline", @@ -406,7 +406,7 @@ "navigation_bar.domain_blocks": "Blocked domains", "navigation_bar.edit_profile": "Edit profile", "navigation_bar.explore": "Explore", - "navigation_bar.favourites": "Favorites", + "navigation_bar.favourites": "Liked posts", "navigation_bar.filters": "Muted words", "navigation_bar.follow_requests": "Follow requests", "navigation_bar.followed_tags": "Followed hashtags", @@ -424,7 +424,7 @@ "not_signed_in_indicator.not_signed_in": "You need to login to access this resource.", "notification.admin.report": "{name} reported {target}", "notification.admin.sign_up": "{name} signed up", - "notification.favourite": "{name} favorited your post", + "notification.favourite": "{name} liked your post", "notification.follow": "{name} followed you", "notification.follow_request": "{name} has requested to follow you", "notification.mention": "{name} mentioned you", @@ -438,7 +438,7 @@ "notifications.column_settings.admin.report": "New reports:", "notifications.column_settings.admin.sign_up": "New sign-ups:", "notifications.column_settings.alert": "Desktop notifications", - "notifications.column_settings.favourite": "Favorites:", + "notifications.column_settings.favourite": "Likes:", "notifications.column_settings.filter_bar.advanced": "Display all categories", "notifications.column_settings.filter_bar.category": "Quick filter bar", "notifications.column_settings.filter_b |