ConversationView: Move setPin to redux

This commit is contained in:
Scott Nonnenberg 2022-12-06 17:00:02 -08:00 committed by GitHub
parent e9b7a74b32
commit ff6750e4fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 135 additions and 86 deletions

View file

@ -55,8 +55,8 @@ const commonProps = {
onArchive: action('onArchive'),
onMarkUnread: action('onMarkUnread'),
onMoveToInbox: action('onMoveToInbox'),
onSetPin: action('onSetPin'),
setMuteExpiration: action('onSetMuteNotifications'),
setPinned: action('setPinned'),
viewUserStories: action('viewUserStories'),
};

View file

@ -84,7 +84,6 @@ export type PropsActionsType = {
onSearchInConversation: () => void;
onOutgoingAudioCallInConversation: (conversationId: string) => void;
onOutgoingVideoCallInConversation: (conversationId: string) => void;
onSetPin: (value: boolean) => void;
onShowConversationDetails: () => void;
onShowAllMedia: () => void;
@ -99,6 +98,7 @@ export type PropsActionsType = {
conversationId: string,
seconds: DurationInSeconds
) => void;
setPinned: (conversationId: string, value: boolean) => void;
viewUserStories: ViewUserStoriesActionCreatorType;
};
@ -349,12 +349,12 @@ export class ConversationHeader extends React.Component<PropsType, StateType> {
onArchive,
onMarkUnread,
onMoveToInbox,
onSetPin,
onShowAllMedia,
onShowConversationDetails,
onShowGroupMembers,
setDisappearingMessages,
setMuteExpiration,
setPinned,
type,
} = this.props;
@ -502,11 +502,11 @@ export class ConversationHeader extends React.Component<PropsType, StateType> {
{i18n('deleteMessages')}
</MenuItem>
{isPinned ? (
<MenuItem onClick={() => onSetPin(false)}>
<MenuItem onClick={() => setPinned(id, false)}>
{i18n('unpinConversation')}
</MenuItem>
) : (
<MenuItem onClick={() => onSetPin(true)}>
<MenuItem onClick={() => setPinned(id, true)}>
{i18n('pinConversation')}
</MenuItem>
)}