Redux prep for refactor

pull/1102/head
Vincent 5 years ago
parent cdd19037ba
commit 3fec09a293

@ -28,23 +28,23 @@ interface State {
} }
interface Props { interface Props {
conversations: Array<ConversationListItemPropsType>; // conversations: Array<ConversationListItemPropsType>;
friends: Array<ConversationType>; // friends: Array<ConversationType>;
sentFriendsRequest: Array<ConversationListItemPropsType>; // sentFriendsRequest: Array<ConversationListItemPropsType>;
receivedFriendsRequest: Array<ConversationListItemPropsType>; // receivedFriendsRequest: Array<ConversationListItemPropsType>;
unreadMessageCount: number; // unreadMessageCount: number;
receivedFriendRequestCount: number; // receivedFriendRequestCount: number;
searchResults?: SearchResultsProps; // searchResults?: SearchResultsProps;
searchTerm: string; // searchTerm: string;
isSecondaryDevice: boolean; // isSecondaryDevice: boolean;
openConversationInternal: (id: string, messageId?: string) => void; // openConversationInternal: (id: string, messageId?: string) => void;
updateSearchTerm: (searchTerm: string) => void; // updateSearchTerm: (searchTerm: string) => void;
search: (query: string, options: SearchOptions) => void; // search: (query: string, options: SearchOptions) => void;
clearSearch: () => void; // clearSearch: () => void;
} }
export class LeftPane extends React.Component<Props, State> { export class LeftPane extends React.Component<any, State> {
public state = { public state = {
selectedSection: SectionType.Message, selectedSection: SectionType.Message,
}; };
@ -52,6 +52,9 @@ export class LeftPane extends React.Component<Props, State> {
public constructor(props: any) { public constructor(props: any) {
super(props); super(props);
this.handleSectionSelected = this.handleSectionSelected.bind(this); this.handleSectionSelected = this.handleSectionSelected.bind(this);
console.log(`[vince] These are my props:`, props);
} }
// this static function is set here to be used by all subsections (message, contacts,...) to render their headers // this static function is set here to be used by all subsections (message, contacts,...) to render their headers

@ -6,12 +6,13 @@ import { StateType } from '../reducer';
import { getSessionConversationInfo } from '../selectors/conversations'; import { getSessionConversationInfo } from '../selectors/conversations';
const mapStateToProps = (state: StateType) => { const mapStateToProps = (state: StateType) => {
const conversationInfo = getSessionConversationInfo(state); //const conversationInfo = getSessionConversationInfo(state);
console.log(`[vince] stateToProps from SessionConversation:`, conversationInfo); // console.log(`[vince] stateToProps from SessionConversation:`, conversationInfo);
console.log(`[vince] stateToProps from SessionConversation:`,state);
return { return {
...conversationInfo, ...state,
} }
}; };

Loading…
Cancel
Save