Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2021-1-capstone-design2
/
2017110273
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
sdy
2021-06-03 23:37:08 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c3c9b3a381b418ececc1faf8a922baf9f3c8085d
c3c9b3a3
1 parent
a4924987
update bot message
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
8 deletions
client/src/components/chat/Chat.js
client/src/components/chat/Chat.js
View file @
c3c9b3a
...
...
@@ -7,17 +7,19 @@ import axios from "axios";
import
Header
from
"../header/Header"
;
//const regExp = /<a[\s]+([^>]+)>((?:.(?!\<\/a\>))*.)<\/a>/g;
const
BotOptions
=
({
option
})
=>
{
return
(
<
div
className
=
{
'msg label bot'
}
>
{
option
.
label
}
<
/div
>
);
}
const
BotMsg
=
({
bot
})
=>
{
const
BotMsg
=
({
bot
})
=>
{
if
(
bot
.
response_type
===
'text'
)
{
return
(
<
div
className
=
{
'msg bot'
}
>
{
bot
.
text
}
<
/div
>
)
;
<
div
dangerouslySetInnerHTML
=
{
{
__html
:
bot
.
text
}
}
className
=
{
'msg bot'
}
>
<
/div
>
)
}
else
if
(
bot
.
response_type
===
'option'
)
{
console
.
log
(
"bot : "
,
bot
);
return
(
...
...
@@ -70,11 +72,6 @@ const Chat = ({ chat, userMsg, botMsg, botOption, userMessage, sendMessage }) =>
}
},
[]);
console
.
log
(
"chats : "
,
chat
);
console
.
log
(
"userMsg : "
,
userMsg
);
console
.
log
(
"botMsg : "
,
botMsg
);
console
.
log
(
"botOptions : "
,
botOption
);
return
(
<
div
className
=
"chat"
>
<
Header
/>
...
...
Please
register
or
login
to post a comment