diff --git a/bin/build.js b/bin/build.js
index d29443f9..c244f71e 100644
--- a/bin/build.js
+++ b/bin/build.js
@@ -1,6 +1,6 @@
const webpack = require('webpack')
-const webpackConfig = require('../webpack/prod.js')
+const webpackConfig = require('../webpack/dev')
const bundler = webpack(webpackConfig)
diff --git a/src/components/Expander/style.scss b/src/components/Expander/style.scss
index 991c6398..dc78bf2d 100644
--- a/src/components/Expander/style.scss
+++ b/src/components/Expander/style.scss
@@ -11,6 +11,7 @@
border-radius: 3px;
box-shadow: 0 1px 6px lightgrey, 0 2px 32px lightgrey;
transition: opacity 0.3s;
+ z-index: 2147483647;
&.open {
opacity: 1;
diff --git a/src/components/Live/style.scss b/src/components/Live/style.scss
index daee6742..50c682ae 100644
--- a/src/components/Live/style.scss
+++ b/src/components/Live/style.scss
@@ -11,8 +11,8 @@
}
}
-@media only screen and (min-width: 420px) and (min-height: 575px) {
+@media only screen and (min-width: 1000px) and (min-height: 900px) {
.RecastApp .RecastAppLive, .CaiApp .CaiAppLive {
- height: 460px;
+ height: 800px;
}
}
diff --git a/src/components/Message/Buttons.js b/src/components/Message/Buttons.js
index 4e15c9e8..5676cf4e 100644
--- a/src/components/Message/Buttons.js
+++ b/src/components/Message/Buttons.js
@@ -16,7 +16,7 @@ const Buttons = ({ content, sendMessage, style }) => {
- {buttons.slice(0, 3).map((b, i) => (
+ {buttons.slice(0, 6).map((b, i) => (
))}
diff --git a/src/components/Message/List.js b/src/components/Message/List.js
index 8a6539c0..87dd6370 100644
--- a/src/components/Message/List.js
+++ b/src/components/Message/List.js
@@ -1,51 +1,70 @@
-import React from 'react'
+import React, { Component } from 'react'
import PropTypes from 'prop-types'
+
import { sanitizeUrl } from '@braintree/sanitize-url'
import { truncate } from 'helpers'
import Button from 'components/Button'
+import Text from 'components/Message/Text'
-const ListElement = ({ title, subtitle, imageUrl, buttons, sendMessage }) => {
- const button = buttons[0]
- const titleMaxLength = 25
- const subTitleMaxLength = 50
- const buttonTitleMaxLength = 20
- return (
-
- {imageUrl
- && sanitizeUrl(imageUrl) !== 'about:blank' && (
-

- )}
+class ListElement extends Component {
-
-
{truncate(title, titleMaxLength)}
-
{truncate(subtitle, subTitleMaxLength)}
+ state = {
+ showDetail: false
+ }
- {button
- && (button.type === 'web_url' ? (
- sanitizeUrl(button.value) !== 'about:blank' && (
-
- {truncate(button.title, buttonTitleMaxLength)}
-
- )
- ) : (
-
sendMessage({ type: 'text', content: button.value })}
- >
- {truncate(button.title, buttonTitleMaxLength)}
-
- ))}
-
-
- )
+ render () {
+ const { title, subtitle, imageUrl, buttons, detail, sendMessage } = this.props
+ const { showDetail} = this.state
+ const titleMaxLength = 25
+ const subTitleMaxLength = 50
+ const buttonTitleMaxLength = 20
+ return (
+
+
+ {imageUrl
+ && sanitizeUrl(imageUrl) !== 'about:blank' && (
+

+ )}
+
+
+
this.setState({ showDetail: !showDetail })}>
+ {truncate(title, titleMaxLength)}
+
+
{truncate(subtitle, subTitleMaxLength)}
+ {buttons.slice(0, 3).map((button, i) => (
+ button
+ && (button.type === 'web_url' ? (
+ button.value && sanitizeUrl(button.value) !== 'about:blank' && (
+
+ {truncate(button.title, buttonTitleMaxLength)}
+
+ )
+ ) : (
+
sendMessage({ type: 'text', content: button.value })}
+ >
+ {truncate(button.title, buttonTitleMaxLength)}
+
+ )))
+ )}
+
+
+ {detail && (
+
+ )}
+
+ )
+ }
}
ListElement.propTypes = {
@@ -53,6 +72,7 @@ ListElement.propTypes = {
subtitle: PropTypes.string,
imageUrl: PropTypes.string,
buttons: PropTypes.array,
+ detail: PropTypes.string,
sendMessage: PropTypes.func,
}
diff --git a/src/components/Message/Text.js b/src/components/Message/Text.js
index 0620828b..9a406580 100644
--- a/src/components/Message/Text.js
+++ b/src/components/Message/Text.js
@@ -7,10 +7,21 @@ import { truncate } from 'helpers'
import './style.scss'
const Text = ({ content, style }) => {
- let respond
+ let respond, iframeSrc, iframeWidth, iframeHeight, iframeScroll
if (typeof content === 'string') {
respond = content
+ if(respond.indexOf("iframe")!=-1){
+ // var str = '';
+ var re ='';
+ var p = new RegExp(re, "gm");
+ var myArray = respond.match(p);
+ iframeSrc = RegExp.$1;
+ iframeWidth = RegExp.$2;
+ iframeHeight = RegExp.$3;
+ iframeScroll = RegExp.$4;
+ respond = respond.replace(p,'');
+ }
} else if (typeof content === 'object') {
respond = JSON.stringify(content)
} else if (typeof content === 'number') {
@@ -23,10 +34,10 @@ const Text = ({ content, style }) => {
return (
- {sanitizeHtml(truncate(respond, 640))
- .replace(/&/g, 'g')
- .replace(/</g, '<')
- .replace(/>/g, '>')}
+ {respond}
+ {iframeSrc&&
+ ()
+ }
)
}
diff --git a/src/components/Message/style.scss b/src/components/Message/style.scss
index 60da9043..2af885f3 100644
--- a/src/components/Message/style.scss
+++ b/src/components/Message/style.scss
@@ -73,7 +73,7 @@
*/
.RecastAppText, .CaiAppText {
- max-width: 290px;
+ /* max-width: 290px;*/
padding: 0.8rem;
border-radius: 3px;
@@ -194,8 +194,14 @@
.RecastAppListElement, .CaiAppListElement {
display: flex;
+ flex-direction: column;
width: 290px;
+ &--head {
+ display: flex;
+ width: 100%;
+ }
+
&--img {
width: 80px;
height: 80px;
diff --git a/src/containers/Chat/style.scss b/src/containers/Chat/style.scss
index 293b16b8..407ca47a 100644
--- a/src/containers/Chat/style.scss
+++ b/src/containers/Chat/style.scss
@@ -49,15 +49,15 @@
}
}
-@media only screen and (min-width: 420px) and (min-height: 575px) {
+@media only screen and (min-width: 1000px) and (min-height: 900px) {
.RecastApp .RecastAppChat, .CaiApp .CaiAppChat {
right: 10px;
bottom: 10px;
border-radius: 3px;
top: auto;
left: auto;
- width: 370px;
- height: auto;
+ width: 1000px;
+ height: 900px;
box-shadow: 0 5px 40px rgba(0, 0, 0, 0.16);
&--slogan {