Skip to content

Commit

Permalink
Readd Options Menu and just remove Finish Chat option
Browse files Browse the repository at this point in the history
  • Loading branch information
Shailesh351 committed Apr 28, 2022
1 parent 90613e9 commit 98500ac
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/components/Screen/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ class ScreenHeader extends Component {
onEnableNotifications,
onDisableNotifications,
// onOpenWindow,
options,
onFinishChat,
}) => (
<Header
Expand Down Expand Up @@ -102,7 +101,7 @@ class ScreenHeader extends Component {
</Header.Action>
</Tooltip.Trigger>
)} */}
{options && onFinishChat && (
{onFinishChat && (
<Tooltip.Trigger content={I18n.t('End chat')}>
<Header.Action
aria-label={I18n.t('End chat')}
Expand Down
26 changes: 23 additions & 3 deletions src/routes/Chat/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,19 @@ import { CallNotification } from '../../components/Calls/CallNotification';
import { CallStatus } from '../../components/Calls/CallStatus';
import { Composer, ComposerAction, ComposerActions } from '../../components/Composer';
import { FilesDropTargetWrapper } from '../../components/FilesDropTarget';
import { CharCounter } from '../../components/Footer';
import { FooterOptions, CharCounter } from '../../components/Footer';
import { Menu } from '../../components/Menu';
import { MessageList } from '../../components/Messages';
import { Screen } from '../../components/Screen';
import { createClassName } from '../../components/helpers';
import I18n from '../../i18n';
// import EmojiIcon from '../../icons/smile.svg';
import ChangeIcon from '../../icons/change.svg';
import PlusIcon from '../../icons/plus.svg';
import PrintIcon from '../../icons/print.svg';
import RemoveIcon from '../../icons/remove.svg';
import SendIcon from '../../icons/send.svg';
import { store } from '../../store';
// import EmojiIcon from '../../icons/smile.svg';
import styles from './styles.scss';

export default class Chat extends Component {
Expand Down Expand Up @@ -145,8 +150,8 @@ export default class Chat extends Component {
fontColor={fontColor}
agent={agent || null}
queueInfo={queueInfo}
options={options}
nopadding
options={options}
onChangeDepartment={onChangeDepartment}
onFinishChat={onFinishChat}
onRemoveUserData={onRemoveUserData}
Expand Down Expand Up @@ -191,6 +196,21 @@ export default class Chat extends Component {
</Screen.Content>
{ !livechat_kill_switch ? (
<Screen.Footer
options={options ? (
<FooterOptions>
<Menu.Group>
{onPrintTranscript && !store.state.hidePrint && (
<Menu.Item onClick={onPrintTranscript} icon={PrintIcon}>{I18n.t('Print Chat')}</Menu.Item>
)}
{onChangeDepartment && (
<Menu.Item onClick={onChangeDepartment} icon={ChangeIcon}>{I18n.t('Change department')}</Menu.Item>
)}
{onRemoveUserData && (
<Menu.Item onClick={onRemoveUserData} icon={RemoveIcon}>{I18n.t('Forget/Remove my data')}</Menu.Item>
)}
</Menu.Group>
</FooterOptions>
) : null}
limit={limitTextLength
? <CharCounter
limitTextLength={limitTextLength}
Expand Down
2 changes: 1 addition & 1 deletion src/routes/Chat/container.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ export class ChatContainer extends Component {
}

showOptionsMenu = () =>
this.canSwitchDepartment() || this.canFinishChat() || this.canRemoveUserData()
this.canSwitchDepartment() || this.canPrintTranscript() || this.canRemoveUserData()


async handleConnectingAgentAlert(connecting, message) {
Expand Down

0 comments on commit 98500ac

Please sign in to comment.