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 = '