@appcorp/app-corp-vista 0.3.0 → 0.3.1
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/data/vista-chat-props.js
CHANGED
|
@@ -12,7 +12,7 @@ var vista_dashboard_notification_v1_1 = require("../../atoms/vista-dashboard-not
|
|
|
12
12
|
var vista_dashboard_topbar_type_1 = require("../../type/vista-dashboard-topbar-type");
|
|
13
13
|
var vista_dashboard_profile_v1_1 = require("../vista-dashboard-profile-v1/vista-dashboard-profile-v1");
|
|
14
14
|
var VistaDashboardTopBarV1 = function (_a) {
|
|
15
|
-
var avatarAlt = _a.avatarAlt, avatarInitials = _a.avatarInitials, avatarUrl = _a.avatarUrl, _b = _a.balance, balance = _b === void 0 ? '' : _b, handleOnClick = _a.handleOnClick, handleTheme = _a.handleTheme, menuItems = _a.menuItems, name = _a.name, profileMenuItems = _a.profileMenuItems,
|
|
15
|
+
var avatarAlt = _a.avatarAlt, avatarInitials = _a.avatarInitials, avatarUrl = _a.avatarUrl, _b = _a.balance, balance = _b === void 0 ? '' : _b, handleOnClick = _a.handleOnClick, handleTheme = _a.handleTheme, menuItems = _a.menuItems, name = _a.name, _c = _a.notificationEnabled, notificationEnabled = _c === void 0 ? false : _c, profileMenuItems = _a.profileMenuItems, _d = _a.theme, theme = _d === void 0 ? vista_dashboard_topbar_type_1.VISTA_THEME.LIGHT : _d, _e = _a.themeEnabled, themeEnabled = _e === void 0 ? true : _e;
|
|
16
16
|
return (react_1.default.createElement("div", { className: "sticky top-0 z-10 flex h-16 shrink-0 items-center gap-x-4 border-b border-black/10 bg-gray-100 dark:bg-gray-900 px-4 shadow-sm sm:px-6 lg:px-8" },
|
|
17
17
|
react_1.default.createElement("button", { type: "button", onClick: function () { return handleOnClick(true); }, className: "-m-2.5 p-2.5 text-white xl:hidden" },
|
|
18
18
|
react_1.default.createElement("span", { className: "sr-only" }, "Open sidebar"),
|
|
@@ -33,8 +33,9 @@ var VistaDashboardTopBarV1 = function (_a) {
|
|
|
33
33
|
balance && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
34
34
|
react_1.default.createElement(vista_vertical_divider_v1_1.VistaVerticalDividerV1, null),
|
|
35
35
|
react_1.default.createElement("p", { className: "font-medium text-md text-gray-500" }, balance))),
|
|
36
|
-
react_1.default.createElement(
|
|
37
|
-
|
|
36
|
+
notificationEnabled && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
37
|
+
react_1.default.createElement(vista_vertical_divider_v1_1.VistaVerticalDividerV1, null),
|
|
38
|
+
react_1.default.createElement(vista_dashboard_notification_v1_1.VistaDashboardNotificationV1, null))),
|
|
38
39
|
react_1.default.createElement(vista_vertical_divider_v1_1.VistaVerticalDividerV1, null),
|
|
39
40
|
react_1.default.createElement(vista_dashboard_profile_v1_1.VistaDashboardProfileV1, { avatarAlt: avatarAlt, avatarInitials: avatarInitials, avatarUrl: avatarUrl, name: name, profileMenuItems: profileMenuItems })));
|
|
40
41
|
};
|
|
@@ -12,12 +12,23 @@ var vista_text_input_v1_1 = require("../../molecules/vista-text-input-v1");
|
|
|
12
12
|
var vista_button_v1_1 = require("../../molecules/vista-button-v1/vista-button-v1");
|
|
13
13
|
var vista_button_type_1 = require("../../type/vista-button-type");
|
|
14
14
|
var vista_chat_bubble_v1_1 = require("../../molecules/vista-chat-bubble-v1/vista-chat-bubble-v1");
|
|
15
|
+
var vista_vertical_divider_v1_1 = require("../../molecules/vista-vertical-divider-v1");
|
|
16
|
+
var util_functions_1 = require("@react-pakistan/util-functions");
|
|
15
17
|
var VistaChatV2 = function (_a) {
|
|
16
18
|
var actionItems = _a.actionItems, buttonDenominations = _a.buttonDenominations, chatId = _a.chatId, chatValue = _a.chatValue, _b = _a.containerClassName, containerClassName = _b === void 0 ? '' : _b, _c = _a.estimatedBalance, estimatedBalance = _c === void 0 ? '' : _c, handleChatOnChange = _a.handleChatOnChange, handleOnBlur = _a.handleOnBlur, handleOnFocus = _a.handleOnFocus, handlePayment = _a.handlePayment, isBalanceLow = _a.isBalanceLow, messages = _a.messages, name = _a.name, paymentLoading = _a.paymentLoading, psychic = _a.psychic, sideBarHeading = _a.sideBarHeading, sideBarNode = _a.sideBarNode, timer = _a.timer, typing = _a.typing, user = _a.user;
|
|
17
19
|
var renderChatMessages = function () {
|
|
20
|
+
var lastDate = '';
|
|
18
21
|
return (react_1.default.createElement("div", { className: "overflow-y-scroll" }, messages.map(function (_a, ind) {
|
|
22
|
+
var _b, _c;
|
|
19
23
|
var createdAt = _a.createdAt, id = _a.id, isUser = _a.isUser, message = _a.message;
|
|
20
|
-
|
|
24
|
+
var shouldShowDivider = ((_b = lastDate.split(' ')) === null || _b === void 0 ? void 0 : _b[0]) === ((_c = createdAt.split(' ')) === null || _c === void 0 ? void 0 : _c[0])
|
|
25
|
+
? false
|
|
26
|
+
: true;
|
|
27
|
+
lastDate = createdAt;
|
|
28
|
+
return (react_1.default.createElement("div", { key: id },
|
|
29
|
+
shouldShowDivider && (react_1.default.createElement("div", { className: "pt-8" },
|
|
30
|
+
react_1.default.createElement(vista_vertical_divider_v1_1.VistaVerticalDividerV1, { label: (0, util_functions_1.formatDate)(createdAt, util_functions_1.DATE_FORMATS.DAY_DD_MM_YY_COMPACT) }))),
|
|
31
|
+
react_1.default.createElement(vista_chat_bubble_v1_1.VistaChatBubbleV1, { createdAt: createdAt, isUser: isUser, message: message, psychic: psychic, user: user, isLast: ind === messages.length - 1 })));
|
|
21
32
|
})));
|
|
22
33
|
};
|
|
23
34
|
var handleOnKeyDown = function (e) {
|
package/package.json
CHANGED
|
@@ -24,6 +24,7 @@ export interface VistaDashboardTopBarV1Props {
|
|
|
24
24
|
handleTheme: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
25
25
|
menuItems?: VistaDashboardTopBarMenuItem[];
|
|
26
26
|
name: string;
|
|
27
|
+
notificationEnabled?: boolean;
|
|
27
28
|
profileMenuItems: VistaDashboardTopBarProfileMenuItem[];
|
|
28
29
|
theme?: VISTA_THEME;
|
|
29
30
|
themeEnabled?: boolean;
|