display unreadcount in actionpanel even on search mode

pull/715/head
Audric Ackermann 6 years ago
parent 277acab2a5
commit 30a1e4da99

@ -45,6 +45,7 @@ interface Props {
sentFriendsRequest: Array<ConversationListItemPropsType>; sentFriendsRequest: Array<ConversationListItemPropsType>;
receivedFriendsRequest: Array<ConversationListItemPropsType>; receivedFriendsRequest: Array<ConversationListItemPropsType>;
unreadMessageCount: number; unreadMessageCount: number;
receivedFriendRequestCount: number;
searchResults?: SearchResultsProps; searchResults?: SearchResultsProps;
searchTerm: string; searchTerm: string;
isSecondaryDevice: boolean; isSecondaryDevice: boolean;
@ -171,7 +172,7 @@ export class LeftPane extends React.Component<Props, State> {
selectedSection={this.state.selectedSection} selectedSection={this.state.selectedSection}
onSectionSelected={this.handleSectionSelected} onSectionSelected={this.handleSectionSelected}
conversations={this.props.conversations} conversations={this.props.conversations}
receivedFriendsRequest={this.props.receivedFriendsRequest} receivedFriendRequestCount={this.props.receivedFriendRequestCount}
unreadMessageCount={this.props.unreadMessageCount} unreadMessageCount={this.props.unreadMessageCount}
/> />
<div className="module-left-pane">{this.renderSection()}</div> <div className="module-left-pane">{this.renderSection()}</div>

@ -20,8 +20,8 @@ interface Props {
onSectionSelected: any; onSectionSelected: any;
selectedSection: SectionType; selectedSection: SectionType;
conversations: Array<ConversationListItemPropsType> | undefined; conversations: Array<ConversationListItemPropsType> | undefined;
receivedFriendsRequest: Array<ConversationListItemPropsType>;
unreadMessageCount: number; unreadMessageCount: number;
receivedFriendRequestCount: number;
} }
const Section = ({ const Section = ({
@ -140,12 +140,10 @@ export class ActionsPanel extends React.Component<Props, State> {
public render(): JSX.Element { public render(): JSX.Element {
const { const {
selectedSection, selectedSection,
receivedFriendsRequest,
unreadMessageCount, unreadMessageCount,
receivedFriendRequestCount,
} = this.props; } = this.props;
const friendRequestCount = receivedFriendsRequest.length;
const isProfilePageSelected = selectedSection === SectionType.Profile; const isProfilePageSelected = selectedSection === SectionType.Profile;
const isMessagePageSelected = selectedSection === SectionType.Message; const isMessagePageSelected = selectedSection === SectionType.Message;
const isContactPageSelected = selectedSection === SectionType.Contact; const isContactPageSelected = selectedSection === SectionType.Contact;
@ -171,7 +169,7 @@ export class ActionsPanel extends React.Component<Props, State> {
type={SectionType.Contact} type={SectionType.Contact}
isSelected={isContactPageSelected} isSelected={isContactPageSelected}
onSelect={this.handleSectionSelect} onSelect={this.handleSectionSelect}
notificationCount={friendRequestCount} notificationCount={receivedFriendRequestCount}
/> />
<Section <Section
type={SectionType.Globe} type={SectionType.Globe}

Loading…
Cancel
Save