Wip: bookmark statuses view and adder

This commit is contained in:
KMY 2023-08-26 13:25:57 +09:00
parent f6bdd9b6de
commit 87490a3220
30 changed files with 616 additions and 24 deletions

View file

@ -37,6 +37,7 @@ const messages = defineMessages({
favourite: { id: 'status.favourite', defaultMessage: 'Favorite' },
emojiReaction: { id: 'status.emoji_reaction', defaultMessage: 'Stamp' },
bookmark: { id: 'status.bookmark', defaultMessage: 'Bookmark' },
bookmarkCategory: { id: 'status.bookmark_category', defaultMessage: 'Bookmark category' },
removeBookmark: { id: 'status.remove_bookmark', defaultMessage: 'Remove bookmark' },
open: { id: 'status.open', defaultMessage: 'Expand this status' },
report: { id: 'status.report', defaultMessage: 'Report @{name}' },
@ -92,6 +93,7 @@ class StatusActionBar extends ImmutablePureComponent {
onMuteConversation: PropTypes.func,
onPin: PropTypes.func,
onBookmark: PropTypes.func,
onBookmarkCategoryAdder: PropTypes.func,
onFilter: PropTypes.func,
onAddFilter: PropTypes.func,
onInteractionModal: PropTypes.func,
@ -167,6 +169,10 @@ class StatusActionBar extends ImmutablePureComponent {
this.props.onBookmark(this.props.status);
};
handleBookmarkCategoryAdderClick = () => {
this.props.onBookmarkCategoryAdder(this.props.status);
};
handleDeleteClick = () => {
this.props.onDelete(this.props.status, this.context.router.history);
};
@ -300,6 +306,7 @@ class StatusActionBar extends ImmutablePureComponent {
}
menu.push({ text: intl.formatMessage(status.get('bookmarked') ? messages.removeBookmark : messages.bookmark), action: this.handleBookmarkClick });
menu.push({ text: intl.formatMessage(messages.bookmarkCategory), action: this.handleBookmarkCategoryAdderClick });
if (writtenByMe && pinnableStatus) {
menu.push({ text: intl.formatMessage(status.get('pinned') ? messages.unpin : messages.pin), action: this.handlePinClick });