ConversationView: Move setPin to redux
This commit is contained in:
parent
e9b7a74b32
commit
ff6750e4fd
11 changed files with 135 additions and 86 deletions
|
@ -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'),
|
||||
};
|
||||
|
||||
|
|
|
@ -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>
|
||||
)}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue