forked from Github/ocrcc-chatbox
main file should be chatbox
This commit is contained in:
parent
a2a48771e1
commit
80c00149d2
2
dist/bookmarklet.js
vendored
2
dist/bookmarklet.js
vendored
File diff suppressed because one or more lines are too long
2
dist/chatbox.js
vendored
2
dist/chatbox.js
vendored
File diff suppressed because one or more lines are too long
2
dist/component.js
vendored
2
dist/component.js
vendored
File diff suppressed because one or more lines are too long
@ -2,7 +2,7 @@
|
||||
"name": "private-safesupport-chatbox",
|
||||
"version": "2.1.1",
|
||||
"description": "A secure and private embeddable chatbox that connects to Riot",
|
||||
"main": "dist/component.js",
|
||||
"main": "dist/chatbox.js",
|
||||
"scripts": {
|
||||
"build": "NODE_ENV=production webpack-cli --mode production",
|
||||
"build:profile": "webpack --mode production --config webpack.config.profile.js",
|
||||
|
@ -43,7 +43,7 @@ const DEFAULT_POSITION = 'bottom right'
|
||||
const DEFAULT_SIZE = 'large'
|
||||
const DEFAULT_MAX_WAIT_MS = 600000 // 10 minutes
|
||||
const DEFAULT_WAIT_INTERVAL_MS = 120000 // 2 minutes
|
||||
|
||||
const DEFAULT_DOCK_LABEL = 'Start a new chat'
|
||||
|
||||
class ChatBox extends React.Component {
|
||||
constructor(props) {
|
||||
@ -756,7 +756,7 @@ class ChatBox extends React.Component {
|
||||
)}
|
||||
}
|
||||
</Transition>
|
||||
{showDock && !roomId && <Dock handleToggleOpen={this.handleToggleOpen} size={this.props.size} />}
|
||||
{showDock && !roomId && <Dock handleToggleOpen={this.handleToggleOpen} size={this.props.size} label={this.props.dockLabel} />}
|
||||
{showDock && roomId && <Header handleToggleOpen={this.handleToggleOpen} opened={opened} handleExitChat={this.handleExitChat} />}
|
||||
</div>
|
||||
</div>
|
||||
@ -782,6 +782,7 @@ ChatBox.propTypes = {
|
||||
size: PropTypes.oneOf(['small', 'large']),
|
||||
maxWaitTime: PropTypes.number,
|
||||
waitInterval: PropTypes.number,
|
||||
dockLabel: PropTypes.string,
|
||||
}
|
||||
|
||||
ChatBox.defaultProps = {
|
||||
@ -802,6 +803,7 @@ ChatBox.defaultProps = {
|
||||
size: DEFAULT_SIZE,
|
||||
maxWaitTime: DEFAULT_MAX_WAIT_MS,
|
||||
waitInterval: DEFAULT_WAIT_INTERVAL_MS,
|
||||
dockLabel: DEFAULT_DOCK_LABEL,
|
||||
}
|
||||
|
||||
export default ChatBox;
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React, { Fragment } from "react"
|
||||
import PropTypes from "prop-types"
|
||||
|
||||
const Dock = ({ handleToggleOpen, size }) => {
|
||||
const Dock = ({ handleToggleOpen, size, label }) => {
|
||||
return(
|
||||
<button
|
||||
type="button"
|
||||
@ -13,11 +13,11 @@ const Dock = ({ handleToggleOpen, size }) => {
|
||||
{
|
||||
size === 'small' ?
|
||||
<div id="open-chatbox-label">
|
||||
<span>Chat</span><span className="icon">+</span>
|
||||
<span>{label}</span><span className="icon">+</span>
|
||||
</div>
|
||||
:
|
||||
<Fragment>
|
||||
<div id="open-chatbox-label">Start a new chat</div>
|
||||
<div id="open-chatbox-label">{label}</div>
|
||||
<div className="label-icon">
|
||||
<div className={`btn-icon`} aria-label={`Open support chat window`}>+</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user