Updated pic and small adjustments on the code.

This commit is contained in:
Vesa Juvonen 2016-10-28 15:46:57 +03:00
parent 354704dca4
commit 590fd08b0c
6 changed files with 43 additions and 41 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -6,16 +6,17 @@
"node": ">=0.10.0"
},
"dependencies": {
"@microsoft/sp-client-base": "~0.3.0",
"@microsoft/sp-client-preview": "~0.4.0",
"@microsoft/sp-client-base": "~0.4.0",
"@microsoft/sp-client-preview": "~0.5.0",
"office-ui-fabric-react": "0.36.0",
"react": "0.14.8",
"react-dom": "0.14.8"
"react-dom": "0.14.8",
"swagger-client": "^2.1.23"
},
"devDependencies": {
"@microsoft/sp-build-web": "~0.6.0",
"@microsoft/sp-module-interfaces": "~0.3.0",
"@microsoft/sp-webpart-workbench": "~0.4.0",
"@microsoft/sp-build-web": "~0.7.0",
"@microsoft/sp-module-interfaces": "~0.4.0",
"@microsoft/sp-webpart-workbench": "~0.5.0",
"gulp": "~3.9.1"
},
"scripts": {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

View File

@ -7,8 +7,7 @@
.chatHeader {
padding:10px;
background-color: #c7e0f4;
color: #000;
font-weight: bold;
color: #fff;
}
.messagesRow {

View File

@ -17,8 +17,8 @@
"placeholderText": "Your message",
"title": "Chat",
"directLineSecret": "",
"titleBarBackgroundColor": "c7e0f4",
"botMessagesBackgroundColor": "c8c8c8",
"titleBarBackgroundColor": "3C3C3C",
"botMessagesBackgroundColor": "f4f4f4",
"botMessagesForegroundColor": "000000",
"userMessagesBackgroundColor": "c7e0f4",
"userMessagesForegroundColor": "000000"

View File

@ -37,7 +37,8 @@ export default class BotFrameworkChat extends React.Component<IBotFrameworkChatP
);
}
public componentDidMount(): void {
public componentDidUpdate(prevProps: IBotFrameworkChatWebPartProps, prevState: {}, prevContext: any): void {
if (this.props.directLineSecret !== prevProps.directLineSecret) {
if (this.props.directLineSecret) {
var Swagger = require('swagger-client');
var directLineSpec = require('./directline-swagger.json');
@ -69,6 +70,7 @@ export default class BotFrameworkChat extends React.Component<IBotFrameworkChatP
this.printMessage = this.printMessage.bind(this);
}
}
}
public getMessagesHtml() {
return this.messagesHtml;