Skip to content

Commit c4abbd0

Browse files
author
Nathan Zylbersztejn
authored
Merge pull request #50 from mrbot-ai/feature/hide_when_not_connected
Feature/hide when not connected
2 parents cc828f8 + 865c84b commit c4abbd0

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## 0.5.3
22
- Added the parameter hideWhenNotConnected to not display the widget when the server is not connected (defaults to true)
33
- Fixed issue where the 'connected' property was being loaded from previous session instead of being triggered on actual connection
4+
- Reduced the size of the widget container on mobile and in fullscreen mode (blocking clicks)
45

56
## 0.5.2
67
- Added support for custom images for open and close buttons of chatWidget interface

src/components/Widget/layout.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,17 @@ const WidgetLayout = (props) => {
1313
}
1414
const showCloseButton = props.showCloseButton !== undefined ? props.showCloseButton : !props.embedded;
1515
const isVisible = props.isChatVisible && !(props.hideWhenNotConnected && !props.connected);
16+
const chatShowing = (props.isChatOpen || props.embedded);
17+
18+
if (chatShowing && !props.embedded) {
19+
classes.push('chat-open');
20+
}
1621

1722
return (
1823
isVisible ?
1924
<div className={classes.join(' ')}>
2025
{
21-
(props.isChatOpen || props.embedded) &&
26+
chatShowing &&
2227
<Conversation
2328
title={props.title}
2429
subtitle={props.subtitle}

src/components/Widget/style.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
align-items: flex-end;
1414
justify-content: flex-end;
1515

16-
&.full-screen {
16+
&.full-screen.chat-open {
1717
@include widget-container-fs;
1818
}
1919
}
@@ -32,7 +32,7 @@
3232
}
3333

3434
@media screen and (max-width: 800px) {
35-
.widget-container {
35+
.widget-container.chat-open {
3636
@include widget-container-fs;
3737
}
3838
}

0 commit comments

Comments
 (0)