Introduce a new design for the left pane
This commit is contained in:
parent
d60600d6fb
commit
35a54cdc02
63 changed files with 1205 additions and 576 deletions
|
@ -15,6 +15,8 @@ export type LeftPaneInboxPropsType = {
|
|||
conversations: ReadonlyArray<ConversationListItemPropsType>;
|
||||
archivedConversations: ReadonlyArray<ConversationListItemPropsType>;
|
||||
pinnedConversations: ReadonlyArray<ConversationListItemPropsType>;
|
||||
isAboutToSearchInAConversation: boolean;
|
||||
startSearchCounter: number;
|
||||
};
|
||||
|
||||
/* eslint-disable class-methods-use-this */
|
||||
|
@ -26,16 +28,24 @@ export class LeftPaneInboxHelper extends LeftPaneHelper<LeftPaneInboxPropsType>
|
|||
|
||||
private readonly pinnedConversations: ReadonlyArray<ConversationListItemPropsType>;
|
||||
|
||||
private readonly isAboutToSearchInAConversation: boolean;
|
||||
|
||||
private readonly startSearchCounter: number;
|
||||
|
||||
constructor({
|
||||
conversations,
|
||||
archivedConversations,
|
||||
pinnedConversations,
|
||||
isAboutToSearchInAConversation,
|
||||
startSearchCounter,
|
||||
}: Readonly<LeftPaneInboxPropsType>) {
|
||||
super();
|
||||
|
||||
this.conversations = conversations;
|
||||
this.archivedConversations = archivedConversations;
|
||||
this.pinnedConversations = pinnedConversations;
|
||||
this.isAboutToSearchInAConversation = isAboutToSearchInAConversation;
|
||||
this.startSearchCounter = startSearchCounter;
|
||||
}
|
||||
|
||||
getRowCount(): number {
|
||||
|
@ -176,6 +186,18 @@ export class LeftPaneInboxHelper extends LeftPaneHelper<LeftPaneInboxPropsType>
|
|||
return undefined;
|
||||
}
|
||||
|
||||
requiresFullWidth(): boolean {
|
||||
const hasNoConversations =
|
||||
!this.conversations.length &&
|
||||
!this.pinnedConversations.length &&
|
||||
!this.archivedConversations.length;
|
||||
return (
|
||||
hasNoConversations ||
|
||||
this.isAboutToSearchInAConversation ||
|
||||
Boolean(this.startSearchCounter)
|
||||
);
|
||||
}
|
||||
|
||||
shouldRecomputeRowHeights(old: Readonly<LeftPaneInboxPropsType>): boolean {
|
||||
return old.pinnedConversations.length !== this.pinnedConversations.length;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue