@meetelise/chat 1.8.0 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +2 -0
- package/README.md +13 -0
- package/package.json +1 -2
- package/public/dist/index.js +1 -1
- package/public/dist/src/ChatButton.d.ts +9 -0
- package/public/dist/src/ChatIcon.d.ts +6 -0
- package/public/dist/src/InHouseLauncher.d.ts +1 -0
- package/public/dist/src/MEChat.d.ts +2 -1
- package/public/dist/src/assetUrls.d.ts +2 -0
- package/public/dist/src/chatID.d.ts +2 -1
- package/public/index.html +37 -37
- package/src/ChatButton.module.scss +51 -0
- package/src/ChatButton.tsx +38 -0
- package/src/ChatIcon.tsx +26 -0
- package/src/DemoApp.tsx +1 -0
- package/src/InHouseLauncher.module.scss +76 -77
- package/src/InHouseLauncher.tsx +28 -18
- package/src/MEChat.d.ts +0 -2
- package/src/MEChat.tsx +30 -28
- package/src/assetUrls.ts +4 -0
- package/src/chatID.ts +47 -12
- package/public/dist/src/launchDarklyManager.d.ts +0 -6
- package/src/launchDarklyManager.ts +0 -30
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface ChatButtonProps {
|
|
3
|
+
text: string;
|
|
4
|
+
onClick?: React.MouseEventHandler;
|
|
5
|
+
className?: string;
|
|
6
|
+
useGlowingBorder?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare const ChatButton: React.FunctionComponent<ChatButtonProps>;
|
|
9
|
+
export default ChatButton;
|
|
@@ -59,8 +59,8 @@ export default class MEChat {
|
|
|
59
59
|
private avatarSrc?;
|
|
60
60
|
private chatId;
|
|
61
61
|
private analytics;
|
|
62
|
-
private launchDarklyClient;
|
|
63
62
|
private useInHouseLauncher;
|
|
63
|
+
private useMiniWidget;
|
|
64
64
|
private isMobile;
|
|
65
65
|
private constructor();
|
|
66
66
|
}
|
|
@@ -69,4 +69,5 @@ export interface Options {
|
|
|
69
69
|
organization: string;
|
|
70
70
|
themeId?: ThemeIdString;
|
|
71
71
|
avatarSrc?: string;
|
|
72
|
+
mini?: boolean;
|
|
72
73
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Get or create a UUID that is the same between browser sessions.
|
|
3
|
+
* If the UUID is past its expiration time, create a new one.
|
|
3
4
|
*
|
|
4
5
|
* @returns the chat ID.
|
|
5
6
|
*/
|
|
6
7
|
export declare function getChatID(org: string, building: string): string;
|
|
7
8
|
/**
|
|
8
|
-
* Create a new chat ID
|
|
9
|
+
* Create a new chat ID, discard any old one, and record the time it was issued.
|
|
9
10
|
*/
|
|
10
11
|
export declare function createChatID(org: string, building: string): string;
|
package/public/index.html
CHANGED
|
@@ -50,10 +50,6 @@
|
|
|
50
50
|
font-family: monospace;
|
|
51
51
|
font-size: 1.5em;
|
|
52
52
|
}
|
|
53
|
-
.meetelise-chat.launcher {
|
|
54
|
-
bottom: -12px;
|
|
55
|
-
right: 100px;
|
|
56
|
-
}
|
|
57
53
|
.meetelise-chat.pane {
|
|
58
54
|
bottom: 48px;
|
|
59
55
|
right: 75px;
|
|
@@ -92,43 +88,47 @@
|
|
|
92
88
|
organization: "test-company",
|
|
93
89
|
building: "e2e-test-yardi-building",
|
|
94
90
|
});
|
|
95
|
-
|
|
96
|
-
// The above code is all a client would need.
|
|
97
|
-
// Below is some code to make local dev easier.
|
|
98
|
-
|
|
91
|
+
//////////////////////////////////////////////////////////////////
|
|
92
|
+
// The above code is all a client would need. //
|
|
93
|
+
// Below is some code to make local dev easier. //
|
|
94
|
+
// Comment out `localDevHelper();` if you don't want to use it. //
|
|
95
|
+
//////////////////////////////////////////////////////////////////
|
|
99
96
|
|
|
100
|
-
|
|
101
|
-
|
|
97
|
+
const localDevHelper = () => {
|
|
98
|
+
// Put the chat instance on window so it's available in the console.
|
|
99
|
+
window.chat = chat;
|
|
102
100
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
101
|
+
// Reset on button click
|
|
102
|
+
document.getElementById("reset").addEventListener("click", () => {
|
|
103
|
+
chat.restartConversation();
|
|
104
|
+
});
|
|
105
|
+
const onChange = debounce((e) => {
|
|
106
|
+
chat.setTheme({ [e.target.name]: e.target.value });
|
|
107
|
+
}, 300);
|
|
108
|
+
document.querySelectorAll("#theme input").forEach((input) => {
|
|
109
|
+
input.addEventListener("input", onChange);
|
|
110
|
+
});
|
|
113
111
|
|
|
114
|
-
|
|
115
|
-
|
|
112
|
+
// Open the chat window shortly after the page loads/refreshes.
|
|
113
|
+
setTimeout(() => chat.open(), 1000);
|
|
116
114
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
115
|
+
// Every x seconds, cycle through ui states. Close the window and
|
|
116
|
+
// remove the button from the screen, then show it and open the
|
|
117
|
+
// window. Set the DEBUG_cycle_ui_states boolean to false to disable.
|
|
118
|
+
let DEBUG_cycle_ui_states = false;
|
|
119
|
+
const period_seconds = 30;
|
|
120
|
+
if (DEBUG_cycle_ui_states) {
|
|
121
|
+
let seconds = 0;
|
|
122
|
+
setInterval(() => {
|
|
123
|
+
seconds = (seconds + 1) % period_seconds;
|
|
124
|
+
if (seconds === period_seconds - 4) chat.close();
|
|
125
|
+
if (seconds === period_seconds - 3) chat.hide();
|
|
126
|
+
if (seconds === period_seconds - 2) chat.show();
|
|
127
|
+
if (seconds === period_seconds - 1) chat.open();
|
|
128
|
+
}, 1000);
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
// localDevHelper();
|
|
132
132
|
</script>
|
|
133
133
|
</body>
|
|
134
134
|
</html>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700;900&display=swap");
|
|
2
|
+
|
|
3
|
+
$borderRadius: 40px;
|
|
4
|
+
|
|
5
|
+
.chatButton {
|
|
6
|
+
// CSS reset
|
|
7
|
+
all: unset;
|
|
8
|
+
/* `all:revert` does stuff to SVG properties that is maybe explained here (https://stackoverflow.com/a/46760690).
|
|
9
|
+
In our case it prevents the chat icon from being white. */
|
|
10
|
+
*:not(svg, svg *) {
|
|
11
|
+
all: revert;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
font-family: Poppins;
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
background-color: #202020;
|
|
18
|
+
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.5);
|
|
19
|
+
border: 2px solid white;
|
|
20
|
+
border-radius: $borderRadius;
|
|
21
|
+
color: white;
|
|
22
|
+
font-weight: 700;
|
|
23
|
+
font-size: 20px;
|
|
24
|
+
padding: 2px 15px;
|
|
25
|
+
margin-right: 7px;
|
|
26
|
+
user-select: none;
|
|
27
|
+
position: relative;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// TODO: the CSS reset undoes these styles. Figure out a better solution than !important on everything
|
|
31
|
+
// Possibly a specificity issue: things were working before commit 03f8503 split ChatButton out from InHouseLauncher
|
|
32
|
+
.chatButtonGlowingBorder {
|
|
33
|
+
position: absolute !important;
|
|
34
|
+
top: 50% !important;
|
|
35
|
+
left: 50% !important;
|
|
36
|
+
transform: translate(-50%, -50%) !important;
|
|
37
|
+
z-index: -1 !important;
|
|
38
|
+
border-radius: $borderRadius !important;
|
|
39
|
+
height: 125% !important;
|
|
40
|
+
width: 108% !important;
|
|
41
|
+
object-fit: fill !important;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.chatButtonWord {
|
|
45
|
+
margin-left: 7px !important;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.headerText {
|
|
49
|
+
font-weight: 600 !important;
|
|
50
|
+
font-size: 20px !important;
|
|
51
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import ChatIcon from "./ChatIcon";
|
|
3
|
+
import { glowBarWebm, glowBarMp4 } from "./assetUrls";
|
|
4
|
+
import styles from "./ChatButton.module.scss";
|
|
5
|
+
import classnames from "classnames";
|
|
6
|
+
|
|
7
|
+
interface ChatButtonProps {
|
|
8
|
+
text: string;
|
|
9
|
+
onClick?: React.MouseEventHandler;
|
|
10
|
+
className?: string;
|
|
11
|
+
useGlowingBorder?: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const ChatButton: React.FunctionComponent<ChatButtonProps> = ({
|
|
15
|
+
text,
|
|
16
|
+
onClick,
|
|
17
|
+
className,
|
|
18
|
+
useGlowingBorder = false,
|
|
19
|
+
}: ChatButtonProps) => (
|
|
20
|
+
<div className={classnames(styles.chatButton, className)} onClick={onClick}>
|
|
21
|
+
{useGlowingBorder && (
|
|
22
|
+
<video
|
|
23
|
+
className={styles.chatButtonGlowingBorder}
|
|
24
|
+
autoPlay
|
|
25
|
+
loop
|
|
26
|
+
muted
|
|
27
|
+
playsInline
|
|
28
|
+
>
|
|
29
|
+
<source src={glowBarWebm} type="video/webm" />
|
|
30
|
+
<source src={glowBarMp4} type="video/mp4" />
|
|
31
|
+
</video>
|
|
32
|
+
)}
|
|
33
|
+
<ChatIcon />
|
|
34
|
+
<span className={styles.chatButtonWord}>{text}</span>
|
|
35
|
+
</div>
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
export default ChatButton;
|
package/src/ChatIcon.tsx
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
interface ChatIconProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
const ChatIcon: React.FunctionComponent<ChatIconProps> = ({
|
|
8
|
+
className,
|
|
9
|
+
}: ChatIconProps) => (
|
|
10
|
+
<svg
|
|
11
|
+
className={className}
|
|
12
|
+
style={{ height: "14px" }}
|
|
13
|
+
width="24"
|
|
14
|
+
height="24"
|
|
15
|
+
viewBox="0 0 24 24"
|
|
16
|
+
fill="none"
|
|
17
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
18
|
+
>
|
|
19
|
+
<path
|
|
20
|
+
d="M13.2 10.8H6C5.68174 10.8 5.37652 10.9264 5.15147 11.1515C4.92643 11.3765 4.8 11.6817 4.8 12C4.8 12.3183 4.92643 12.6235 5.15147 12.8485C5.37652 13.0736 5.68174 13.2 6 13.2H13.2C13.5183 13.2 13.8235 13.0736 14.0485 12.8485C14.2736 12.6235 14.4 12.3183 14.4 12C14.4 11.6817 14.2736 11.3765 14.0485 11.1515C13.8235 10.9264 13.5183 10.8 13.2 10.8ZM18 6H6C5.68174 6 5.37652 6.12643 5.15147 6.35147C4.92643 6.57652 4.8 6.88174 4.8 7.2C4.8 7.51826 4.92643 7.82348 5.15147 8.04853C5.37652 8.27357 5.68174 8.4 6 8.4H18C18.3183 8.4 18.6235 8.27357 18.8485 8.04853C19.0736 7.82348 19.2 7.51826 19.2 7.2C19.2 6.88174 19.0736 6.57652 18.8485 6.35147C18.6235 6.12643 18.3183 6 18 6ZM20.4 0H3.6C2.64522 0 1.72955 0.379285 1.05442 1.05442C0.379285 1.72955 0 2.64522 0 3.6V15.6C0 16.5548 0.379285 17.4705 1.05442 18.1456C1.72955 18.8207 2.64522 19.2 3.6 19.2H17.508L21.948 23.652C22.0601 23.7632 22.1931 23.8512 22.3393 23.9109C22.4855 23.9706 22.6421 24.0009 22.8 24C22.9574 24.0041 23.1136 23.9712 23.256 23.904C23.4751 23.814 23.6627 23.6611 23.7951 23.4646C23.9275 23.2682 23.9988 23.0369 24 22.8V3.6C24 2.64522 23.6207 1.72955 22.9456 1.05442C22.2705 0.379285 21.3548 0 20.4 0ZM21.6 19.908L18.852 17.148C18.7399 17.0368 18.6069 16.9488 18.4607 16.8891C18.3145 16.8294 18.1579 16.7991 18 16.8H3.6C3.28174 16.8 2.97652 16.6736 2.75147 16.4485C2.52643 16.2235 2.4 15.9183 2.4 15.6V3.6C2.4 3.28174 2.52643 2.97652 2.75147 2.75147C2.97652 2.52643 3.28174 2.4 3.6 2.4H20.4C20.7183 2.4 21.0235 2.52643 21.2485 2.75147C21.4736 2.97652 21.6 3.28174 21.6 3.6V19.908Z"
|
|
21
|
+
fill="white"
|
|
22
|
+
/>
|
|
23
|
+
</svg>
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
export default ChatIcon;
|
package/src/DemoApp.tsx
CHANGED
|
@@ -2,26 +2,49 @@
|
|
|
2
2
|
|
|
3
3
|
$glowBarHeight: 11.2px;
|
|
4
4
|
$enterAnimationDuration: 0.5s;
|
|
5
|
-
$
|
|
5
|
+
$desktopZIndex: 100000; // on desktop, since the widget is small, it's ok to appear above a cookie banner
|
|
6
|
+
|
|
7
|
+
@keyframes slideInFromRight {
|
|
8
|
+
from {
|
|
9
|
+
transform: translateX(100%);
|
|
10
|
+
}
|
|
11
|
+
to {
|
|
12
|
+
transform: translateX(0);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
6
15
|
|
|
7
16
|
.launcher {
|
|
8
17
|
// CSS reset
|
|
9
18
|
all: initial;
|
|
10
|
-
//
|
|
11
|
-
*:not(.
|
|
19
|
+
// we want to isolate the app from the host page's styles, but not undo our own subcomponents' styles
|
|
20
|
+
*:not(svg, svg *, :global(.excludeFromReset)) {
|
|
12
21
|
all: revert;
|
|
13
22
|
}
|
|
14
23
|
|
|
24
|
+
&:not(.miniLauncher) {
|
|
25
|
+
display: flex;
|
|
26
|
+
justify-content: space-evenly;
|
|
27
|
+
align-items: center;
|
|
28
|
+
background-color: rgba(white, 0.8);
|
|
29
|
+
color: #202020;
|
|
30
|
+
backdrop-filter: blur(10px);
|
|
31
|
+
box-shadow: 0px 8px 8px 4px rgba(0, 0, 0, 0.25);
|
|
32
|
+
|
|
33
|
+
&.mobile {
|
|
34
|
+
width: 100%;
|
|
35
|
+
bottom: 0px;
|
|
36
|
+
padding: 5px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&.desktop {
|
|
40
|
+
width: 272px;
|
|
41
|
+
height: 112px;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
font-family: Poppins;
|
|
15
46
|
user-select: none;
|
|
16
47
|
position: fixed;
|
|
17
|
-
display: flex;
|
|
18
|
-
justify-content: space-evenly;
|
|
19
|
-
align-items: center;
|
|
20
|
-
color: #202020;
|
|
21
|
-
background-color: rgba(white, 0.8);
|
|
22
|
-
backdrop-filter: blur(10px);
|
|
23
|
-
box-shadow: 0px 8px 8px 4px rgba(0, 0, 0, 0.25);
|
|
24
|
-
font-family: Poppins;
|
|
25
48
|
|
|
26
49
|
&:hover {
|
|
27
50
|
background: radial-gradient(
|
|
@@ -31,101 +54,44 @@ $glowBarGif: url("https://s3.us-west-2.amazonaws.com/meetelise.com/HorizontalBar
|
|
|
31
54
|
);
|
|
32
55
|
}
|
|
33
56
|
|
|
34
|
-
&.mobile {
|
|
35
|
-
width: 100%;
|
|
36
|
-
bottom: 0px;
|
|
37
|
-
padding: 5px;
|
|
38
|
-
|
|
39
|
-
.content {
|
|
40
|
-
margin-top: calc($glowBarHeight + 8px);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
57
|
&.desktop {
|
|
45
|
-
width: 272px;
|
|
46
|
-
height: 112px;
|
|
47
58
|
right: 0px;
|
|
48
59
|
overflow: hidden;
|
|
49
60
|
border-radius: 10px 0px 0px 10px;
|
|
50
61
|
bottom: 40px;
|
|
51
|
-
z-index:
|
|
52
|
-
|
|
53
|
-
.content {
|
|
54
|
-
margin-top: calc($glowBarHeight);
|
|
55
|
-
}
|
|
62
|
+
z-index: $desktopZIndex;
|
|
56
63
|
|
|
57
64
|
&.firstMount {
|
|
58
|
-
animation:
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
@keyframes slideIn {
|
|
62
|
-
from {
|
|
63
|
-
transform: translateX(100%);
|
|
64
|
-
}
|
|
65
|
-
to {
|
|
66
|
-
transform: translateX(0);
|
|
67
|
-
}
|
|
65
|
+
animation: slideInFromRight $enterAnimationDuration;
|
|
68
66
|
}
|
|
69
67
|
}
|
|
70
68
|
|
|
71
69
|
.glowBar {
|
|
72
70
|
overflow: hidden;
|
|
73
|
-
background-image: $glowBarGif;
|
|
74
71
|
background-position: center;
|
|
75
72
|
position: absolute;
|
|
76
73
|
top: 0;
|
|
77
74
|
left: 0;
|
|
78
75
|
height: $glowBarHeight;
|
|
79
76
|
width: 100%;
|
|
77
|
+
object-fit: fill;
|
|
78
|
+
|
|
79
|
+
& + * {
|
|
80
|
+
margin-top: calc($glowBarHeight + 8px);
|
|
81
|
+
}
|
|
80
82
|
}
|
|
81
83
|
|
|
82
84
|
.content {
|
|
83
85
|
display: flex;
|
|
84
86
|
flex-direction: column;
|
|
85
87
|
align-items: center;
|
|
88
|
+
gap: 10px;
|
|
86
89
|
margin-bottom: 6px;
|
|
87
90
|
|
|
88
91
|
.header {
|
|
89
92
|
display: flex;
|
|
90
93
|
align-items: center;
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
$borderRadius: 40px;
|
|
94
|
-
|
|
95
|
-
.chatButton {
|
|
96
|
-
position: relative;
|
|
97
|
-
display: flex;
|
|
98
|
-
align-items: center;
|
|
99
|
-
background-color: #202020;
|
|
100
|
-
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.5);
|
|
101
|
-
border: 2px solid white;
|
|
102
|
-
border-radius: $borderRadius;
|
|
103
|
-
color: white;
|
|
104
|
-
font-weight: 700;
|
|
105
|
-
font-size: 20px;
|
|
106
|
-
padding: 2px 15px;
|
|
107
|
-
margin-right: 7px;
|
|
108
|
-
|
|
109
|
-
.chatButtonGlowingBorder {
|
|
110
|
-
position: absolute;
|
|
111
|
-
top: 50%;
|
|
112
|
-
left: 50%;
|
|
113
|
-
transform: translate(-50%, -50%);
|
|
114
|
-
z-index: -1;
|
|
115
|
-
background-image: $glowBarGif;
|
|
116
|
-
border-radius: $borderRadius;
|
|
117
|
-
height: 125%;
|
|
118
|
-
width: 108%;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.chatIcon {
|
|
122
|
-
height: 14px;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
.chatButtonWord {
|
|
126
|
-
margin-left: 7px;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
94
|
+
|
|
129
95
|
.headerText {
|
|
130
96
|
font-weight: 600;
|
|
131
97
|
font-size: 20px;
|
|
@@ -138,3 +104,36 @@ $glowBarGif: url("https://s3.us-west-2.amazonaws.com/meetelise.com/HorizontalBar
|
|
|
138
104
|
}
|
|
139
105
|
}
|
|
140
106
|
}
|
|
107
|
+
|
|
108
|
+
.miniLauncher {
|
|
109
|
+
display: flex;
|
|
110
|
+
align-items: center;
|
|
111
|
+
background-color: #202020;
|
|
112
|
+
position: fixed;
|
|
113
|
+
height: 35px;
|
|
114
|
+
|
|
115
|
+
&:hover {
|
|
116
|
+
background: radial-gradient(
|
|
117
|
+
36.85% 65.32% at 50% 106.31%,
|
|
118
|
+
#03ecc4 0%,
|
|
119
|
+
rgba(131, 129, 142, 1) 100%
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
&.firstMount {
|
|
124
|
+
animation: slideInFromRight $enterAnimationDuration;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
&.desktop {
|
|
128
|
+
padding-right: 20px;
|
|
129
|
+
right: 0px;
|
|
130
|
+
overflow: hidden;
|
|
131
|
+
bottom: 40px;
|
|
132
|
+
z-index: $desktopZIndex;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
&.mobile {
|
|
136
|
+
right: 10px;
|
|
137
|
+
bottom: 20px;
|
|
138
|
+
}
|
|
139
|
+
}
|
package/src/InHouseLauncher.tsx
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import classnames from "classnames";
|
|
3
|
+
import ChatButton from "./ChatButton";
|
|
4
|
+
import { glowBarWebm, glowBarMp4 } from "./assetUrls";
|
|
3
5
|
import styles from "./InHouseLauncher.module.scss";
|
|
4
6
|
|
|
5
7
|
interface InHouseLauncherProps {
|
|
@@ -8,6 +10,7 @@ interface InHouseLauncherProps {
|
|
|
8
10
|
firstMount: boolean;
|
|
9
11
|
backgroundColor: string;
|
|
10
12
|
textColor: string;
|
|
13
|
+
mini: boolean;
|
|
11
14
|
}
|
|
12
15
|
const InHouseLauncher: React.FunctionComponent<InHouseLauncherProps> = ({
|
|
13
16
|
onChatTapped,
|
|
@@ -15,7 +18,23 @@ const InHouseLauncher: React.FunctionComponent<InHouseLauncherProps> = ({
|
|
|
15
18
|
firstMount,
|
|
16
19
|
backgroundColor,
|
|
17
20
|
textColor,
|
|
21
|
+
mini,
|
|
18
22
|
}) => {
|
|
23
|
+
if (mini) {
|
|
24
|
+
return (
|
|
25
|
+
<ChatButton
|
|
26
|
+
className={classnames(
|
|
27
|
+
styles.miniLauncher,
|
|
28
|
+
"excludeFromReset",
|
|
29
|
+
mobile ? styles.mobile : styles.desktop,
|
|
30
|
+
{ [styles.firstMount]: firstMount }
|
|
31
|
+
)}
|
|
32
|
+
text="Ask a question"
|
|
33
|
+
onClick={onChatTapped}
|
|
34
|
+
/>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
19
38
|
return (
|
|
20
39
|
<div
|
|
21
40
|
className={classnames(
|
|
@@ -26,26 +45,17 @@ const InHouseLauncher: React.FunctionComponent<InHouseLauncherProps> = ({
|
|
|
26
45
|
style={{ backgroundColor, color: textColor }}
|
|
27
46
|
onClick={onChatTapped}
|
|
28
47
|
>
|
|
29
|
-
<
|
|
48
|
+
<video className={styles.glowBar} autoPlay loop muted playsInline>
|
|
49
|
+
<source src={glowBarWebm} type="video/webm" />
|
|
50
|
+
<source src={glowBarMp4} type="video/mp4" />
|
|
51
|
+
</video>
|
|
30
52
|
<div className={styles.content}>
|
|
31
53
|
<div className={styles.header}>
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
height="24"
|
|
38
|
-
viewBox="0 0 24 24"
|
|
39
|
-
fill="none"
|
|
40
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
41
|
-
>
|
|
42
|
-
<path
|
|
43
|
-
d="M13.2 10.8H6C5.68174 10.8 5.37652 10.9264 5.15147 11.1515C4.92643 11.3765 4.8 11.6817 4.8 12C4.8 12.3183 4.92643 12.6235 5.15147 12.8485C5.37652 13.0736 5.68174 13.2 6 13.2H13.2C13.5183 13.2 13.8235 13.0736 14.0485 12.8485C14.2736 12.6235 14.4 12.3183 14.4 12C14.4 11.6817 14.2736 11.3765 14.0485 11.1515C13.8235 10.9264 13.5183 10.8 13.2 10.8ZM18 6H6C5.68174 6 5.37652 6.12643 5.15147 6.35147C4.92643 6.57652 4.8 6.88174 4.8 7.2C4.8 7.51826 4.92643 7.82348 5.15147 8.04853C5.37652 8.27357 5.68174 8.4 6 8.4H18C18.3183 8.4 18.6235 8.27357 18.8485 8.04853C19.0736 7.82348 19.2 7.51826 19.2 7.2C19.2 6.88174 19.0736 6.57652 18.8485 6.35147C18.6235 6.12643 18.3183 6 18 6ZM20.4 0H3.6C2.64522 0 1.72955 0.379285 1.05442 1.05442C0.379285 1.72955 0 2.64522 0 3.6V15.6C0 16.5548 0.379285 17.4705 1.05442 18.1456C1.72955 18.8207 2.64522 19.2 3.6 19.2H17.508L21.948 23.652C22.0601 23.7632 22.1931 23.8512 22.3393 23.9109C22.4855 23.9706 22.6421 24.0009 22.8 24C22.9574 24.0041 23.1136 23.9712 23.256 23.904C23.4751 23.814 23.6627 23.6611 23.7951 23.4646C23.9275 23.2682 23.9988 23.0369 24 22.8V3.6C24 2.64522 23.6207 1.72955 22.9456 1.05442C22.2705 0.379285 21.3548 0 20.4 0ZM21.6 19.908L18.852 17.148C18.7399 17.0368 18.6069 16.9488 18.4607 16.8891C18.3145 16.8294 18.1579 16.7991 18 16.8H3.6C3.28174 16.8 2.97652 16.6736 2.75147 16.4485C2.52643 16.2235 2.4 15.9183 2.4 15.6V3.6C2.4 3.28174 2.52643 2.97652 2.75147 2.75147C2.97652 2.52643 3.28174 2.4 3.6 2.4H20.4C20.7183 2.4 21.0235 2.52643 21.2485 2.75147C21.4736 2.97652 21.6 3.28174 21.6 3.6V19.908Z"
|
|
44
|
-
fill="white"
|
|
45
|
-
/>
|
|
46
|
-
</svg>
|
|
47
|
-
<span className={styles.chatButtonWord}>Ask</span>
|
|
48
|
-
</div>
|
|
54
|
+
<ChatButton
|
|
55
|
+
text="Ask"
|
|
56
|
+
useGlowingBorder
|
|
57
|
+
className={"excludeFromReset"}
|
|
58
|
+
/>
|
|
49
59
|
<span className={styles.headerText}>a question</span>
|
|
50
60
|
</div>
|
|
51
61
|
<span className={styles.subtitle}>
|