favesalon-embed 1.0.1 → 1.0.3
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/dist/custom-elements/index.d.ts +24 -0
- package/dist/{cjs/_commonjsHelpers-5cfcba41.js → favesalon-embed/_commonjsHelpers-9bc404fc.js} +14 -6
- package/dist/{esm/_commonjsHelpers-098d5b27.js → favesalon-embed/_commonjsHelpers-a4f66ccd.js} +14 -2
- package/dist/{cjs/global-9073d10e.js → favesalon-embed/app-globals-437cc3f3.js} +15 -8
- package/dist/{esm/global-e1089ffd.js → favesalon-embed/app-globals-60769a2c.js} +16 -7
- package/dist/favesalon-embed/chat-box.entry.js +54 -0
- package/dist/favesalon-embed/chat-button.entry.js +51 -0
- package/dist/favesalon-embed/chat-form.entry.js +39 -0
- package/dist/favesalon-embed/chat-messages.entry.js +53 -0
- package/dist/favesalon-embed/chat-rooms.entry.js +17279 -0
- package/dist/favesalon-embed/css-shim-b7d3d95f.js +4 -0
- package/dist/favesalon-embed/dom-64053c71.js +73 -0
- package/dist/favesalon-embed/favesalon-embed.css +2433 -4
- package/dist/favesalon-embed/favesalon-embed.esm.js +148 -1
- package/dist/{collection/components/google-map/index.js → favesalon-embed/google-map.entry.js} +12 -54
- package/dist/{esm/index-80523fec.js → favesalon-embed/index-00b83e1c.js} +425 -15
- package/dist/favesalon-embed/index-04c09911.js +3371 -0
- package/dist/favesalon-embed/index-888e99e3.js +3371 -0
- package/dist/{cjs/index-7f190886.js → favesalon-embed/index-ac52896a.js} +454 -47
- package/dist/favesalon-embed/index.esm.js +1 -0
- package/dist/favesalon-embed/isObject-13b86c17.js +203 -0
- package/dist/favesalon-embed/relativeTime-15477f02.js +7 -0
- package/dist/favesalon-embed/relativeTime-268e64b0.js +7 -0
- package/dist/{esm → favesalon-embed}/salon-booking-modal.entry.js +1 -1
- package/dist/{esm → favesalon-embed}/salon-booking.entry.js +3 -3
- package/dist/{esm → favesalon-embed}/salon-gift-card-modal.entry.js +1 -1
- package/dist/{esm → favesalon-embed}/salon-gift-card.entry.js +3 -3
- package/dist/favesalon-embed/salon-info.entry.js +29 -0
- package/dist/{esm → favesalon-embed}/salon-latest-reviews.entry.js +4 -4
- package/dist/{collection/components/salon-latest-styles/index.js → favesalon-embed/salon-latest-styles.entry.js} +14 -99
- package/dist/{collection/components/salon-locations/index.js → favesalon-embed/salon-locations.entry.js} +15 -95
- package/dist/{esm → favesalon-embed}/salon-lookbook.entry.js +3 -3
- package/dist/{esm → favesalon-embed}/salon-ranking.entry.js +1 -1
- package/dist/{esm → favesalon-embed}/salon-reviews.entry.js +3 -3
- package/dist/{collection/components/salon-schedules/index.js → favesalon-embed/salon-schedules.entry.js} +14 -95
- package/dist/{esm → favesalon-embed}/salon-services.entry.js +3 -3
- package/dist/{esm → favesalon-embed}/salon-stylists.entry.js +3 -3
- package/dist/{custom-elements/index.js → favesalon-embed/services-55a87166.js} +2465 -7150
- package/dist/{cjs/services-125c82d8.js → favesalon-embed/services-7c46a2fd.js} +2465 -103
- package/dist/{esm/services-40a3e622.js → favesalon-embed/services-7cb8f2a6.js} +2469 -100
- package/dist/favesalon-embed/shadow-css-98135883.js +387 -0
- package/dist/{esm → favesalon-embed}/style-detail.entry.js +4 -4
- package/dist/{esm → favesalon-embed}/user-avatar.entry.js +13 -4
- package/dist/{esm/utils-e97485e0.js → favesalon-embed/utils-2c19db45.js} +6 -0
- package/dist/types/components/chat-box/index.d.ts +12 -0
- package/dist/types/components/chat-button/index.d.ts +0 -8
- package/dist/types/components/chat-form/index.d.ts +6 -0
- package/dist/types/components/chat-messages/index.d.ts +14 -0
- package/dist/types/components/chat-rooms/index.d.ts +12 -0
- package/dist/types/components/user-avatar/index.d.ts +2 -1
- package/dist/types/components.d.ts +84 -1
- package/dist/types/utils/utils.d.ts +1 -0
- package/package.json +1 -1
- package/dist/cjs/chat-button.cjs.entry.js +0 -118
- package/dist/cjs/colors-38421769.js +0 -69
- package/dist/cjs/favesalon-embed.cjs.js +0 -24
- package/dist/cjs/google-map_5.cjs.entry.js +0 -310
- package/dist/cjs/index-47c2a5f6.js +0 -1533
- package/dist/cjs/index.cjs.js +0 -2
- package/dist/cjs/loader.cjs.js +0 -23
- package/dist/cjs/relativeTime-3721080d.js +0 -9
- package/dist/cjs/salon-booking-modal.cjs.entry.js +0 -30
- package/dist/cjs/salon-booking.cjs.entry.js +0 -51
- package/dist/cjs/salon-gift-card-modal.cjs.entry.js +0 -29
- package/dist/cjs/salon-gift-card.cjs.entry.js +0 -51
- package/dist/cjs/salon-latest-reviews.cjs.entry.js +0 -97
- package/dist/cjs/salon-lookbook.cjs.entry.js +0 -222
- package/dist/cjs/salon-ranking.cjs.entry.js +0 -60
- package/dist/cjs/salon-reviews.cjs.entry.js +0 -193
- package/dist/cjs/salon-services.cjs.entry.js +0 -81
- package/dist/cjs/salon-stylists.cjs.entry.js +0 -118
- package/dist/cjs/style-detail.cjs.entry.js +0 -312
- package/dist/cjs/user-avatar.cjs.entry.js +0 -45
- package/dist/cjs/utils-c5a33b3c.js +0 -23
- package/dist/collection/collection-manifest.json +0 -29
- package/dist/collection/components/chat-button/index.css +0 -122
- package/dist/collection/components/chat-button/index.js +0 -218
- package/dist/collection/components/chat-conversation/index.js +0 -103
- package/dist/collection/components/google-map/assets/map--placeholder.jpeg +0 -0
- package/dist/collection/components/google-map/index.css +0 -5
- package/dist/collection/components/salon-booking/index.css +0 -30
- package/dist/collection/components/salon-booking/index.js +0 -126
- package/dist/collection/components/salon-booking/salon-booking-modal.js +0 -92
- package/dist/collection/components/salon-gift-card/index.css +0 -30
- package/dist/collection/components/salon-gift-card/index.js +0 -126
- package/dist/collection/components/salon-gift-card/salon-gift-card-modal.js +0 -73
- package/dist/collection/components/salon-info/index.css +0 -1
- package/dist/collection/components/salon-info/index.js +0 -77
- package/dist/collection/components/salon-latest-reviews/index.css +0 -11
- package/dist/collection/components/salon-latest-reviews/index.js +0 -163
- package/dist/collection/components/salon-latest-styles/index.css +0 -12
- package/dist/collection/components/salon-locations/index.css +0 -24
- package/dist/collection/components/salon-lookbook/index.css +0 -15
- package/dist/collection/components/salon-lookbook/index.js +0 -368
- package/dist/collection/components/salon-ranking/index.css +0 -3
- package/dist/collection/components/salon-ranking/index.js +0 -117
- package/dist/collection/components/salon-reviews/index.css +0 -18
- package/dist/collection/components/salon-reviews/index.js +0 -249
- package/dist/collection/components/salon-schedules/index.css +0 -18
- package/dist/collection/components/salon-services/index.css +0 -1
- package/dist/collection/components/salon-services/index.js +0 -146
- package/dist/collection/components/salon-stylists/index.css +0 -43
- package/dist/collection/components/salon-stylists/index.js +0 -184
- package/dist/collection/components/style-detail/index.css +0 -76
- package/dist/collection/components/style-detail/index.js +0 -386
- package/dist/collection/components/user-avatar/index.css +0 -0
- package/dist/collection/components/user-avatar/index.js +0 -134
- package/dist/collection/constants/colors.js +0 -65
- package/dist/collection/global/global.js +0 -8
- package/dist/collection/index.js +0 -1
- package/dist/collection/mocks/users.js +0 -10
- package/dist/collection/services/services.js +0 -295
- package/dist/collection/types/chat.js +0 -23
- package/dist/collection/types/common.js +0 -11
- package/dist/collection/types/review.js +0 -39
- package/dist/collection/types/salon.js +0 -58
- package/dist/collection/types/service.js +0 -24
- package/dist/collection/types/style.js +0 -128
- package/dist/collection/types/stylist.js +0 -30
- package/dist/collection/types/user.js +0 -10
- package/dist/collection/utils/utils.js +0 -20
- package/dist/esm/chat-button.entry.js +0 -114
- package/dist/esm/favesalon-embed.js +0 -19
- package/dist/esm/google-map_5.entry.js +0 -302
- package/dist/esm/index-3fae868e.js +0 -1506
- package/dist/esm/index.js +0 -1
- package/dist/esm/loader.js +0 -19
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/esm/relativeTime-cd452e6d.js +0 -7
- package/dist/favesalon-embed/p-019c5ccd.entry.js +0 -1
- package/dist/favesalon-embed/p-083a8821.entry.js +0 -1
- package/dist/favesalon-embed/p-0d0ed9ea.entry.js +0 -1
- package/dist/favesalon-embed/p-119db8de.entry.js +0 -1
- package/dist/favesalon-embed/p-1432c51b.entry.js +0 -1
- package/dist/favesalon-embed/p-22093506.entry.js +0 -1
- package/dist/favesalon-embed/p-32b314e9.js +0 -2
- package/dist/favesalon-embed/p-47e646f8.js +0 -1
- package/dist/favesalon-embed/p-4a5eca9a.js +0 -6
- package/dist/favesalon-embed/p-58d2e9be.js +0 -1
- package/dist/favesalon-embed/p-71404b6a.entry.js +0 -1
- package/dist/favesalon-embed/p-857c3a61.entry.js +0 -1
- package/dist/favesalon-embed/p-99ec77f7.entry.js +0 -1
- package/dist/favesalon-embed/p-a33331cc.js +0 -1
- package/dist/favesalon-embed/p-b0c3673a.entry.js +0 -1
- package/dist/favesalon-embed/p-b287b1ea.entry.js +0 -1
- package/dist/favesalon-embed/p-b3af7842.entry.js +0 -1
- package/dist/favesalon-embed/p-b630ae68.js +0 -1580
- package/dist/favesalon-embed/p-ce2c1c9a.entry.js +0 -1
- package/dist/favesalon-embed/p-d6083940.js +0 -1
- package/dist/favesalon-embed/p-d9b7ad58.entry.js +0 -1
- package/dist/favesalon-embed/p-fc9a5551.js +0 -6
- package/dist/index.cjs.js +0 -1
- package/dist/index.js +0 -1
- package/dist/types/components/chat-conversation/index.d.ts +0 -0
- /package/dist/{esm → favesalon-embed}/colors-ea36347a.js +0 -0
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
import dayjs from 'dayjs';
|
|
2
|
-
import { h } from '@stencil/core';
|
|
3
|
-
import HttpService from '../../services/services';
|
|
4
|
-
import relativeTime from 'dayjs/plugin/relativeTime';
|
|
5
|
-
dayjs.extend(relativeTime);
|
|
6
|
-
export class ChatButton {
|
|
7
|
-
constructor() {
|
|
8
|
-
this.onSubmitMessage = async () => {
|
|
9
|
-
try {
|
|
10
|
-
const elNewMessage = document.getElementById('chat-form--input');
|
|
11
|
-
await HttpService().sendChatMessage({
|
|
12
|
-
message: elNewMessage.value,
|
|
13
|
-
senderId: this.senderInfo.id,
|
|
14
|
-
chatRoomId: this.chatRoom.uid,
|
|
15
|
-
});
|
|
16
|
-
elNewMessage.value = '';
|
|
17
|
-
}
|
|
18
|
-
catch (error) { }
|
|
19
|
-
};
|
|
20
|
-
this.markMessagesAsRead = async () => {
|
|
21
|
-
try {
|
|
22
|
-
const unreadMessages = (this.chatMessages || []).filter(message => {
|
|
23
|
-
return Boolean(message.unRead) && message.senderId !== this.senderInfo.id;
|
|
24
|
-
});
|
|
25
|
-
if (unreadMessages.length > 0) {
|
|
26
|
-
await HttpService().markMessagesAsRead(this.chatRoom.uid, unreadMessages);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
catch (e) { }
|
|
30
|
-
};
|
|
31
|
-
this.scrollToLastMessage = () => {
|
|
32
|
-
const targetElement = document.getElementById('chat--last-message');
|
|
33
|
-
targetElement && targetElement.scrollIntoView();
|
|
34
|
-
};
|
|
35
|
-
this.renderMessage = (chatMessage) => {
|
|
36
|
-
const { message, senderId, timestamp } = chatMessage;
|
|
37
|
-
const isOwner = this.senderInfo.id === senderId;
|
|
38
|
-
return (h("div", { class: `chat-message ${isOwner ? 'is-owner' : 'is-guest'}` }, h("div", { class: "chat-message--meta" }, h("user-avatar", { size: 40, shortName: String(((isOwner ? this.senderInfo : this.receiverInfo) || {}).fullName || '').charAt(0), avatar: ((isOwner ? this.senderInfo : this.receiverInfo) || {}).avatar }), h("div", { class: "chat-message--content" }, h("div", { class: "chat-message--message" }, message), timestamp && (h("div", { class: "chat-conversation--time" }, dayjs(timestamp).format('HH:mm')))))));
|
|
39
|
-
};
|
|
40
|
-
this.renderMessages = () => {
|
|
41
|
-
const isEmpty = (this.chatMessages || []).length === 0;
|
|
42
|
-
return (h("div", { class: "chat-messages" }, !isEmpty && this.chatMessages.map(this.renderMessage), isEmpty && (h("div", { style: { paddingTop: '48px', textAlign: 'center' } }, h("i", { class: "ri-bubble-chart-line", style: { fontSize: '48px' } }), h("div", { style: { color: 'rgba(0, 0, 0, 0.45)', marginTop: '8px' } }, "Enter a message on below to get starting"))), h("div", { id: "chat--last-message" })));
|
|
43
|
-
};
|
|
44
|
-
this.primaryColor = undefined;
|
|
45
|
-
this.accessToken = undefined;
|
|
46
|
-
this.senderId = undefined;
|
|
47
|
-
this.receiverId = undefined;
|
|
48
|
-
this.senderInfo = {};
|
|
49
|
-
this.receiverInfo = {};
|
|
50
|
-
this.chatRoom = undefined;
|
|
51
|
-
this.chatMessages = undefined;
|
|
52
|
-
this.isChatExpanded = undefined;
|
|
53
|
-
}
|
|
54
|
-
componentWillLoad() {
|
|
55
|
-
this.fetchData();
|
|
56
|
-
}
|
|
57
|
-
componentDidLoad() {
|
|
58
|
-
this.scrollToLastMessage();
|
|
59
|
-
this.markMessagesAsRead();
|
|
60
|
-
}
|
|
61
|
-
componentWillUpdate() {
|
|
62
|
-
this.scrollToLastMessage();
|
|
63
|
-
}
|
|
64
|
-
async fetchData() {
|
|
65
|
-
try {
|
|
66
|
-
this.chatRoom = await HttpService().createChatRoom(this.receiverId, this.accessToken);
|
|
67
|
-
if (this.chatRoom) {
|
|
68
|
-
HttpService().fetchChatMessages(this.chatRoom.uid, (messages) => this.chatMessages = messages);
|
|
69
|
-
this.senderInfo = this.chatRoom.members.find(user => user.id === Number(this.senderId));
|
|
70
|
-
this.receiverInfo = this.chatRoom.members.find(user => user.id === Number(this.receiverId));
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
catch (e) { }
|
|
74
|
-
}
|
|
75
|
-
renderForm() {
|
|
76
|
-
return (h("div", { style: { display: 'flex', height: '100%' } }, h("input", { id: "chat-form--input", type: "text", class: "form-control", placeholder: "Enter a message...", style: { border: 'none' }, onKeyPress: (evt) => {
|
|
77
|
-
if (evt.key === 'Enter') {
|
|
78
|
-
evt.preventDefault();
|
|
79
|
-
this.onSubmitMessage();
|
|
80
|
-
}
|
|
81
|
-
} }), h("button", { type: "button", class: "btn btn-link", style: {
|
|
82
|
-
textDecoration: 'none',
|
|
83
|
-
display: 'flex',
|
|
84
|
-
height: '100%',
|
|
85
|
-
alignItems: 'center',
|
|
86
|
-
}, onClick: () => this.onSubmitMessage() }, h("i", { class: "ri-send-plane-2-line", style: { color: '#111', fontSize: '24px', lineHeight: '1' } }))));
|
|
87
|
-
}
|
|
88
|
-
render() {
|
|
89
|
-
const unreadMessages = (this.chatMessages || []).filter(message => {
|
|
90
|
-
return Boolean(message.unRead) && message.senderId !== this.senderInfo.id;
|
|
91
|
-
});
|
|
92
|
-
return (h("div", null, h("div", { class: "chat-button--indicator", onClick: () => this.isChatExpanded = true }, unreadMessages.length > 0 && h("span", { class: "chat-button--counter" })), h("div", { class: "chat-box", style: this.isChatExpanded ? {} : { display: 'none' } }, h("div", { class: "chat-box--header", style: {
|
|
93
|
-
backgroundColor: this.primaryColor || '#f05a61',
|
|
94
|
-
} }, h("h3", { class: "chat-box--header-title" }, "Chat"), h("div", { class: "salon-modal--close", onClick: () => this.isChatExpanded = false, style: { position: 'static' } })), h("div", { style: {
|
|
95
|
-
flexShrink: '1',
|
|
96
|
-
flexGrow: '1',
|
|
97
|
-
overflowY: 'auto',
|
|
98
|
-
padding: '16px',
|
|
99
|
-
} }, this.renderMessages()), h("div", { style: {
|
|
100
|
-
height: '50px',
|
|
101
|
-
minHeight: '50px',
|
|
102
|
-
paddingTop: '1',
|
|
103
|
-
borderTop: '1px solid rgb(245, 245, 245)',
|
|
104
|
-
} }, this.renderForm()))));
|
|
105
|
-
}
|
|
106
|
-
static get is() { return "chat-button"; }
|
|
107
|
-
static get originalStyleUrls() {
|
|
108
|
-
return {
|
|
109
|
-
"$": ["index.css"]
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
static get styleUrls() {
|
|
113
|
-
return {
|
|
114
|
-
"$": ["index.css"]
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
static get properties() {
|
|
118
|
-
return {
|
|
119
|
-
"primaryColor": {
|
|
120
|
-
"type": "string",
|
|
121
|
-
"mutable": false,
|
|
122
|
-
"complexType": {
|
|
123
|
-
"original": "string",
|
|
124
|
-
"resolved": "string",
|
|
125
|
-
"references": {}
|
|
126
|
-
},
|
|
127
|
-
"required": false,
|
|
128
|
-
"optional": false,
|
|
129
|
-
"docs": {
|
|
130
|
-
"tags": [],
|
|
131
|
-
"text": ""
|
|
132
|
-
},
|
|
133
|
-
"attribute": "primary-color",
|
|
134
|
-
"reflect": false
|
|
135
|
-
},
|
|
136
|
-
"accessToken": {
|
|
137
|
-
"type": "string",
|
|
138
|
-
"mutable": false,
|
|
139
|
-
"complexType": {
|
|
140
|
-
"original": "string",
|
|
141
|
-
"resolved": "string",
|
|
142
|
-
"references": {}
|
|
143
|
-
},
|
|
144
|
-
"required": false,
|
|
145
|
-
"optional": false,
|
|
146
|
-
"docs": {
|
|
147
|
-
"tags": [],
|
|
148
|
-
"text": ""
|
|
149
|
-
},
|
|
150
|
-
"attribute": "access-token",
|
|
151
|
-
"reflect": false
|
|
152
|
-
},
|
|
153
|
-
"senderId": {
|
|
154
|
-
"type": "string",
|
|
155
|
-
"mutable": false,
|
|
156
|
-
"complexType": {
|
|
157
|
-
"original": "string",
|
|
158
|
-
"resolved": "string",
|
|
159
|
-
"references": {}
|
|
160
|
-
},
|
|
161
|
-
"required": false,
|
|
162
|
-
"optional": false,
|
|
163
|
-
"docs": {
|
|
164
|
-
"tags": [],
|
|
165
|
-
"text": ""
|
|
166
|
-
},
|
|
167
|
-
"attribute": "sender-id",
|
|
168
|
-
"reflect": false
|
|
169
|
-
},
|
|
170
|
-
"receiverId": {
|
|
171
|
-
"type": "string",
|
|
172
|
-
"mutable": false,
|
|
173
|
-
"complexType": {
|
|
174
|
-
"original": "string",
|
|
175
|
-
"resolved": "string",
|
|
176
|
-
"references": {}
|
|
177
|
-
},
|
|
178
|
-
"required": false,
|
|
179
|
-
"optional": false,
|
|
180
|
-
"docs": {
|
|
181
|
-
"tags": [],
|
|
182
|
-
"text": ""
|
|
183
|
-
},
|
|
184
|
-
"attribute": "receiver-id",
|
|
185
|
-
"reflect": false
|
|
186
|
-
}
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
static get states() {
|
|
190
|
-
return {
|
|
191
|
-
"senderInfo": {},
|
|
192
|
-
"receiverInfo": {},
|
|
193
|
-
"chatRoom": {},
|
|
194
|
-
"chatMessages": {},
|
|
195
|
-
"isChatExpanded": {}
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
static get methods() {
|
|
199
|
-
return {
|
|
200
|
-
"fetchData": {
|
|
201
|
-
"complexType": {
|
|
202
|
-
"signature": "() => Promise<void>",
|
|
203
|
-
"parameters": [],
|
|
204
|
-
"references": {
|
|
205
|
-
"Promise": {
|
|
206
|
-
"location": "global"
|
|
207
|
-
}
|
|
208
|
-
},
|
|
209
|
-
"return": "Promise<void>"
|
|
210
|
-
},
|
|
211
|
-
"docs": {
|
|
212
|
-
"text": "",
|
|
213
|
-
"tags": []
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
};
|
|
217
|
-
}
|
|
218
|
-
}
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
// import { Component, Prop, h, Method, State } from '@stencil/core';
|
|
2
|
-
// import { User } from '../../types/user';
|
|
3
|
-
// import { ChatMessage, ChatRoom } from '../../types/chat';
|
|
4
|
-
// import HttpService from '../../services/services';
|
|
5
|
-
// @Component({
|
|
6
|
-
// tag: 'chat-conversation',
|
|
7
|
-
// styleUrl: 'index.css',
|
|
8
|
-
// })
|
|
9
|
-
// export class ChatButton {
|
|
10
|
-
// @Prop() primaryColor: string;
|
|
11
|
-
// @Prop() accessToken: string;
|
|
12
|
-
// @Prop() sender: User;
|
|
13
|
-
// @Prop() receiver: User;
|
|
14
|
-
// @State() chatRoom: ChatRoom;
|
|
15
|
-
// @State() chatMessages: ChatMessage[];
|
|
16
|
-
// componentWillLoad() {
|
|
17
|
-
// this.senderInfo = this.sender ? JSON.parse(this.sender) : null;
|
|
18
|
-
// this.receiverInfo = this.receiver ? JSON.parse(this.receiver) : null;
|
|
19
|
-
// this.fetchData();
|
|
20
|
-
// }
|
|
21
|
-
// @Method()
|
|
22
|
-
// async fetchData() {
|
|
23
|
-
// try {
|
|
24
|
-
// const chatRooms: ChatRoom[] = await HttpService().fetchChatRooms(this.accessToken);
|
|
25
|
-
// this.chatRoom = (chatRooms || []).find(chatRoom => {
|
|
26
|
-
// return chatRoom.members.find(user => user.id === this.receiverInfo.id);
|
|
27
|
-
// });
|
|
28
|
-
// if (this.chatRoom) {
|
|
29
|
-
// HttpService().fetchChatMessages(this.chatRoom.uid, (messages) => this.chatMessages = messages);
|
|
30
|
-
// }
|
|
31
|
-
// } catch(e) {}
|
|
32
|
-
// }
|
|
33
|
-
// render() {
|
|
34
|
-
// return (
|
|
35
|
-
// <div>
|
|
36
|
-
// <div
|
|
37
|
-
// class="chat-button--indicator"
|
|
38
|
-
// onClick={() => this.isChatExpanded = true}
|
|
39
|
-
// >
|
|
40
|
-
// <span class="chat-button--counter"></span>
|
|
41
|
-
// </div>
|
|
42
|
-
// <div
|
|
43
|
-
// class="chat-box"
|
|
44
|
-
// style={this.isChatExpanded ? {} : { display: 'none' }}
|
|
45
|
-
// >
|
|
46
|
-
// <div style={{
|
|
47
|
-
// backgroundColor: this.primaryColor || '#f05a61',
|
|
48
|
-
// display: 'flex',
|
|
49
|
-
// justifyContent: 'space-between',
|
|
50
|
-
// padding: '16px',
|
|
51
|
-
// position: 'relative',
|
|
52
|
-
// borderRadius: '8px 8px 0px 0px',
|
|
53
|
-
// }}>
|
|
54
|
-
// <h3 style={{
|
|
55
|
-
// color: '#fff',
|
|
56
|
-
// fontSize: '20px',
|
|
57
|
-
// fontWeight: '600',
|
|
58
|
-
// lineHeight: '1',
|
|
59
|
-
// display: 'flex',
|
|
60
|
-
// alignItems: 'center',
|
|
61
|
-
// justifyContent: 'space-between',
|
|
62
|
-
// margin: '0',
|
|
63
|
-
// }}>Chat</h3>
|
|
64
|
-
// <div
|
|
65
|
-
// class="salon-modal--close"
|
|
66
|
-
// onClick={() => this.isChatExpanded = false}
|
|
67
|
-
// style={{ position: 'static' }}
|
|
68
|
-
// />
|
|
69
|
-
// </div>
|
|
70
|
-
// <div style={{
|
|
71
|
-
// flexShrink: '1',
|
|
72
|
-
// flexGrow: '1',
|
|
73
|
-
// display: 'flex',
|
|
74
|
-
// flexDirection: 'column',
|
|
75
|
-
// }}>
|
|
76
|
-
// <div style={{ padding: '16px', flexGrow: '1', flexShrink: '1' }}>
|
|
77
|
-
// {/* <ChatConversation
|
|
78
|
-
// sender={senderUser}
|
|
79
|
-
// receiver={receiverUser}
|
|
80
|
-
// chatRoom={currentChatRoom}
|
|
81
|
-
// chatMessages={messages || []}
|
|
82
|
-
// /> */}
|
|
83
|
-
// ChatConversation
|
|
84
|
-
// </div>
|
|
85
|
-
// <div style={{
|
|
86
|
-
// height: '50px',
|
|
87
|
-
// paddingTop: '1',
|
|
88
|
-
// borderTop: '1px solid rgb(245, 245, 245)',
|
|
89
|
-
// }}>
|
|
90
|
-
// {/* <ChatForm
|
|
91
|
-
// sender={senderUser}
|
|
92
|
-
// receiver={receiverUser}
|
|
93
|
-
// chatRoom={currentChatRoom}
|
|
94
|
-
// onSendMessageSuccess={(chatMessage) => {}}
|
|
95
|
-
// /> */}
|
|
96
|
-
// Chat form
|
|
97
|
-
// </div>
|
|
98
|
-
// </div>
|
|
99
|
-
// </div>
|
|
100
|
-
// </div>
|
|
101
|
-
// );
|
|
102
|
-
// }
|
|
103
|
-
// }
|
|
Binary file
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
.salon-modal.salon-modal--booking:before {
|
|
2
|
-
display: none;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.salon-modal.salon-modal--booking .salon-modal--inner,
|
|
6
|
-
.salon-modal.salon-modal--booking .salon-modal--content {
|
|
7
|
-
max-width: none;
|
|
8
|
-
width: 100%;
|
|
9
|
-
height: 100%;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.salon-modal.salon-modal--booking .salon-modal--close {
|
|
13
|
-
background-color: #EFEFEF;
|
|
14
|
-
width: 40px;
|
|
15
|
-
height: 40px;
|
|
16
|
-
right: 16px;
|
|
17
|
-
top: 16px;
|
|
18
|
-
|
|
19
|
-
-moz-border-radius: 50px;
|
|
20
|
-
-webkit-border-radius: 50px;
|
|
21
|
-
border-radius: 50px;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
@media (min-width: 768px) {
|
|
26
|
-
.salon-modal.salon-modal--booking .salon-modal--close {
|
|
27
|
-
right: 20px;
|
|
28
|
-
top: 20px;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import { h } from '@stencil/core';
|
|
2
|
-
import Color from 'color';
|
|
3
|
-
import { css } from 'glamor';
|
|
4
|
-
import { Colors } from '../../constants/colors';
|
|
5
|
-
export class SalonBooking {
|
|
6
|
-
constructor() {
|
|
7
|
-
this.salonId = undefined;
|
|
8
|
-
this.buttonClass = '';
|
|
9
|
-
this.buttonText = 'Book now';
|
|
10
|
-
this.primaryColor = Colors.Primary;
|
|
11
|
-
}
|
|
12
|
-
openModal() {
|
|
13
|
-
const elBookingModal = document.createElement('div');
|
|
14
|
-
elBookingModal.innerHTML = `
|
|
15
|
-
<salon-booking-modal
|
|
16
|
-
salon-id=${this.salonId}
|
|
17
|
-
primary-color=${this.primaryColor}
|
|
18
|
-
></salon-booking-modal>
|
|
19
|
-
`;
|
|
20
|
-
document.body.appendChild(elBookingModal);
|
|
21
|
-
}
|
|
22
|
-
render() {
|
|
23
|
-
const buttonClass = this.buttonClass || 'btn btn-primary';
|
|
24
|
-
let buttonStyle = {};
|
|
25
|
-
if (!this.buttonClass) {
|
|
26
|
-
const primaryColor = Color(this.primaryColor);
|
|
27
|
-
const primaryColorHover = primaryColor.darken(0.05);
|
|
28
|
-
buttonStyle = css({
|
|
29
|
-
backgroundColor: this.primaryColor,
|
|
30
|
-
borderColor: this.primaryColor,
|
|
31
|
-
color: primaryColor.isLight() ? Colors.Black01 : Colors.White,
|
|
32
|
-
':hover': {
|
|
33
|
-
backgroundColor: primaryColorHover,
|
|
34
|
-
borderColor: primaryColorHover,
|
|
35
|
-
},
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
return (h("div", { class: "salon-booking" }, h("div", { class: "salon-booking--button" }, h("button", Object.assign({ type: "button", class: buttonClass, onClick: () => this.openModal() }, buttonStyle), this.buttonText))));
|
|
39
|
-
}
|
|
40
|
-
static get is() { return "salon-booking"; }
|
|
41
|
-
static get originalStyleUrls() {
|
|
42
|
-
return {
|
|
43
|
-
"$": ["index.css"]
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
static get styleUrls() {
|
|
47
|
-
return {
|
|
48
|
-
"$": ["index.css"]
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
static get properties() {
|
|
52
|
-
return {
|
|
53
|
-
"salonId": {
|
|
54
|
-
"type": "number",
|
|
55
|
-
"mutable": false,
|
|
56
|
-
"complexType": {
|
|
57
|
-
"original": "number",
|
|
58
|
-
"resolved": "number",
|
|
59
|
-
"references": {}
|
|
60
|
-
},
|
|
61
|
-
"required": false,
|
|
62
|
-
"optional": false,
|
|
63
|
-
"docs": {
|
|
64
|
-
"tags": [],
|
|
65
|
-
"text": ""
|
|
66
|
-
},
|
|
67
|
-
"attribute": "salon-id",
|
|
68
|
-
"reflect": false
|
|
69
|
-
},
|
|
70
|
-
"buttonClass": {
|
|
71
|
-
"type": "string",
|
|
72
|
-
"mutable": false,
|
|
73
|
-
"complexType": {
|
|
74
|
-
"original": "string",
|
|
75
|
-
"resolved": "string",
|
|
76
|
-
"references": {}
|
|
77
|
-
},
|
|
78
|
-
"required": false,
|
|
79
|
-
"optional": false,
|
|
80
|
-
"docs": {
|
|
81
|
-
"tags": [],
|
|
82
|
-
"text": ""
|
|
83
|
-
},
|
|
84
|
-
"attribute": "button-class",
|
|
85
|
-
"reflect": false,
|
|
86
|
-
"defaultValue": "''"
|
|
87
|
-
},
|
|
88
|
-
"buttonText": {
|
|
89
|
-
"type": "string",
|
|
90
|
-
"mutable": false,
|
|
91
|
-
"complexType": {
|
|
92
|
-
"original": "string",
|
|
93
|
-
"resolved": "string",
|
|
94
|
-
"references": {}
|
|
95
|
-
},
|
|
96
|
-
"required": false,
|
|
97
|
-
"optional": false,
|
|
98
|
-
"docs": {
|
|
99
|
-
"tags": [],
|
|
100
|
-
"text": ""
|
|
101
|
-
},
|
|
102
|
-
"attribute": "button-text",
|
|
103
|
-
"reflect": false,
|
|
104
|
-
"defaultValue": "'Book now'"
|
|
105
|
-
},
|
|
106
|
-
"primaryColor": {
|
|
107
|
-
"type": "string",
|
|
108
|
-
"mutable": false,
|
|
109
|
-
"complexType": {
|
|
110
|
-
"original": "string",
|
|
111
|
-
"resolved": "string",
|
|
112
|
-
"references": {}
|
|
113
|
-
},
|
|
114
|
-
"required": false,
|
|
115
|
-
"optional": false,
|
|
116
|
-
"docs": {
|
|
117
|
-
"tags": [],
|
|
118
|
-
"text": ""
|
|
119
|
-
},
|
|
120
|
-
"attribute": "primary-color",
|
|
121
|
-
"reflect": false,
|
|
122
|
-
"defaultValue": "Colors.Primary"
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { h } from '@stencil/core';
|
|
2
|
-
import { Colors } from '../../constants/colors';
|
|
3
|
-
export class SalonBookingModal {
|
|
4
|
-
constructor() {
|
|
5
|
-
this.salonId = undefined;
|
|
6
|
-
this.primaryColor = Colors.Primary;
|
|
7
|
-
this.redirectUrl = window.btoa(window.location.href);
|
|
8
|
-
this.isModalOpen = true;
|
|
9
|
-
}
|
|
10
|
-
closeModal() {
|
|
11
|
-
this.isModalOpen = false;
|
|
12
|
-
const el = document.querySelector('salon-booking-modal');
|
|
13
|
-
el.remove();
|
|
14
|
-
}
|
|
15
|
-
render() {
|
|
16
|
-
const primaryColor = this.primaryColor.split('#')[1] || 'd47b99';
|
|
17
|
-
return (h("div", { class: "salon-booking--modal" }, this.isModalOpen && (h("div", { class: "salon-modal salon-modal--booking" }, h("div", { class: "salon-modal--backdrop", onClick: () => this.closeModal() }), h("div", { class: "salon-modal--close", onClick: () => this.closeModal() }), h("div", { class: "salon-modal--inner" }, h("div", { class: "salon-modal--content" }, h("iframe", { height: "100%", width: "100%", style: { border: 'none', display: 'block', height: '100%' }, src: `https://www.favesalon.com/r/booking?salonId=${this.salonId}&primaryColor=${primaryColor}&closeAble=false` })))))));
|
|
18
|
-
}
|
|
19
|
-
static get is() { return "salon-booking-modal"; }
|
|
20
|
-
static get originalStyleUrls() {
|
|
21
|
-
return {
|
|
22
|
-
"$": ["index.css"]
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
static get styleUrls() {
|
|
26
|
-
return {
|
|
27
|
-
"$": ["index.css"]
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
static get properties() {
|
|
31
|
-
return {
|
|
32
|
-
"salonId": {
|
|
33
|
-
"type": "number",
|
|
34
|
-
"mutable": false,
|
|
35
|
-
"complexType": {
|
|
36
|
-
"original": "number",
|
|
37
|
-
"resolved": "number",
|
|
38
|
-
"references": {}
|
|
39
|
-
},
|
|
40
|
-
"required": false,
|
|
41
|
-
"optional": false,
|
|
42
|
-
"docs": {
|
|
43
|
-
"tags": [],
|
|
44
|
-
"text": ""
|
|
45
|
-
},
|
|
46
|
-
"attribute": "salon-id",
|
|
47
|
-
"reflect": false
|
|
48
|
-
},
|
|
49
|
-
"primaryColor": {
|
|
50
|
-
"type": "string",
|
|
51
|
-
"mutable": false,
|
|
52
|
-
"complexType": {
|
|
53
|
-
"original": "string",
|
|
54
|
-
"resolved": "string",
|
|
55
|
-
"references": {}
|
|
56
|
-
},
|
|
57
|
-
"required": false,
|
|
58
|
-
"optional": false,
|
|
59
|
-
"docs": {
|
|
60
|
-
"tags": [],
|
|
61
|
-
"text": ""
|
|
62
|
-
},
|
|
63
|
-
"attribute": "primary-color",
|
|
64
|
-
"reflect": false,
|
|
65
|
-
"defaultValue": "Colors.Primary"
|
|
66
|
-
},
|
|
67
|
-
"redirectUrl": {
|
|
68
|
-
"type": "string",
|
|
69
|
-
"mutable": false,
|
|
70
|
-
"complexType": {
|
|
71
|
-
"original": "string",
|
|
72
|
-
"resolved": "string",
|
|
73
|
-
"references": {}
|
|
74
|
-
},
|
|
75
|
-
"required": false,
|
|
76
|
-
"optional": false,
|
|
77
|
-
"docs": {
|
|
78
|
-
"tags": [],
|
|
79
|
-
"text": ""
|
|
80
|
-
},
|
|
81
|
-
"attribute": "redirect-url",
|
|
82
|
-
"reflect": false,
|
|
83
|
-
"defaultValue": "window.btoa(window.location.href)"
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
static get states() {
|
|
88
|
-
return {
|
|
89
|
-
"isModalOpen": {}
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
.salon-modal.salon-modal--gift-card:before {
|
|
2
|
-
display: none;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.salon-modal.salon-modal--gift-card .salon-modal--inner,
|
|
6
|
-
.salon-modal.salon-modal--gift-card .salon-modal--content {
|
|
7
|
-
max-width: none;
|
|
8
|
-
width: 100%;
|
|
9
|
-
height: 100%;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.salon-modal.salon-modal--gift-card .salon-modal--close {
|
|
13
|
-
background-color: #EFEFEF;
|
|
14
|
-
width: 40px;
|
|
15
|
-
height: 40px;
|
|
16
|
-
right: 16px;
|
|
17
|
-
top: 16px;
|
|
18
|
-
|
|
19
|
-
-moz-border-radius: 50px;
|
|
20
|
-
-webkit-border-radius: 50px;
|
|
21
|
-
border-radius: 50px;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
@media (min-width: 768px) {
|
|
26
|
-
.salon-modal.salon-modal--gift-card .salon-modal--close {
|
|
27
|
-
right: 20px;
|
|
28
|
-
top: 20px;
|
|
29
|
-
}
|
|
30
|
-
}
|