beem-component 1.6.2 → 1.6.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.
@@ -23,7 +23,7 @@ var _sessionDetails = require("./sessionDetails");
23
23
 
24
24
  var _colors = require("../../colors");
25
25
 
26
- var _excluded = ["state", "file", "src", "fileName", "onDownload"],
26
+ var _excluded = ["state", "file", "src", "fileName", "onDownload", "link"],
27
27
  _excluded2 = ["state", "src", "fileName"],
28
28
  _excluded3 = ["children", "state", "displayTime", "status", "session", "src", "file", "fileName", "sessionDetails"];
29
29
 
@@ -168,16 +168,19 @@ var BmFileAttachment = function BmFileAttachment(_ref10) {
168
168
  src = _ref10.src,
169
169
  fileName = _ref10.fileName,
170
170
  onDownload = _ref10.onDownload,
171
+ link = _ref10.link,
171
172
  rest = _objectWithoutProperties(_ref10, _excluded);
172
173
 
173
174
  return /*#__PURE__*/_react.default.createElement(FileAttachmentWrapper, _extends({
174
175
  state: state
175
176
  }, rest), /*#__PURE__*/_react.default.createElement(_iconStyles.BmIcons, {
176
177
  icon: /*#__PURE__*/_react.default.createElement(_FilePresent.default, null)
177
- }), fileName, /*#__PURE__*/_react.default.createElement(_iconStyles.BmIcons, {
178
- icon: /*#__PURE__*/_react.default.createElement(_Download.default, null),
179
- onClick: onDownload
180
- }));
178
+ }), fileName, /*#__PURE__*/_react.default.createElement("a", {
179
+ href: link,
180
+ download: true
181
+ }, /*#__PURE__*/_react.default.createElement(_iconStyles.BmIcons, {
182
+ icon: /*#__PURE__*/_react.default.createElement(_Download.default, null)
183
+ })));
181
184
  }; // Start of Component for Images
182
185
 
183
186
 
