beem-component 1.7.0 → 1.7.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/assets/Google_Messages_logo.png +0 -0
- package/dist/components/ChatComponents/ChatBody/FeedPostComments.js +72 -0
- package/dist/components/ChatComponents/ChatBody/chatBody.js +63 -44
- package/dist/components/ChatComponents/ChatBody/chatBody.stories.js +9 -1
- package/dist/components/ProfileIcon/ProfileIcon.js +6 -0
- package/package.json +1 -1
- package/src/App.js +21 -3
- package/src/lib/assets/Google_Messages_logo.png +0 -0
- package/src/lib/components/ChatComponents/ChatBody/FeedPostComments.js +77 -0
- package/src/lib/components/ChatComponents/ChatBody/chatBody.js +19 -3
- package/src/lib/components/ChatComponents/ChatBody/chatBody.stories.js +9 -1
- package/src/lib/components/ProfileIcon/ProfileIcon.js +4 -0
|
Binary file
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.BmFeedPostComments = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
11
|
+
|
|
12
|
+
var _cards = _interopRequireDefault(require("../../Cards/cards"));
|
|
13
|
+
|
|
14
|
+
var _excluded = ["story", "state"];
|
|
15
|
+
|
|
16
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
20
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
21
|
+
|
|
22
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
23
|
+
|
|
24
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
25
|
+
|
|
26
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
27
|
+
|
|
28
|
+
var Image = _styledComponents.default.img(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n max-width: 30%;\n width: 30%;\n"])));
|
|
29
|
+
|
|
30
|
+
var LinkText = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n max-width: 70%;\n width: 70%;\n align-items: center;\n > * {\n word-wrap: break-word !important;\n word-break: break-word;\n }\n"])));
|
|
31
|
+
|
|
32
|
+
var Wrapper = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n word-wrap: break-word !important;\n word-break: break-word;\n > * {\n word-wrap: break-word !important;\n word-break: break-word !important;\n }\n"])));
|
|
33
|
+
|
|
34
|
+
var CardWrapper = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n width: ", ";\n max-width: ", ";\n margin-left: ", ";\n"])), function (_ref) {
|
|
35
|
+
var image = _ref.image;
|
|
36
|
+
if (image) return '50%';
|
|
37
|
+
return '100%';
|
|
38
|
+
}, function (_ref2) {
|
|
39
|
+
var image = _ref2.image;
|
|
40
|
+
if (image) return '50%';
|
|
41
|
+
return '100%';
|
|
42
|
+
}, function (_ref3) {
|
|
43
|
+
var state = _ref3.state;
|
|
44
|
+
|
|
45
|
+
if (state) {
|
|
46
|
+
if (state === 'inbound') return '0rem';
|
|
47
|
+
if (state === 'outbound') return 'auto';
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return '0rem';
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
var BmFeedPostComments = function BmFeedPostComments(_ref4) {
|
|
54
|
+
var story = _ref4.story,
|
|
55
|
+
state = _ref4.state,
|
|
56
|
+
rest = _objectWithoutProperties(_ref4, _excluded);
|
|
57
|
+
|
|
58
|
+
return story && /*#__PURE__*/_react.default.createElement(CardWrapper, _extends({
|
|
59
|
+
state: state
|
|
60
|
+
}, rest, {
|
|
61
|
+
image: story.body && story.body.image
|
|
62
|
+
}), /*#__PURE__*/_react.default.createElement(_cards.default, _extends({
|
|
63
|
+
state: state
|
|
64
|
+
}, rest), story.header && /*#__PURE__*/_react.default.createElement(_cards.default.Header, null, story.header), story.body && /*#__PURE__*/_react.default.createElement(_cards.default.Body, null, /*#__PURE__*/_react.default.createElement(Wrapper, null, /*#__PURE__*/_react.default.createElement(LinkText, {
|
|
65
|
+
image: story.body.image
|
|
66
|
+
}, story.body.link), story.body.image && /*#__PURE__*/_react.default.createElement(Image, {
|
|
67
|
+
src: story.body.image,
|
|
68
|
+
alt: "src"
|
|
69
|
+
}))), story.footer && /*#__PURE__*/_react.default.createElement(_cards.default.Footer, null, /*#__PURE__*/_react.default.createElement(Wrapper, null, story.footer))));
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
exports.BmFeedPostComments = BmFeedPostComments;
|
|
@@ -25,9 +25,11 @@ var _sessionTimeline = require("./sessionTimeline");
|
|
|
25
25
|
|
|
26
26
|
var _colors = require("../../colors");
|
|
27
27
|
|
|
28
|
+
var _FeedPostComments = require("./FeedPostComments");
|
|
29
|
+
|
|
28
30
|
var _excluded = ["state", "file", "src", "fileName", "onDownload", "link"],
|
|
29
31
|
_excluded2 = ["state", "src", "fileName"],
|
|
30
|
-
_excluded3 = ["children", "state", "displayTime", "status", "session", "src", "file", "fileName", "sessionDetails", "sessionTimeline"];
|
|
32
|
+
_excluded3 = ["children", "state", "displayTime", "status", "session", "src", "file", "fileName", "sessionDetails", "sessionTimeline", "feedPostComments"];
|
|
31
33
|
|
|
32
34
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11;
|
|
33
35
|
|
|
@@ -65,7 +67,7 @@ var Details = _styledComponents.default.div(_templateObject3 || (_templateObject
|
|
|
65
67
|
|
|
66
68
|
var MessageDetails = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n max-width: 70%;\n > * {\n margin-top: 0.5rem;\n margin-bottom: 0.5rem;\n }\n"])));
|
|
67
69
|
|
|
68
|
-
var Messages = _styledComponents.default.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 0.5rem;\n background: ", ";\n color: ", ";\n border-radius: ", ";\n border: 0.071rem solid ", ";\n word-break:
|
|
70
|
+
var Messages = _styledComponents.default.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 0.5rem;\n background: ", ";\n color: ", ";\n border-radius: ", ";\n border: 0.071rem solid ", ";\n word-break: break-word;\n margin: 0rem;\n"])), function (_ref2) {
|
|
69
71
|
var state = _ref2.state;
|
|
70
72
|
|
|
71
73
|
if (state) {
|
|
@@ -94,10 +96,19 @@ var Messages = _styledComponents.default.div(_templateObject5 || (_templateObjec
|
|
|
94
96
|
return "".concat(_colors.BmPrimaryWhite);
|
|
95
97
|
}, _colors.BmGrey200);
|
|
96
98
|
|
|
97
|
-
var MessagesSubDetails = _styledComponents.default.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n align-items: center;\n > *:not(:last-child) {\n margin-right: 0.5rem;\n }\n margin-top: 0.5rem;\n"])))
|
|
99
|
+
var MessagesSubDetails = _styledComponents.default.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n align-items: center;\n > *:not(:last-child) {\n margin-right: 0.5rem;\n }\n margin-left: ", ";\n margin-top: 0.5rem;\n"])), function (_ref5) {
|
|
100
|
+
var state = _ref5.state;
|
|
101
|
+
|
|
102
|
+
if (state) {
|
|
103
|
+
if (state === 'inbound') return '0px';
|
|
104
|
+
if (state === 'outbound') return 'auto';
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return "".concat(_colors.BmPrimaryWhite);
|
|
108
|
+
});
|
|
98
109
|
|
|
99
|
-
var handleState = function handleState(
|
|
100
|
-
var session =
|
|
110
|
+
var handleState = function handleState(_ref6) {
|
|
111
|
+
var session = _ref6.session;
|
|
101
112
|
|
|
102
113
|
if (session === 'bot') {
|
|
103
114
|
return /*#__PURE__*/_react.default.createElement(_avatars.default, {
|
|
@@ -122,8 +133,8 @@ var handleState = function handleState(_ref5) {
|
|
|
122
133
|
}; // Start of File Attachment
|
|
123
134
|
|
|
124
135
|
|
|
125
|
-
var FileAttachmentWrapper = _styledComponents.default.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n display: flex;\n cursor: pointer;\n flex-direction: row;\n padding: 1rem;\n background: ", ";\n color: ", ";\n border-radius: ", ";\n border: 0.071rem solid ", ";\n > * {\n &:last-child {\n margin-left: auto;\n }\n :not(:last-child) {\n margin-right: 0.5rem;\n }\n }\n &&& > * {\n align-items: center;\n color: ", ";\n }\n ", "\n ", "\n"])), function (
|
|
126
|
-
var state =
|
|
136
|
+
var FileAttachmentWrapper = _styledComponents.default.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n display: flex;\n cursor: pointer;\n flex-direction: row;\n padding: 1rem;\n background: ", ";\n color: ", ";\n border-radius: ", ";\n border: 0.071rem solid ", ";\n > * {\n &:last-child {\n margin-left: auto;\n }\n :not(:last-child) {\n margin-right: 0.5rem;\n }\n }\n &&& > * {\n align-items: center;\n color: ", ";\n }\n ", "\n ", "\n"])), function (_ref7) {
|
|
137
|
+
var state = _ref7.state;
|
|
127
138
|
|
|
128
139
|
if (state) {
|
|
129
140
|
if (state === 'inbound') return "".concat(_colors.BmPrimaryWhite);
|
|
@@ -131,8 +142,8 @@ var FileAttachmentWrapper = _styledComponents.default.div(_templateObject7 || (_
|
|
|
131
142
|
}
|
|
132
143
|
|
|
133
144
|
return "".concat(_colors.BmPrimaryWhite);
|
|
134
|
-
}, function (
|
|
135
|
-
var state =
|
|
145
|
+
}, function (_ref8) {
|
|
146
|
+
var state = _ref8.state;
|
|
136
147
|
|
|
137
148
|
if (state) {
|
|
138
149
|
if (state === 'inbound') return "".concat(_colors.BmPrimaryBlack);
|
|
@@ -140,8 +151,8 @@ var FileAttachmentWrapper = _styledComponents.default.div(_templateObject7 || (_
|
|
|
140
151
|
}
|
|
141
152
|
|
|
142
153
|
return "".concat(_colors.BmPrimaryWhite);
|
|
143
|
-
}, function (
|
|
144
|
-
var state =
|
|
154
|
+
}, function (_ref9) {
|
|
155
|
+
var state = _ref9.state;
|
|
145
156
|
|
|
146
157
|
if (state) {
|
|
147
158
|
if (state === 'inbound') return '0.21875rem 0.21875rem 0.21875rem 0rem';
|
|
@@ -149,8 +160,8 @@ var FileAttachmentWrapper = _styledComponents.default.div(_templateObject7 || (_
|
|
|
149
160
|
}
|
|
150
161
|
|
|
151
162
|
return "".concat(_colors.BmPrimaryWhite);
|
|
152
|
-
}, _colors.BmGrey200, function (
|
|
153
|
-
var state =
|
|
163
|
+
}, _colors.BmGrey200, function (_ref10) {
|
|
164
|
+
var state = _ref10.state;
|
|
154
165
|
|
|
155
166
|
if (state) {
|
|
156
167
|
if (state === 'inbound') return "".concat(_colors.BmPrimaryBlue);
|
|
@@ -164,14 +175,14 @@ var FileAttachmentWrapper = _styledComponents.default.div(_templateObject7 || (_
|
|
|
164
175
|
/* max-height: 100%; */
|
|
165
176
|
);
|
|
166
177
|
|
|
167
|
-
var BmFileAttachment = function BmFileAttachment(
|
|
168
|
-
var state =
|
|
169
|
-
file =
|
|
170
|
-
src =
|
|
171
|
-
fileName =
|
|
172
|
-
onDownload =
|
|
173
|
-
link =
|
|
174
|
-
rest = _objectWithoutProperties(
|
|
178
|
+
var BmFileAttachment = function BmFileAttachment(_ref11) {
|
|
179
|
+
var state = _ref11.state,
|
|
180
|
+
file = _ref11.file,
|
|
181
|
+
src = _ref11.src,
|
|
182
|
+
fileName = _ref11.fileName,
|
|
183
|
+
onDownload = _ref11.onDownload,
|
|
184
|
+
link = _ref11.link,
|
|
185
|
+
rest = _objectWithoutProperties(_ref11, _excluded);
|
|
175
186
|
|
|
176
187
|
return /*#__PURE__*/_react.default.createElement(FileAttachmentWrapper, _extends({
|
|
177
188
|
state: state
|
|
@@ -186,8 +197,8 @@ var BmFileAttachment = function BmFileAttachment(_ref10) {
|
|
|
186
197
|
}; // Start of Component for Images
|
|
187
198
|
|
|
188
199
|
|
|
189
|
-
var BmImageWrapper = _styledComponents.default.div(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n color: ", ";\n border-radius: ", ";\n border: 0.071rem solid ", ";\n"])), function (
|
|
190
|
-
var state =
|
|
200
|
+
var BmImageWrapper = _styledComponents.default.div(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n color: ", ";\n border-radius: ", ";\n border: 0.071rem solid ", ";\n"])), function (_ref12) {
|
|
201
|
+
var state = _ref12.state;
|
|
191
202
|
|
|
192
203
|
if (state) {
|
|
193
204
|
if (state === 'inbound') return "".concat(_colors.BmPrimaryBlack);
|
|
@@ -195,8 +206,8 @@ var BmImageWrapper = _styledComponents.default.div(_templateObject8 || (_templat
|
|
|
195
206
|
}
|
|
196
207
|
|
|
197
208
|
return "".concat(_colors.BmPrimaryWhite);
|
|
198
|
-
}, function (
|
|
199
|
-
var state =
|
|
209
|
+
}, function (_ref13) {
|
|
210
|
+
var state = _ref13.state;
|
|
200
211
|
|
|
201
212
|
if (state) {
|
|
202
213
|
if (state === 'inbound') return '0.21875rem 0.21875rem 0.21875rem 0rem';
|
|
@@ -214,11 +225,11 @@ var BmImage = _styledComponents.default.img(_templateObject9 || (_templateObject
|
|
|
214
225
|
|
|
215
226
|
exports.BmImage = BmImage;
|
|
216
227
|
|
|
217
|
-
var BmImageChat = function BmImageChat(
|
|
218
|
-
var state =
|
|
219
|
-
src =
|
|
220
|
-
fileName =
|
|
221
|
-
rest = _objectWithoutProperties(
|
|
228
|
+
var BmImageChat = function BmImageChat(_ref14) {
|
|
229
|
+
var state = _ref14.state,
|
|
230
|
+
src = _ref14.src,
|
|
231
|
+
fileName = _ref14.fileName,
|
|
232
|
+
rest = _objectWithoutProperties(_ref14, _excluded2);
|
|
222
233
|
|
|
223
234
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(BmImageWrapper, _extends({
|
|
224
235
|
state: state
|
|
@@ -239,18 +250,19 @@ var MessageState = _styledComponents.default.div(_templateObject10 || (_template
|
|
|
239
250
|
|
|
240
251
|
exports.MessageState = MessageState;
|
|
241
252
|
|
|
242
|
-
BmChat.Details = function (
|
|
243
|
-
var children =
|
|
244
|
-
state =
|
|
245
|
-
displayTime =
|
|
246
|
-
status =
|
|
247
|
-
session =
|
|
248
|
-
src =
|
|
249
|
-
file =
|
|
250
|
-
fileName =
|
|
251
|
-
sessionDetails =
|
|
252
|
-
sessionTimeline =
|
|
253
|
-
|
|
253
|
+
BmChat.Details = function (_ref15) {
|
|
254
|
+
var children = _ref15.children,
|
|
255
|
+
state = _ref15.state,
|
|
256
|
+
displayTime = _ref15.displayTime,
|
|
257
|
+
status = _ref15.status,
|
|
258
|
+
session = _ref15.session,
|
|
259
|
+
src = _ref15.src,
|
|
260
|
+
file = _ref15.file,
|
|
261
|
+
fileName = _ref15.fileName,
|
|
262
|
+
sessionDetails = _ref15.sessionDetails,
|
|
263
|
+
sessionTimeline = _ref15.sessionTimeline,
|
|
264
|
+
feedPostComments = _ref15.feedPostComments,
|
|
265
|
+
rest = _objectWithoutProperties(_ref15, _excluded3);
|
|
254
266
|
|
|
255
267
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, sessionTimeline && /*#__PURE__*/_react.default.createElement(_sessionTimeline.SessionTimeline, _extends({
|
|
256
268
|
message: sessionTimeline.message
|
|
@@ -262,7 +274,9 @@ BmChat.Details = function (_ref14) {
|
|
|
262
274
|
}, rest), /*#__PURE__*/_react.default.createElement(MessageState, null, state === 'inbound' && session && handleState({
|
|
263
275
|
state: state,
|
|
264
276
|
session: session
|
|
265
|
-
})), /*#__PURE__*/_react.default.createElement(MessageDetails,
|
|
277
|
+
})), /*#__PURE__*/_react.default.createElement(MessageDetails, {
|
|
278
|
+
feedPostComments: feedPostComments
|
|
279
|
+
}, src && /*#__PURE__*/_react.default.createElement(BmImageChat, _extends({
|
|
266
280
|
state: state,
|
|
267
281
|
src: src,
|
|
268
282
|
fileName: fileName
|
|
@@ -272,7 +286,12 @@ BmChat.Details = function (_ref14) {
|
|
|
272
286
|
file: file,
|
|
273
287
|
fileName: fileName,
|
|
274
288
|
state: state
|
|
275
|
-
}, rest)),
|
|
289
|
+
}, rest)), feedPostComments && /*#__PURE__*/_react.default.createElement(_FeedPostComments.BmFeedPostComments, _extends({
|
|
290
|
+
state: state,
|
|
291
|
+
story: feedPostComments
|
|
292
|
+
}, rest)), /*#__PURE__*/_react.default.createElement(MessagesSubDetails, {
|
|
293
|
+
state: state
|
|
294
|
+
}, displayTime && displayTime, status === 'sent' && /*#__PURE__*/_react.default.createElement(_iconStyles.BmIcons, {
|
|
276
295
|
icon: /*#__PURE__*/_react.default.createElement(_icons.DoneAll, null),
|
|
277
296
|
color: "".concat(_colors.BmSecondaryDarkGreen),
|
|
278
297
|
size: "small"
|
|
@@ -35,13 +35,21 @@ exports.default = _default;
|
|
|
35
35
|
|
|
36
36
|
var ChatBody = function ChatBody() {
|
|
37
37
|
return /*#__PURE__*/_react.default.createElement(_chatBody.default, null, /*#__PURE__*/_react.default.createElement(_chatBody.default.Body, null, /*#__PURE__*/_react.default.createElement(_chatBody.default.Details, {
|
|
38
|
-
state: "
|
|
38
|
+
state: "outbound",
|
|
39
39
|
session: "sms",
|
|
40
40
|
displayTime: /*#__PURE__*/_react.default.createElement("p", null, "12:00pm"),
|
|
41
41
|
status: "sent",
|
|
42
42
|
sessionDetails: {
|
|
43
43
|
message: /*#__PURE__*/_react.default.createElement("h3", null, "Session Message"),
|
|
44
44
|
time: /*#__PURE__*/_react.default.createElement("p", null, "12:00pm")
|
|
45
|
+
},
|
|
46
|
+
feedPostComments: {
|
|
47
|
+
header: /*#__PURE__*/_react.default.createElement("p", null, "hello"),
|
|
48
|
+
body: {
|
|
49
|
+
link: /*#__PURE__*/_react.default.createElement("p", null, "This is a text"),
|
|
50
|
+
image: _chartImg.default
|
|
51
|
+
},
|
|
52
|
+
footer: /*#__PURE__*/_react.default.createElement("p", null, "This is a Footer")
|
|
45
53
|
}
|
|
46
54
|
}, /*#__PURE__*/_react.default.createElement("p", null, "Inbound Text Message")), /*#__PURE__*/_react.default.createElement(_chatBody.default.Details, {
|
|
47
55
|
state: "inbound",
|
|
@@ -17,6 +17,8 @@ var _fb = _interopRequireDefault(require("../../assets/fb.png"));
|
|
|
17
17
|
|
|
18
18
|
var _insta = _interopRequireDefault(require("../../assets/insta.png"));
|
|
19
19
|
|
|
20
|
+
var _Google_Messages_logo = _interopRequireDefault(require("../../assets/Google_Messages_logo.png"));
|
|
21
|
+
|
|
20
22
|
var _excluded = ["img", "content", "channel", "size"];
|
|
21
23
|
|
|
22
24
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
@@ -95,6 +97,10 @@ var BmProfileIcon = function BmProfileIcon(_ref) {
|
|
|
95
97
|
size: size,
|
|
96
98
|
src: _insta.default,
|
|
97
99
|
alt: "icon"
|
|
100
|
+
}), channel && channel === 'google_business_messaging' && /*#__PURE__*/_react.default.createElement(Dot, {
|
|
101
|
+
size: size,
|
|
102
|
+
src: _Google_Messages_logo.default,
|
|
103
|
+
alt: "icon"
|
|
98
104
|
})));
|
|
99
105
|
};
|
|
100
106
|
|
package/package.json
CHANGED
package/src/App.js
CHANGED
|
@@ -4,14 +4,21 @@ import AttachFileIcon from '@mui/icons-material/AttachFile';
|
|
|
4
4
|
import EmojiEmotionsIcon from '@mui/icons-material/EmojiEmotions';
|
|
5
5
|
import SendIcon from '@mui/icons-material/Send';
|
|
6
6
|
import QuickreplyIcon from '@mui/icons-material/Quickreply';
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
BmChat,
|
|
9
|
+
BmInput,
|
|
10
|
+
BmIcons,
|
|
11
|
+
GlobalStyle,
|
|
12
|
+
BmProfileIcon,
|
|
13
|
+
} from './lib/components';
|
|
8
14
|
|
|
9
15
|
const Chat = () => {
|
|
10
16
|
const image =
|
|
11
|
-
'https://
|
|
17
|
+
'https://scontent.fnbo1-1.fna.fbcdn.net/v/t39.30808-6/298879098_10161724947807542_5252175668064009159_n.jpg?stp=dst-jpg_p720x720&_nc_cat=100&ccb=1-7&_nc_sid=9e2e56&_nc_ohc=9uDHII_ETpUAX_KNS3Y&_nc_ht=scontent.fnbo1-1.fna&edm=APCh5TUEAAAA&oh=00_AT8sOJmRGYwgXF48_GPOCWx1soil0yK8V3AiEPkce9WJIw&oe=6304120B';
|
|
12
18
|
return (
|
|
13
19
|
<>
|
|
14
20
|
<GlobalStyle />
|
|
21
|
+
<BmProfileIcon channel="google_business_messaging" />
|
|
15
22
|
<BmChat>
|
|
16
23
|
<BmChat.Body>
|
|
17
24
|
<BmChat.Details
|
|
@@ -23,8 +30,19 @@ const Chat = () => {
|
|
|
23
30
|
message: <p>2022-07-28</p>,
|
|
24
31
|
// time: <p>12:00pm</p>,
|
|
25
32
|
}}
|
|
33
|
+
feedPostComments={{
|
|
34
|
+
header: <p>hello</p>,
|
|
35
|
+
body: {
|
|
36
|
+
link: <p>This is a body</p>,
|
|
37
|
+
image,
|
|
38
|
+
},
|
|
39
|
+
footer: <p>This is a footer</p>,
|
|
40
|
+
}}
|
|
26
41
|
>
|
|
27
|
-
<p>
|
|
42
|
+
<p>
|
|
43
|
+
Inbound Text
|
|
44
|
+
Messagejldkffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
|
45
|
+
</p>
|
|
28
46
|
</BmChat.Details>
|
|
29
47
|
<BmChat.Details
|
|
30
48
|
state="inbound"
|
|
Binary file
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import BmCard from '../../Cards/cards';
|
|
4
|
+
|
|
5
|
+
const Image = styled.img`
|
|
6
|
+
max-width: 30%;
|
|
7
|
+
width: 30%;
|
|
8
|
+
`;
|
|
9
|
+
const LinkText = styled.div`
|
|
10
|
+
display: flex;
|
|
11
|
+
max-width: 70%;
|
|
12
|
+
width: 70%;
|
|
13
|
+
align-items: center;
|
|
14
|
+
> * {
|
|
15
|
+
word-wrap: break-word !important;
|
|
16
|
+
word-break: break-word;
|
|
17
|
+
}
|
|
18
|
+
`;
|
|
19
|
+
|
|
20
|
+
const Wrapper = styled.div`
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: row;
|
|
23
|
+
word-wrap: break-word !important;
|
|
24
|
+
word-break: break-word;
|
|
25
|
+
> * {
|
|
26
|
+
word-wrap: break-word !important;
|
|
27
|
+
word-break: break-word !important;
|
|
28
|
+
}
|
|
29
|
+
`;
|
|
30
|
+
|
|
31
|
+
const CardWrapper = styled.div`
|
|
32
|
+
display: flex;
|
|
33
|
+
width: ${({ image }) => {
|
|
34
|
+
if (image) return '50%';
|
|
35
|
+
return '100%';
|
|
36
|
+
}};
|
|
37
|
+
max-width: ${({ image }) => {
|
|
38
|
+
if (image) return '50%';
|
|
39
|
+
return '100%';
|
|
40
|
+
}};
|
|
41
|
+
margin-left: ${({ state }) => {
|
|
42
|
+
if (state) {
|
|
43
|
+
if (state === 'inbound') return '0rem';
|
|
44
|
+
if (state === 'outbound') return 'auto';
|
|
45
|
+
}
|
|
46
|
+
return '0rem';
|
|
47
|
+
}};
|
|
48
|
+
`;
|
|
49
|
+
|
|
50
|
+
export const BmFeedPostComments = ({ story, state, ...rest }) => {
|
|
51
|
+
return (
|
|
52
|
+
story && (
|
|
53
|
+
<CardWrapper
|
|
54
|
+
state={state}
|
|
55
|
+
{...rest}
|
|
56
|
+
image={story.body && story.body.image}
|
|
57
|
+
>
|
|
58
|
+
<BmCard state={state} {...rest}>
|
|
59
|
+
{story.header && <BmCard.Header>{story.header}</BmCard.Header>}
|
|
60
|
+
{story.body && (
|
|
61
|
+
<BmCard.Body>
|
|
62
|
+
<Wrapper>
|
|
63
|
+
<LinkText image={story.body.image}>{story.body.link}</LinkText>
|
|
64
|
+
{story.body.image && <Image src={story.body.image} alt="src" />}
|
|
65
|
+
</Wrapper>
|
|
66
|
+
</BmCard.Body>
|
|
67
|
+
)}
|
|
68
|
+
{story.footer && (
|
|
69
|
+
<BmCard.Footer>
|
|
70
|
+
<Wrapper>{story.footer}</Wrapper>
|
|
71
|
+
</BmCard.Footer>
|
|
72
|
+
)}
|
|
73
|
+
</BmCard>
|
|
74
|
+
</CardWrapper>
|
|
75
|
+
)
|
|
76
|
+
);
|
|
77
|
+
};
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
BmSecondaryDarkGreen,
|
|
16
16
|
BmGrey200,
|
|
17
17
|
} from '../../colors';
|
|
18
|
+
import { BmFeedPostComments } from './FeedPostComments';
|
|
18
19
|
|
|
19
20
|
const BmChat = styled.div`
|
|
20
21
|
display: flex;
|
|
@@ -91,7 +92,7 @@ const Messages = styled.div`
|
|
|
91
92
|
return `${BmPrimaryWhite}`;
|
|
92
93
|
}};
|
|
93
94
|
border: 0.071rem solid ${BmGrey200};
|
|
94
|
-
word-break:
|
|
95
|
+
word-break: break-word;
|
|
95
96
|
margin: 0rem;
|
|
96
97
|
`;
|
|
97
98
|
|
|
@@ -102,6 +103,13 @@ const MessagesSubDetails = styled.div`
|
|
|
102
103
|
> *:not(:last-child) {
|
|
103
104
|
margin-right: 0.5rem;
|
|
104
105
|
}
|
|
106
|
+
margin-left: ${({ state }) => {
|
|
107
|
+
if (state) {
|
|
108
|
+
if (state === 'inbound') return '0px';
|
|
109
|
+
if (state === 'outbound') return 'auto';
|
|
110
|
+
}
|
|
111
|
+
return `${BmPrimaryWhite}`;
|
|
112
|
+
}};
|
|
105
113
|
margin-top: 0.5rem;
|
|
106
114
|
`;
|
|
107
115
|
|
|
@@ -252,6 +260,7 @@ BmChat.Details = ({
|
|
|
252
260
|
fileName,
|
|
253
261
|
sessionDetails,
|
|
254
262
|
sessionTimeline,
|
|
263
|
+
feedPostComments,
|
|
255
264
|
...rest
|
|
256
265
|
}) => {
|
|
257
266
|
return (
|
|
@@ -271,7 +280,7 @@ BmChat.Details = ({
|
|
|
271
280
|
<MessageState>
|
|
272
281
|
{state === 'inbound' && session && handleState({ state, session })}
|
|
273
282
|
</MessageState>
|
|
274
|
-
<MessageDetails>
|
|
283
|
+
<MessageDetails feedPostComments={feedPostComments}>
|
|
275
284
|
{/* For Images */}
|
|
276
285
|
{src && (
|
|
277
286
|
<BmImageChat
|
|
@@ -292,7 +301,14 @@ BmChat.Details = ({
|
|
|
292
301
|
{...rest}
|
|
293
302
|
/>
|
|
294
303
|
)}
|
|
295
|
-
|
|
304
|
+
{feedPostComments && (
|
|
305
|
+
<BmFeedPostComments
|
|
306
|
+
state={state}
|
|
307
|
+
story={feedPostComments}
|
|
308
|
+
{...rest}
|
|
309
|
+
/>
|
|
310
|
+
)}
|
|
311
|
+
<MessagesSubDetails state={state}>
|
|
296
312
|
{displayTime && displayTime}
|
|
297
313
|
{status === 'sent' && (
|
|
298
314
|
<BmIcons
|
|
@@ -19,7 +19,7 @@ export const ChatBody = () => {
|
|
|
19
19
|
<BmChat>
|
|
20
20
|
<BmChat.Body>
|
|
21
21
|
<BmChat.Details
|
|
22
|
-
state="
|
|
22
|
+
state="outbound"
|
|
23
23
|
session="sms"
|
|
24
24
|
displayTime={<p>12:00pm</p>}
|
|
25
25
|
status="sent"
|
|
@@ -27,6 +27,14 @@ export const ChatBody = () => {
|
|
|
27
27
|
message: <h3>Session Message</h3>,
|
|
28
28
|
time: <p>12:00pm</p>,
|
|
29
29
|
}}
|
|
30
|
+
feedPostComments={{
|
|
31
|
+
header: <p>hello</p>,
|
|
32
|
+
body: {
|
|
33
|
+
link: <p>This is a text</p>,
|
|
34
|
+
image,
|
|
35
|
+
},
|
|
36
|
+
footer: <p>This is a Footer</p>,
|
|
37
|
+
}}
|
|
30
38
|
>
|
|
31
39
|
<p>Inbound Text Message</p>
|
|
32
40
|
</BmChat.Details>
|
|
@@ -4,6 +4,7 @@ import { BmSecondaryBlue12, BmBgLightBlue } from '../colors';
|
|
|
4
4
|
import wa from '../../assets/wa.png';
|
|
5
5
|
import fb from '../../assets/fb.png';
|
|
6
6
|
import insta from '../../assets/insta.png';
|
|
7
|
+
import gbm from '../../assets/Google_Messages_logo.png';
|
|
7
8
|
|
|
8
9
|
const handleSize = (size) => {
|
|
9
10
|
if (size) {
|
|
@@ -76,6 +77,9 @@ export const BmProfileIcon = ({ img, content, channel, size, ...rest }) => {
|
|
|
76
77
|
{channel && channel === 'instagram' && (
|
|
77
78
|
<Dot size={size} src={insta} alt="icon" />
|
|
78
79
|
)}
|
|
80
|
+
{channel && channel === 'google_business_messaging' && (
|
|
81
|
+
<Dot size={size} src={gbm} alt="icon" />
|
|
82
|
+
)}
|
|
79
83
|
</Profile>
|
|
80
84
|
</>
|
|
81
85
|
);
|