Skip to content

Commit

Permalink
fix renaming (#386)
Browse files Browse the repository at this point in the history
* Scroll eventListener -> rx

* Make observables of button clicks

* Consolidated button management

* we know that carouselMargin is already set

* syntax error

* I like ;

* Comments

* Button out of state

* Revert "Button out of state"

This reverts commit e06ca20.

* Revert "Comments"

This reverts commit c919af7.

* Revert "I like ;"

This reverts commit 703a8cb.

* Revert "syntax error"

This reverts commit f74889d.

* Revert "we know that carouselMargin is already set"

This reverts commit 5f21b30.

* Revert "Consolidated button management"

This reverts commit a09de95.

* Revert "Make observables of button clicks"

This reverts commit de8596d.

* Revert "Scroll eventListener -> rx"

This reverts commit 24d7136.

* remote is a dev dependency

* A little too much scrolling

* Slider

* Unneeded imports

* Better factoring of the same idea

* rename to MessagePane

* Renaming rename.

* no exports needed
  • Loading branch information
billba authored and danmarshall committed Mar 17, 2017
1 parent 9c12820 commit 3cc4500
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/Chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Subscription } from 'rxjs/Subscription';

import { Activity, Media, IBotConnection, User, MediaType, DirectLine, DirectLineOptions } from 'botframework-directlinejs';
import { History } from './History';
import { SuggestedActions } from './MessagePane';
import { MessagePane } from './MessagePane';
import { Shell } from './Shell';
import { createStore, ChatActions, ChatStore } from './Store';
import { Dispatch, Provider } from 'react-redux';
Expand Down Expand Up @@ -151,9 +151,9 @@ export class Chat extends React.Component<ChatProps, {}> {
<Provider store={ this.store }>
<div className="wc-chatview-panel" ref={ div => this.chatviewPanel = div }>
{ header }
<SuggestedActions>
<MessagePane>
<History/>
</SuggestedActions>
</MessagePane>
<Shell />
{ resize }
</div>
Expand Down
15 changes: 7 additions & 8 deletions src/MessagePane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@ export interface MessagePaneProps {
children: React.ReactNode
}

const MessagePane = (props: MessagePaneProps) => {
const MessagePaneView = (props: MessagePaneProps) =>
<div className={ classList('wc-message-pane', props.actions && 'show-actions' ) }>
{ props.children }
<SuggestedActionsView { ... props }/>
</div>
};
<SuggestedActions { ... props }/>
</div>;

export class SuggestedActionsView extends React.Component<MessagePaneProps, {}> {
class SuggestedActions extends React.Component<MessagePaneProps, {}> {
constructor(props: MessagePaneProps) {
super(props);
}
Expand Down Expand Up @@ -59,7 +58,7 @@ export class SuggestedActionsView extends React.Component<MessagePaneProps, {}>

}

export function suggestedActions(activities: Activity[]) {
function suggestedActions(activities: Activity[]) {
if (!activities || activities.length === 0)
return;
const lastActivity = activities[activities.length - 1];
Expand All @@ -68,12 +67,12 @@ export function suggestedActions(activities: Activity[]) {
return lastActivity.suggestedActions;
}

export const SuggestedActions = connect(
export const MessagePane = connect(
(state: ChatState): Partial<MessagePaneProps> => ({
actions: suggestedActions(state.history.activities),
doCardAction: doCardAction(state.connection.botConnection, state.connection.user, state.format.locale),
}),
(dispatch: Dispatch<any>): Partial<MessagePaneProps> => ({
sendMessage: (value: string, user: User, locale: string) => sendMessage(dispatch, value, user, locale)
})
)(MessagePane);
)(MessagePaneView);

0 comments on commit 3cc4500

Please sign in to comment.