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",
|
"name": "private-safesupport-chatbox",
|
||||||
"version": "2.1.1",
|
"version": "2.1.1",
|
||||||
"description": "A secure and private embeddable chatbox that connects to Riot",
|
"description": "A secure and private embeddable chatbox that connects to Riot",
|
||||||
"main": "dist/component.js",
|
"main": "dist/chatbox.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "NODE_ENV=production webpack-cli --mode production",
|
"build": "NODE_ENV=production webpack-cli --mode production",
|
||||||
"build:profile": "webpack --mode production --config webpack.config.profile.js",
|
"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_SIZE = 'large'
|
||||||
const DEFAULT_MAX_WAIT_MS = 600000 // 10 minutes
|
const DEFAULT_MAX_WAIT_MS = 600000 // 10 minutes
|
||||||
const DEFAULT_WAIT_INTERVAL_MS = 120000 // 2 minutes
|
const DEFAULT_WAIT_INTERVAL_MS = 120000 // 2 minutes
|
||||||
|
const DEFAULT_DOCK_LABEL = 'Start a new chat'
|
||||||
|
|
||||||
class ChatBox extends React.Component {
|
class ChatBox extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
@ -756,7 +756,7 @@ class ChatBox extends React.Component {
|
|||||||
)}
|
)}
|
||||||
}
|
}
|
||||||
</Transition>
|
</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} />}
|
{showDock && roomId && <Header handleToggleOpen={this.handleToggleOpen} opened={opened} handleExitChat={this.handleExitChat} />}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -782,6 +782,7 @@ ChatBox.propTypes = {
|
|||||||
size: PropTypes.oneOf(['small', 'large']),
|
size: PropTypes.oneOf(['small', 'large']),
|
||||||
maxWaitTime: PropTypes.number,
|
maxWaitTime: PropTypes.number,
|
||||||
waitInterval: PropTypes.number,
|
waitInterval: PropTypes.number,
|
||||||
|
dockLabel: PropTypes.string,
|
||||||
}
|
}
|
||||||
|
|
||||||
ChatBox.defaultProps = {
|
ChatBox.defaultProps = {
|
||||||
@ -802,6 +803,7 @@ ChatBox.defaultProps = {
|
|||||||
size: DEFAULT_SIZE,
|
size: DEFAULT_SIZE,
|
||||||
maxWaitTime: DEFAULT_MAX_WAIT_MS,
|
maxWaitTime: DEFAULT_MAX_WAIT_MS,
|
||||||
waitInterval: DEFAULT_WAIT_INTERVAL_MS,
|
waitInterval: DEFAULT_WAIT_INTERVAL_MS,
|
||||||
|
dockLabel: DEFAULT_DOCK_LABEL,
|
||||||
}
|
}
|
||||||
|
|
||||||
export default ChatBox;
|
export default ChatBox;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React, { Fragment } from "react"
|
import React, { Fragment } from "react"
|
||||||
import PropTypes from "prop-types"
|
import PropTypes from "prop-types"
|
||||||
|
|
||||||
const Dock = ({ handleToggleOpen, size }) => {
|
const Dock = ({ handleToggleOpen, size, label }) => {
|
||||||
return(
|
return(
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
@ -13,11 +13,11 @@ const Dock = ({ handleToggleOpen, size }) => {
|
|||||||
{
|
{
|
||||||
size === 'small' ?
|
size === 'small' ?
|
||||||
<div id="open-chatbox-label">
|
<div id="open-chatbox-label">
|
||||||
<span>Chat</span><span className="icon">+</span>
|
<span>{label}</span><span className="icon">+</span>
|
||||||
</div>
|
</div>
|
||||||
:
|
:
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<div id="open-chatbox-label">Start a new chat</div>
|
<div id="open-chatbox-label">{label}</div>
|
||||||
<div className="label-icon">
|
<div className="label-icon">
|
||||||
<div className={`btn-icon`} aria-label={`Open support chat window`}>+</div>
|
<div className={`btn-icon`} aria-label={`Open support chat window`}>+</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user