@@ -80,6 +80,7 @@ var ChatBody = function ChatBody() {
80
80
  status: "failed",
81
81
  fileName: /*#__PURE__*/_react.default.createElement("p", null, "file.csv"),
82
82
  file: _chartImg.default,
83
+ link: _chartImg.default,
83
84
  onDownload: function onDownload() {
84
85
  alert('hello');
85
86
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "beem-component",
3
- "version": "1.6.2",
3
+ "version": "1.6.3",
4
4
  "private": false,
5
5
  "main": "dist/components/index.js",
6
6
  "scripts": {
package/src/App.js CHANGED
@@ -1,15 +1,93 @@
1
- import React, { useState } from 'react';
2
- import { GlobalStyle, BmModal, BmButton } from './lib/components';
3
- import { BmCheckboxToggle } from './lib/components/Checkbox/checkboxToggler';
4
- import BmPaymentBox from './lib/components/PaymentBox/paymentBox';
1
+ import React from 'react';
2
+ import { GlobalStyle, BmChat } from './lib/components';
3
+ // import { BmCheckboxToggle } from './lib/components/Checkbox/checkboxToggler';
4
+ // import BmChat from './lib/components';
5
5
 
6
6
  const Chat = () => {
7
- const [checked, setChecked] = useState(false);
8
- const [showModal, setShowModal] = useState(false);
7
+ // const [checked, setChecked] = useState(false);
8
+ // const [showModal, setShowModal] = useState(false);
9
+ const image =
10
+ 'https://bm-chatbot-images.s3.eu-west-1.amazonaws.com/3ba5560f-5446-4623-940e-c92b0f50a9b1?AWSAccessKeyId=AKIAVCAYXA54IQYB6C7A&Expires=1733652431&Signature=WEt9my0kkm3SRkiJjvth2vQKcHc%3D';
11
+ const file =
12
+ 'https://bm-chatbot-images.s3.eu-west-1.amazonaws.com/270e8552-064f-42aa-970c-0593b5cf3a20?AWSAccessKeyId=AKIAVCAYXA54IQYB6C7A&Expires=1733652558&Signature=0sTEvpH0UoKHeb8mrFSXlf65h24%3D';
9
13
  return (
10
14
  <>
11
15
  <GlobalStyle />
12
- <div>
16
+ <BmChat>
17
+ <BmChat.Body>
18
+ <BmChat.Details
19
+ state="inbound"
20
+ session="sms"
21
+ displayTime={<p>12:00pm</p>}
22
+ status="sent"
23
+ sessionDetails={{
24
+ message: <h3>Session Message</h3>,
25
+ time: <p>12:00pm</p>,
26
+ }}
27
+ >
28
+ <p>Inbound Text Message</p>
29
+ </BmChat.Details>
30
+ <BmChat.Details
31
+ state="inbound"
32
+ session="live"
33
+ displayTime={<p>12:00pm</p>}
34
+ status="sent"
35
+ fileName={<p>chahhhhhhhht.png</p>}
36
+ src={image}
37
+ link={image}
38
+ sessionDetails={{
39
+ message: <h3>Session Message</h3>,
40
+ time: <p>12:00pm</p>,
41
+ }}
42
+ />
43
+ <BmChat.Details
44
+ state="inbound"
45
+ session="live"
46
+ displayTime={<p>10:00am</p>}
47
+ status="failed"
48
+ fileName={<p>fifdsfdsfsdfsfle.csv</p>}
49
+ file={file}
50
+ link={file}
51
+ />
52
+ <BmChat.Details
53
+ state="outbound"
54
+ session="bot"
55
+ displayTime={<p>12:00pm</p>}
56
+ status="sent"
57
+ >
58
+ <p>Outbound Text Message</p>
59
+ </BmChat.Details>
60
+ <BmChat.Details
61
+ state="outbound"
62
+ session="live"
63
+ displayTime={<p>12:00pm</p>}
64
+ status="sent"
65
+ fileName={<p>chat.png</p>}
66
+ src={image}
67
+ />
68
+ <BmChat.Details
69
+ state="outbound"
70
+ session="live"
71
+ displayTime={<p>10:00am</p>}
72
+ status="failed"
73
+ fileName={<p>file.csv</p>}
74
+ file={image}
75
+ // onDownload={() => {
76
+ // alert('hello');
77
+ // }}
78
+ />
79
+ </BmChat.Body>
80
+ {/* <BmChat.Footer>
81
+ <div className="chat-footer">
82
+ <BmIcons icon={<EmojiEmotionsIcon />} size="xlarge" />
83
+ <BmIcons icon={<AttachFileIcon />} size="xlarge" />
84
+ <BmIcons icon={<QuickreplyIcon />} size="xlarge" />
85
+ <BmInput placeholder="Enter Message" style={{ flex: '1' }} />
86
+ <BmIcons icon={<SendIcon />} size="xlarge" />
87
+ </div>
88
+ </BmChat.Footer> */}
89
+ </BmChat>
90
+ {/* <div>
13
91
  <BmButton onClick={() => setShowModal(!showModal)}>Click Me!</BmButton>
14
92
  </div>
15
93
  <BmModal show={showModal} onHide={() => setShowModal(false)}>
@@ -30,20 +108,8 @@ const Chat = () => {
30
108
  </BmModal.Body>
31
109
  <BmModal.Footer>
32
110
  <p>This is a footer</p>
33
- </BmModal.Footer>
34
- </BmModal>
35
-
36
- <BmPaymentBox>
37
- <BmPaymentBox.Header>
38
- <h2>Header</h2>
39
- </BmPaymentBox.Header>
40
- <BmPaymentBox.Body>
41
- <p>This is a body</p>
42
- </BmPaymentBox.Body>
43
- <BmPaymentBox.Footer>
44
- <p>This is a footer</p>
45
- </BmPaymentBox.Footer>
46
- </BmPaymentBox>
111
+ </BmModal.Footer> */}
112
+ {/* </BmModal> */}
47
113
  </>
48
114
  );
49
115
  };
@@ -172,13 +172,17 @@ const BmFileAttachment = ({
172
172
  src,
173
173
  fileName,
174
174
  onDownload,
175
+ link,
175
176
  ...rest
176
177
  }) => {
177
178
  return (
178
179
  <FileAttachmentWrapper state={state} {...rest}>
179
180
  <BmIcons icon={<FilePresentIcon />} />
181
+ {/* {fileName} */}
180
182
  {fileName}
181
- <BmIcons icon={<DownloadIcon />} onClick={onDownload} />
183
+ <a href={link} download>
184
+ <BmIcons icon={<DownloadIcon />} />
185
+ </a>
182
186
  </FileAttachmentWrapper>
183
187
  );
184
188
  };
@@ -73,6 +73,7 @@ export const ChatBody = () => {
73
73
  status="failed"
74
74
  fileName={<p>file.csv</p>}
75
75
  file={image}
76
+ link={image}
76
77
  onDownload={() => {
77
78
  alert('hello');
78
79
  }}