@appcorp/kismaa-web-ui 0.2.65 → 0.2.69
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/atoms/active-icon.d.ts +1 -1
- package/atoms/active-icon.js +4 -4
- package/molecules/ratings/ratings.stories.d.ts +1 -1
- package/molecules/user-card/props.js +2 -2
- package/molecules/user-card/type.d.ts +1 -1
- package/molecules/user-card/user-card.js +5 -4
- package/organisms/extended-user-card/props.js +2 -2
- package/organisms/extended-user-card/type.d.ts +1 -1
- package/organisms/navbar/logged-in-user-avatar.d.ts +9 -0
- package/organisms/navbar/logged-in-user-avatar.js +144 -0
- package/organisms/navbar/mobile-menu.js +2 -2
- package/organisms/navbar/navbar.js +5 -21
- package/organisms/navbar/notification-item.d.ts +9 -0
- package/organisms/navbar/notification-item.js +21 -0
- package/organisms/navbar/props.js +20 -0
- package/organisms/navbar/type.d.ts +8 -1
- package/organisms/user-cards-grid/props.js +11 -11
- package/organisms/user-details/props.js +2 -2
- package/organisms/user-details/type.d.ts +1 -1
- package/package.json +17 -17
package/atoms/active-icon.d.ts
CHANGED
package/atoms/active-icon.js
CHANGED
|
@@ -5,12 +5,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
var _a;
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.ActiveIcon = void 0;
|
|
8
|
-
var
|
|
8
|
+
var psychic_1 = require("@appcorp/kismaa-utils/api/type/psychic");
|
|
9
9
|
var react_1 = __importDefault(require("react"));
|
|
10
10
|
var statusColorMap = (_a = {},
|
|
11
|
-
_a[
|
|
12
|
-
_a[
|
|
13
|
-
_a[
|
|
11
|
+
_a[psychic_1.PSYCHIC_ONLINE_STATUS.ONLINE] = 'bg-green-500',
|
|
12
|
+
_a[psychic_1.PSYCHIC_ONLINE_STATUS.BUSY] = 'bg-orange-500',
|
|
13
|
+
_a[psychic_1.PSYCHIC_ONLINE_STATUS.OFFLINE] = 'bg-gray-500',
|
|
14
14
|
_a);
|
|
15
15
|
var ActiveIcon = function (_a) {
|
|
16
16
|
var onlineStatus = _a.onlineStatus;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.userCardData = void 0;
|
|
4
|
-
var
|
|
4
|
+
var psychic_1 = require("@appcorp/kismaa-utils/api/type/psychic");
|
|
5
5
|
exports.userCardData = {
|
|
6
6
|
id: '1',
|
|
7
7
|
description: '19210 for reading 2001',
|
|
@@ -9,7 +9,7 @@ exports.userCardData = {
|
|
|
9
9
|
imageSrc: '/card-person.jpg',
|
|
10
10
|
isHovered: false,
|
|
11
11
|
name: 'Manish Kumar Arora',
|
|
12
|
-
onlineStatus:
|
|
12
|
+
onlineStatus: psychic_1.PSYCHIC_ONLINE_STATUS.OFFLINE,
|
|
13
13
|
handleOnMouseEnter: function () { return void 0; },
|
|
14
14
|
handleOnMouseLeave: function () { return void 0; },
|
|
15
15
|
badges: [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LoggedInUser } from '../../organisms/navbar/type';
|
|
2
|
-
import { PSYCHIC_ONLINE_STATUS } from '@appcorp/kismaa-utils';
|
|
2
|
+
import { PSYCHIC_ONLINE_STATUS } from '@appcorp/kismaa-utils/api/type/psychic';
|
|
3
3
|
export interface UserCardProps {
|
|
4
4
|
imageAlt: string;
|
|
5
5
|
imageSrc: string;
|
|
@@ -5,7 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
};
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.UserCard = void 0;
|
|
8
|
-
var
|
|
8
|
+
var psychic_1 = require("@appcorp/kismaa-utils/api/type/psychic");
|
|
9
|
+
var user_1 = require("@appcorp/kismaa-utils/api/type/user");
|
|
9
10
|
var react_1 = __importDefault(require("react"));
|
|
10
11
|
var image_1 = __importDefault(require("next/image"));
|
|
11
12
|
var active_icon_1 = require("../../atoms/active-icon");
|
|
@@ -28,9 +29,9 @@ var UserCard = function (_a) {
|
|
|
28
29
|
react_1.default.createElement("div", { className: "relative h-64 w-full" },
|
|
29
30
|
react_1.default.createElement(image_1.default, { alt: imageAlt, className: "h-full w-full object-cover object-center", fill: true, height: 0, sizes: "20vw", src: imageSrc, width: 0 })),
|
|
30
31
|
isHovered &&
|
|
31
|
-
onlineStatus ===
|
|
32
|
+
onlineStatus === psychic_1.PSYCHIC_ONLINE_STATUS.ONLINE &&
|
|
32
33
|
(loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.userType) &&
|
|
33
|
-
loggedInUser.userType ==
|
|
34
|
+
loggedInUser.userType == user_1.USER_TYPE.USER && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
34
35
|
react_1.default.createElement("div", { className: "absolute inset-0 bg-gradient-to-b from-transparent to-[rgba(22,18,69,0.85)] transition-opacity duration-300" }),
|
|
35
36
|
react_1.default.createElement("div", { className: "absolute bottom-7 flex w-full justify-center" },
|
|
36
37
|
react_1.default.createElement("div", { className: "w-fit" },
|
|
@@ -56,7 +57,7 @@ var UserCard = function (_a) {
|
|
|
56
57
|
price.duration,
|
|
57
58
|
"min")),
|
|
58
59
|
(loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.userType) &&
|
|
59
|
-
loggedInUser.userType ==
|
|
60
|
+
loggedInUser.userType == user_1.USER_TYPE.USER && (react_1.default.createElement("div", { className: "absolute right-2 bottom-2 z-10 cursor-pointer" }, isFavorite ? (react_1.default.createElement("div", { onClick: function (e) {
|
|
60
61
|
e.stopPropagation();
|
|
61
62
|
handleIsFavorite(id);
|
|
62
63
|
} },
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.extendedUserCardData = void 0;
|
|
4
|
-
var
|
|
4
|
+
var psychic_1 = require("@appcorp/kismaa-utils/api/type/psychic");
|
|
5
5
|
exports.extendedUserCardData = {
|
|
6
|
-
onlineStatus:
|
|
6
|
+
onlineStatus: psychic_1.PSYCHIC_ONLINE_STATUS.OFFLINE,
|
|
7
7
|
imageUrl: 'https://ytiwekjzaihrkrirjgpk.supabase.co/storage/v1/object/public/publicBlob/assets/psychic.webp',
|
|
8
8
|
title: 'TRUE HEALER',
|
|
9
9
|
rate: '$199.00/min',
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { LoggedInUser, Notification } from './type';
|
|
3
|
+
interface LoggedInUserProps {
|
|
4
|
+
avatarClassName: string;
|
|
5
|
+
loggedInUser: LoggedInUser | null;
|
|
6
|
+
notificationItems: Notification[] | [];
|
|
7
|
+
}
|
|
8
|
+
export declare const LoggedInUserAvatar: FC<LoggedInUserProps>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
30
|
+
var ownKeys = function(o) {
|
|
31
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
32
|
+
var ar = [];
|
|
33
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
34
|
+
return ar;
|
|
35
|
+
};
|
|
36
|
+
return ownKeys(o);
|
|
37
|
+
};
|
|
38
|
+
return function (mod) {
|
|
39
|
+
if (mod && mod.__esModule) return mod;
|
|
40
|
+
var result = {};
|
|
41
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
42
|
+
__setModuleDefault(result, mod);
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
45
|
+
})();
|
|
46
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
47
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
48
|
+
};
|
|
49
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
+
exports.LoggedInUserAvatar = void 0;
|
|
51
|
+
var atoms_1 = require("../../atoms");
|
|
52
|
+
var react_1 = require("@headlessui/react");
|
|
53
|
+
var image_1 = __importDefault(require("next/image"));
|
|
54
|
+
var vista_vertical_divider_v4_1 = require("@appcorp/app-corp-vista/molecules/vista-vertical-divider-v4");
|
|
55
|
+
var react_popper_1 = require("react-popper");
|
|
56
|
+
var react_2 = __importStar(require("react"));
|
|
57
|
+
var link_1 = __importDefault(require("next/link"));
|
|
58
|
+
var BellIcon_1 = __importDefault(require("@heroicons/react/24/outline/BellIcon"));
|
|
59
|
+
var notification_item_1 = require("./notification-item");
|
|
60
|
+
var LoggedInUserAvatar = function (_a) {
|
|
61
|
+
var _b, _c;
|
|
62
|
+
var avatarClassName = _a.avatarClassName, loggedInUser = _a.loggedInUser, notificationItems = _a.notificationItems;
|
|
63
|
+
var _d = (0, react_2.useState)(null), avatarElement = _d[0], setAvatarElement = _d[1];
|
|
64
|
+
var _e = (0, react_2.useState)(null), notificationElement = _e[0], setNotificationElement = _e[1];
|
|
65
|
+
var _f = (0, react_2.useState)(null), avatarDropdown = _f[0], setAvatarDropdown = _f[1];
|
|
66
|
+
var _g = (0, react_2.useState)(null), notificationDropdown = _g[0], setNotificationDropdown = _g[1];
|
|
67
|
+
var _h = (0, react_popper_1.usePopper)(avatarElement, avatarDropdown, {
|
|
68
|
+
placement: 'top-start',
|
|
69
|
+
modifiers: [
|
|
70
|
+
{
|
|
71
|
+
name: 'offset',
|
|
72
|
+
options: {
|
|
73
|
+
offset: [145, 0],
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
}), avatarStyles = _h.styles, avatarAttributes = _h.attributes;
|
|
78
|
+
var _j = (0, react_popper_1.usePopper)(notificationElement, notificationDropdown, {
|
|
79
|
+
placement: 'top-start',
|
|
80
|
+
modifiers: [
|
|
81
|
+
{
|
|
82
|
+
name: 'offset',
|
|
83
|
+
options: {
|
|
84
|
+
offset: [180, 0],
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
}), notificationStyles = _j.styles, notificationAttributes = _j.attributes;
|
|
89
|
+
var unReadNotifications = (0, react_2.useMemo)(function () {
|
|
90
|
+
return notificationItems === null || notificationItems === void 0 ? void 0 : notificationItems.filter(function (_a) {
|
|
91
|
+
var isRead = _a.isRead;
|
|
92
|
+
return !isRead;
|
|
93
|
+
});
|
|
94
|
+
}, [notificationItems]);
|
|
95
|
+
var readNotifications = (0, react_2.useMemo)(function () {
|
|
96
|
+
return notificationItems === null || notificationItems === void 0 ? void 0 : notificationItems.filter(function (_a) {
|
|
97
|
+
var isRead = _a.isRead;
|
|
98
|
+
return isRead;
|
|
99
|
+
});
|
|
100
|
+
}, [notificationItems]);
|
|
101
|
+
return (react_2.default.createElement("div", null,
|
|
102
|
+
(loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.route) &&
|
|
103
|
+
(loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.menuItems) &&
|
|
104
|
+
!((_b = loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.menuItems) === null || _b === void 0 ? void 0 : _b.length) && (react_2.default.createElement("div", { className: "flex flex-col items-end justify-center" },
|
|
105
|
+
react_2.default.createElement(BellIcon_1.default, { className: "size-8" }),
|
|
106
|
+
react_2.default.createElement(link_1.default, { href: loggedInUser.route }, (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.avatarUrl) ? (react_2.default.createElement(image_1.default, { alt: loggedInUser.firstName, className: avatarClassName, height: 40, src: loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.avatarUrl, width: 40 })) : (react_2.default.createElement(atoms_1.UserIcon, { className: avatarClassName }))))),
|
|
107
|
+
(loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.menuItems) && (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.menuItems.length) > 0 && (react_2.default.createElement("div", { className: "flex flex-row items-center justify-end gap-2" },
|
|
108
|
+
react_2.default.createElement(react_1.Popover, { className: "relative" },
|
|
109
|
+
react_2.default.createElement("div", { className: "flex flex-row items-center justify-center" },
|
|
110
|
+
react_2.default.createElement(react_1.PopoverButton, { ref: setNotificationElement },
|
|
111
|
+
react_2.default.createElement("div", null,
|
|
112
|
+
unReadNotifications.length > 0 && (react_2.default.createElement("span", { className: "relative flex size-3" },
|
|
113
|
+
react_2.default.createElement("span", { className: "bg-primary absolute inline-flex h-full w-full animate-ping rounded-full opacity-75" }),
|
|
114
|
+
react_2.default.createElement("span", { className: "bg-primary relative inline-flex size-3 rounded-full" }))),
|
|
115
|
+
react_2.default.createElement(BellIcon_1.default, { className: "stroke-primary size-7 h-full" })))),
|
|
116
|
+
react_2.default.createElement(react_1.PopoverPanel, __assign({ transition: true, className: "absolute left-1/2 z-10 mt-2 flex w-screen max-w-min -translate-x-1/2 bg-transparent px-4 transition data-closed:translate-y-1 data-closed:opacity-0 data-enter:duration-200 data-enter:ease-out data-leave:duration-150 data-leave:ease-in", ref: setNotificationDropdown, style: notificationStyles.popper }, notificationAttributes.popper),
|
|
117
|
+
react_2.default.createElement("div", { className: "w-86 shrink rounded-xl bg-white p-4 text-sm/6 font-semibold text-gray-900 shadow-lg outline-1 outline-gray-900/5 dark:bg-gray-800 dark:text-white dark:shadow-none dark:outline dark:-outline-offset-1 dark:outline-white/10" },
|
|
118
|
+
notificationItems.length === 0 && (react_2.default.createElement("p", { className: "" }, "No new notifications")),
|
|
119
|
+
react_2.default.createElement("div", { className: "divider-y-gray-300 flex flex-col items-center justify-center" }, unReadNotifications &&
|
|
120
|
+
unReadNotifications.length > 0 &&
|
|
121
|
+
unReadNotifications.map(function (_a) {
|
|
122
|
+
var message = _a.message, time = _a.time, id = _a.id;
|
|
123
|
+
return (react_2.default.createElement(notification_item_1.NotificationItem, { avatarClassName: avatarClassName, id: id, message: message, time: time }));
|
|
124
|
+
})),
|
|
125
|
+
react_2.default.createElement("div", { className: "divider-y-gray-300 flex w-full flex-col items-center justify-center" },
|
|
126
|
+
react_2.default.createElement("div", { className: "w-full" }, readNotifications && readNotifications.length > 0 && (react_2.default.createElement(vista_vertical_divider_v4_1.VistaVerticalDividerV4, { label: "Read Notifications" }))),
|
|
127
|
+
readNotifications &&
|
|
128
|
+
readNotifications.length > 0 &&
|
|
129
|
+
readNotifications.map(function (_a) {
|
|
130
|
+
var message = _a.message, time = _a.time, id = _a.id;
|
|
131
|
+
return (react_2.default.createElement(react_2.default.Fragment, null,
|
|
132
|
+
react_2.default.createElement(notification_item_1.NotificationItem, { avatarClassName: avatarClassName, id: id, message: message, time: time })));
|
|
133
|
+
}))))),
|
|
134
|
+
react_2.default.createElement(react_1.Popover, { className: "relative" },
|
|
135
|
+
react_2.default.createElement("div", { className: "flex flex-col items-end justify-start" },
|
|
136
|
+
react_2.default.createElement(react_1.PopoverButton, { ref: setAvatarElement }, (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.avatarUrl) ? (react_2.default.createElement(image_1.default, { alt: loggedInUser.firstName, className: avatarClassName, height: 40, src: loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.avatarUrl, width: 40 })) : (react_2.default.createElement(atoms_1.UserIcon, { className: avatarClassName })))),
|
|
137
|
+
react_2.default.createElement(react_1.PopoverPanel, __assign({ transition: true, className: "absolute left-1/2 z-10 mt-2 flex w-screen max-w-min -translate-x-1/2 bg-transparent px-4 transition data-closed:translate-y-1 data-closed:opacity-0 data-enter:duration-200 data-enter:ease-out data-leave:duration-150 data-leave:ease-in", ref: setAvatarDropdown, style: avatarStyles.popper }, avatarAttributes.popper),
|
|
138
|
+
react_2.default.createElement("div", { className: "w-56 shrink rounded-xl bg-white p-4 text-sm/6 font-semibold text-gray-900 shadow-lg outline-1 outline-gray-900/5 dark:bg-gray-800 dark:text-white dark:shadow-none dark:outline dark:-outline-offset-1 dark:outline-white/10" }, (_c = loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.menuItems) === null || _c === void 0 ? void 0 : _c.map(function (_a) {
|
|
139
|
+
var label = _a.label, handleOnClick = _a.handleOnClick;
|
|
140
|
+
return (react_2.default.createElement("button", { key: label, className: "hover:text-primary dark:hover:text-primary/50 block cursor-pointer p-2", onClick: handleOnClick },
|
|
141
|
+
react_2.default.createElement("p", { className: "text-primary font-bold" }, label)));
|
|
142
|
+
}))))))));
|
|
143
|
+
};
|
|
144
|
+
exports.LoggedInUserAvatar = LoggedInUserAvatar;
|
|
@@ -9,10 +9,10 @@ var molecules_1 = require("../../molecules");
|
|
|
9
9
|
var image_1 = __importDefault(require("next/image"));
|
|
10
10
|
var react_1 = __importDefault(require("react"));
|
|
11
11
|
var atoms_1 = require("../../atoms");
|
|
12
|
-
var
|
|
12
|
+
var user_1 = require("@appcorp/kismaa-utils/api/type/user");
|
|
13
13
|
var MobileMenu = function (_a) {
|
|
14
14
|
var headerActions = _a.headerActions, isMobileMenuOpen = _a.isMobileMenuOpen, loggedInUser = _a.loggedInUser, navLinks = _a.navLinks, toggleMobileMenu = _a.toggleMobileMenu, homeLink = _a.homeLink;
|
|
15
|
-
var avatarClassName = (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.userType) ===
|
|
15
|
+
var avatarClassName = (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.userType) === user_1.USER_TYPE.USER
|
|
16
16
|
? 'h-10 w-10 rounded-full ring-2 ring-white'
|
|
17
17
|
: 'h-10 w-10 rounded-full';
|
|
18
18
|
return (react_1.default.createElement("div", null, isMobileMenuOpen && (react_1.default.createElement("div", { className: "col-span-2 max-h-90 overflow-y-scroll bg-purple-200/90 lg:hidden" },
|
|
@@ -11,16 +11,13 @@ var Bars3Icon_1 = __importDefault(require("@heroicons/react/24/solid/Bars3Icon")
|
|
|
11
11
|
var XMarkIcon_1 = __importDefault(require("@heroicons/react/24/solid/XMarkIcon"));
|
|
12
12
|
var link_1 = __importDefault(require("next/link"));
|
|
13
13
|
var react_1 = __importDefault(require("react"));
|
|
14
|
-
var image_1 = __importDefault(require("next/image"));
|
|
15
14
|
var mega_menu_1 = require("../mega-menu");
|
|
16
15
|
var header_pointer_icon_1 = require("../../atoms/header-pointer-icon");
|
|
17
|
-
var user_icon_1 = require("../../atoms/user-icon");
|
|
18
|
-
var react_2 = require("@headlessui/react");
|
|
19
16
|
var mobile_menu_1 = require("./mobile-menu");
|
|
20
|
-
var
|
|
17
|
+
var user_1 = require("@appcorp/kismaa-utils/api/type/user");
|
|
18
|
+
var logged_in_user_avatar_1 = require("./logged-in-user-avatar");
|
|
21
19
|
var Navbar = function (_a) {
|
|
22
|
-
var _b, _c;
|
|
23
|
-
var handleMegaMenuToggle = _a.handleMegaMenuToggle, handleSearch = _a.handleSearch, headerActions = _a.headerActions, homeLink = _a.homeLink, isMobileMenuOpen = _a.isMobileMenuOpen, _d = _a.loggedInUser, loggedInUser = _d === void 0 ? null : _d, navLinks = _a.navLinks, _e = _a.showSearch, showSearch = _e === void 0 ? false : _e, toggleMobileMenu = _a.toggleMobileMenu;
|
|
20
|
+
var handleMegaMenuToggle = _a.handleMegaMenuToggle, handleSearch = _a.handleSearch, headerActions = _a.headerActions, homeLink = _a.homeLink, isMobileMenuOpen = _a.isMobileMenuOpen, _b = _a.loggedInUser, loggedInUser = _b === void 0 ? null : _b, navLinks = _a.navLinks, notificationItems = _a.notificationItems, _c = _a.showSearch, showSearch = _c === void 0 ? false : _c, toggleMobileMenu = _a.toggleMobileMenu;
|
|
24
21
|
var renderNavLink = function (link) {
|
|
25
22
|
var _a;
|
|
26
23
|
return (react_1.default.createElement("div", { key: link.label, className: "relative w-fit", onMouseEnter: handleMegaMenuToggle, onMouseLeave: handleMegaMenuToggle },
|
|
@@ -31,7 +28,7 @@ var Navbar = function (_a) {
|
|
|
31
28
|
react_1.default.createElement("div", { className: "absolute w-max pt-10" },
|
|
32
29
|
react_1.default.createElement(mega_menu_1.MegaMenu, { items: link.megaMenuItems }))))));
|
|
33
30
|
};
|
|
34
|
-
var avatarClassName = (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.userType) ===
|
|
31
|
+
var avatarClassName = (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.userType) === user_1.USER_TYPE.USER
|
|
35
32
|
? 'h-10 w-10 cursor-pointer rounded-full ring-2 ring-white'
|
|
36
33
|
: 'h-10 w-10 cursor-pointer rounded-full';
|
|
37
34
|
return (react_1.default.createElement("nav", { className: "fixed z-20 w-full bg-purple-200/90" },
|
|
@@ -53,20 +50,7 @@ var Navbar = function (_a) {
|
|
|
53
50
|
showSearch && (react_1.default.createElement("div", { className: "", onClick: handleSearch },
|
|
54
51
|
react_1.default.createElement(search_icon_1.SearchIcon, { className: "size-5 cursor-pointer" }))),
|
|
55
52
|
loggedInUser ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
56
|
-
(
|
|
57
|
-
(loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.menuItems) &&
|
|
58
|
-
!((_b = loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.menuItems) === null || _b === void 0 ? void 0 : _b.length) && (react_1.default.createElement("div", { className: "flex flex-col items-end justify-center" },
|
|
59
|
-
react_1.default.createElement(link_1.default, { href: loggedInUser.route }, (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.avatarUrl) ? (react_1.default.createElement(image_1.default, { alt: loggedInUser.firstName, className: avatarClassName, height: 40, src: loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.avatarUrl, width: 40 })) : (react_1.default.createElement(user_icon_1.UserIcon, { className: avatarClassName }))))),
|
|
60
|
-
(loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.menuItems) &&
|
|
61
|
-
(loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.menuItems.length) > 0 && (react_1.default.createElement(react_2.Popover, { className: "relative" },
|
|
62
|
-
react_1.default.createElement("div", { className: "flex flex-col items-end justify-start" },
|
|
63
|
-
react_1.default.createElement(react_2.PopoverButton, null, (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.avatarUrl) ? (react_1.default.createElement(image_1.default, { alt: loggedInUser.firstName, className: avatarClassName, height: 40, src: loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.avatarUrl, width: 40 })) : (react_1.default.createElement(user_icon_1.UserIcon, { className: avatarClassName })))),
|
|
64
|
-
react_1.default.createElement(react_2.PopoverPanel, { transition: true, className: "absolute left-1/2 z-10 mt-2 flex w-screen max-w-min -translate-x-1/2 bg-transparent px-4 transition data-closed:translate-y-1 data-closed:opacity-0 data-enter:duration-200 data-enter:ease-out data-leave:duration-150 data-leave:ease-in" },
|
|
65
|
-
react_1.default.createElement("div", { className: "w-56 shrink rounded-xl bg-white p-4 text-sm/6 font-semibold text-gray-900 shadow-lg outline-1 outline-gray-900/5 dark:bg-gray-800 dark:text-white dark:shadow-none dark:outline dark:-outline-offset-1 dark:outline-white/10" }, (_c = loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.menuItems) === null || _c === void 0 ? void 0 : _c.map(function (_a) {
|
|
66
|
-
var label = _a.label, handleOnClick = _a.handleOnClick;
|
|
67
|
-
return (react_1.default.createElement("button", { key: label, className: "hover:text-primary dark:hover:text-primary/50 block cursor-pointer p-2", onClick: handleOnClick },
|
|
68
|
-
react_1.default.createElement("p", { className: "text-primary font-bold" }, label)));
|
|
69
|
-
}))))))) : (react_1.default.createElement("div", { className: "flex items-center justify-end" }, headerActions
|
|
53
|
+
react_1.default.createElement(logged_in_user_avatar_1.LoggedInUserAvatar, { loggedInUser: loggedInUser, avatarClassName: avatarClassName, notificationItems: notificationItems }))) : (react_1.default.createElement("div", { className: "flex items-center justify-end" }, headerActions
|
|
70
54
|
.filter(function (_a) {
|
|
71
55
|
var enabled = _a.enabled;
|
|
72
56
|
return enabled;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.NotificationItem = void 0;
|
|
7
|
+
var react_timeago_1 = __importDefault(require("react-timeago"));
|
|
8
|
+
var misc_1 = require("@appcorp/kismaa-utils/constants/misc");
|
|
9
|
+
var react_1 = __importDefault(require("react"));
|
|
10
|
+
var image_1 = __importDefault(require("next/image"));
|
|
11
|
+
var NotificationItem = function (_a) {
|
|
12
|
+
var avatarClassName = _a.avatarClassName, message = _a.message, time = _a.time;
|
|
13
|
+
var formatter = function (value, unit) { return (react_1.default.createElement("p", { className: "text-xs font-normal text-gray-500" }, "".concat(value).concat(unit.charAt(0)))); };
|
|
14
|
+
return (react_1.default.createElement("div", null,
|
|
15
|
+
react_1.default.createElement("div", { className: "flex w-full flex-row items-center justify-between gap-2 p-2" },
|
|
16
|
+
react_1.default.createElement(image_1.default, { alt: "avatar", className: avatarClassName, height: 40, src: misc_1.referenceAvatar, width: 40 }),
|
|
17
|
+
react_1.default.createElement("p", { className: "text-xs font-normal text-gray-500 dark:text-gray-400" }, message),
|
|
18
|
+
react_1.default.createElement("div", null,
|
|
19
|
+
react_1.default.createElement(react_timeago_1.default, { date: time, formatter: formatter })))));
|
|
20
|
+
};
|
|
21
|
+
exports.NotificationItem = NotificationItem;
|
|
@@ -48,6 +48,26 @@ exports.navbarData = {
|
|
|
48
48
|
type: molecules_1.BUTTON_TYPES.SECONDARY,
|
|
49
49
|
},
|
|
50
50
|
],
|
|
51
|
+
notificationItems: [
|
|
52
|
+
{
|
|
53
|
+
id: '1',
|
|
54
|
+
message: 'Missed chat opportunity with John Doe',
|
|
55
|
+
isRead: false,
|
|
56
|
+
time: new Date('2025-10-01T10:00:00Z').toLocaleDateString(),
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
id: '2',
|
|
60
|
+
message: 'Missed chat opportunity with John Doe',
|
|
61
|
+
isRead: true,
|
|
62
|
+
time: new Date('2025-05-01T10:00:00Z').toLocaleDateString(),
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
id: '3',
|
|
66
|
+
message: 'Missed chat opportunity with John Doe',
|
|
67
|
+
isRead: true,
|
|
68
|
+
time: new Date('2024-10-01T10:00:00Z').toLocaleDateString(),
|
|
69
|
+
},
|
|
70
|
+
],
|
|
51
71
|
handleMegaMenuToggle: function () { return void 0; },
|
|
52
72
|
handleSearch: function () { return void 0; },
|
|
53
73
|
isMobileMenuOpen: false,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MouseEvent } from 'react';
|
|
2
2
|
import { BUTTON_TYPES, MegaMenuCardProps } from '../../molecules';
|
|
3
|
-
import { USER_TYPE } from '@appcorp/kismaa-utils';
|
|
3
|
+
import { USER_TYPE } from '@appcorp/kismaa-utils/api/type/user';
|
|
4
4
|
export interface NavLinks {
|
|
5
5
|
enabled: boolean;
|
|
6
6
|
href: string;
|
|
@@ -28,6 +28,12 @@ export interface LoggedInUser {
|
|
|
28
28
|
menuItems?: MenuItem[];
|
|
29
29
|
userType?: USER_TYPE;
|
|
30
30
|
}
|
|
31
|
+
export interface Notification {
|
|
32
|
+
id: string;
|
|
33
|
+
message: string;
|
|
34
|
+
isRead: boolean;
|
|
35
|
+
time: string;
|
|
36
|
+
}
|
|
31
37
|
export interface NavbarProps {
|
|
32
38
|
handleMegaMenuToggle: (e: MouseEvent<HTMLDivElement>) => void;
|
|
33
39
|
handleSearch: () => void;
|
|
@@ -36,6 +42,7 @@ export interface NavbarProps {
|
|
|
36
42
|
isMobileMenuOpen: boolean;
|
|
37
43
|
loggedInUser: LoggedInUser | null;
|
|
38
44
|
navLinks: NavLinks[];
|
|
45
|
+
notificationItems: Notification[] | [];
|
|
39
46
|
showSearch?: boolean;
|
|
40
47
|
toggleMobileMenu: () => void;
|
|
41
48
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.userGridData = exports.userCardGridData = void 0;
|
|
4
|
-
var
|
|
4
|
+
var psychic_1 = require("@appcorp/kismaa-utils/api/type/psychic");
|
|
5
5
|
exports.userCardGridData = [
|
|
6
6
|
{
|
|
7
7
|
id: '1',
|
|
8
|
-
onlineStatus:
|
|
8
|
+
onlineStatus: psychic_1.PSYCHIC_ONLINE_STATUS.ONLINE,
|
|
9
9
|
imageSrc: 'https://ytiwekjzaihrkrirjgpk.supabase.co/storage/v1/object/public/publicBlob/assets/psychic.webp',
|
|
10
10
|
imageAlt: '',
|
|
11
11
|
name: 'Emma Thompson',
|
|
@@ -44,7 +44,7 @@ exports.userCardGridData = [
|
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
46
|
id: '2',
|
|
47
|
-
onlineStatus:
|
|
47
|
+
onlineStatus: psychic_1.PSYCHIC_ONLINE_STATUS.ONLINE,
|
|
48
48
|
imageSrc: 'https://ytiwekjzaihrkrirjgpk.supabase.co/storage/v1/object/public/publicBlob/assets/psychic.webp',
|
|
49
49
|
imageAlt: '',
|
|
50
50
|
name: 'Michael Chen',
|
|
@@ -72,7 +72,7 @@ exports.userCardGridData = [
|
|
|
72
72
|
},
|
|
73
73
|
{
|
|
74
74
|
id: '3',
|
|
75
|
-
onlineStatus:
|
|
75
|
+
onlineStatus: psychic_1.PSYCHIC_ONLINE_STATUS.OFFLINE,
|
|
76
76
|
imageSrc: 'https://ytiwekjzaihrkrirjgpk.supabase.co/storage/v1/object/public/publicBlob/assets/psychic.webp',
|
|
77
77
|
imageAlt: '',
|
|
78
78
|
name: 'Sophia Rodriguez',
|
|
@@ -100,7 +100,7 @@ exports.userCardGridData = [
|
|
|
100
100
|
},
|
|
101
101
|
{
|
|
102
102
|
id: '4',
|
|
103
|
-
onlineStatus:
|
|
103
|
+
onlineStatus: psychic_1.PSYCHIC_ONLINE_STATUS.ONLINE,
|
|
104
104
|
imageSrc: 'https://ytiwekjzaihrkrirjgpk.supabase.co/storage/v1/object/public/publicBlob/assets/psychic.webp',
|
|
105
105
|
imageAlt: 'Alex Johnson',
|
|
106
106
|
name: 'Alex Johnson',
|
|
@@ -127,7 +127,7 @@ exports.userCardGridData = [
|
|
|
127
127
|
},
|
|
128
128
|
{
|
|
129
129
|
id: '5',
|
|
130
|
-
onlineStatus:
|
|
130
|
+
onlineStatus: psychic_1.PSYCHIC_ONLINE_STATUS.OFFLINE,
|
|
131
131
|
imageSrc: 'https://ytiwekjzaihrkrirjgpk.supabase.co/storage/v1/object/public/publicBlob/assets/psychic.webp',
|
|
132
132
|
imageAlt: 'Olivia Baker',
|
|
133
133
|
name: 'Olivia Baker',
|
|
@@ -154,7 +154,7 @@ exports.userCardGridData = [
|
|
|
154
154
|
},
|
|
155
155
|
{
|
|
156
156
|
id: '6',
|
|
157
|
-
onlineStatus:
|
|
157
|
+
onlineStatus: psychic_1.PSYCHIC_ONLINE_STATUS.ONLINE,
|
|
158
158
|
imageSrc: 'https://ytiwekjzaihrkrirjgpk.supabase.co/storage/v1/object/public/publicBlob/assets/psychic.webp',
|
|
159
159
|
imageAlt: 'Daniel Lee',
|
|
160
160
|
name: 'Daniel Lee',
|
|
@@ -182,7 +182,7 @@ exports.userCardGridData = [
|
|
|
182
182
|
},
|
|
183
183
|
{
|
|
184
184
|
id: '7',
|
|
185
|
-
onlineStatus:
|
|
185
|
+
onlineStatus: psychic_1.PSYCHIC_ONLINE_STATUS.ONLINE,
|
|
186
186
|
imageSrc: 'https://ytiwekjzaihrkrirjgpk.supabase.co/storage/v1/object/public/publicBlob/assets/psychic.webp',
|
|
187
187
|
imageAlt: 'Isbella Martineź',
|
|
188
188
|
name: 'Isabella Martinez',
|
|
@@ -210,7 +210,7 @@ exports.userCardGridData = [
|
|
|
210
210
|
},
|
|
211
211
|
{
|
|
212
212
|
id: '8',
|
|
213
|
-
onlineStatus:
|
|
213
|
+
onlineStatus: psychic_1.PSYCHIC_ONLINE_STATUS.BUSY,
|
|
214
214
|
imageSrc: 'https://ytiwekjzaihrkrirjgpk.supabase.co/storage/v1/object/public/publicBlob/assets/psychic.webp',
|
|
215
215
|
imageAlt: 'William Taylor',
|
|
216
216
|
name: 'William Taylor',
|
|
@@ -238,7 +238,7 @@ exports.userCardGridData = [
|
|
|
238
238
|
},
|
|
239
239
|
{
|
|
240
240
|
id: '9',
|
|
241
|
-
onlineStatus:
|
|
241
|
+
onlineStatus: psychic_1.PSYCHIC_ONLINE_STATUS.ONLINE,
|
|
242
242
|
imageSrc: 'https://ytiwekjzaihrkrirjgpk.supabase.co/storage/v1/object/public/publicBlob/assets/psychic.webp',
|
|
243
243
|
imageAlt: 'Ava Wilson',
|
|
244
244
|
name: 'Ava Wilson',
|
|
@@ -266,7 +266,7 @@ exports.userCardGridData = [
|
|
|
266
266
|
},
|
|
267
267
|
{
|
|
268
268
|
id: '10',
|
|
269
|
-
onlineStatus:
|
|
269
|
+
onlineStatus: psychic_1.PSYCHIC_ONLINE_STATUS.ONLINE,
|
|
270
270
|
imageSrc: 'https://ytiwekjzaihrkrirjgpk.supabase.co/storage/v1/object/public/publicBlob/assets/psychic.webp',
|
|
271
271
|
imageAlt: 'Ethan Brown',
|
|
272
272
|
name: 'Ethan Brown',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.userDetailsData = void 0;
|
|
4
|
-
var
|
|
4
|
+
var psychic_1 = require("@appcorp/kismaa-utils/api/type/psychic");
|
|
5
5
|
var props_1 = require("../attributes-section/props");
|
|
6
6
|
exports.userDetailsData = {
|
|
7
7
|
heading: 'Advisors',
|
|
@@ -10,7 +10,7 @@ exports.userDetailsData = {
|
|
|
10
10
|
aboutTitle: 'About Me',
|
|
11
11
|
description: 'My clairsentient abilities enable me to receive psychic insights by sensing subtle energies and interpreting images from my angels. Starting as a teenager, I discovered my unique gift of consistently seeing a persons soul, always radiating unconditional love, irrespective of their actions. Guided by my angels, Ive honed this ability over 42 years of continuous learning. My extensive practice has allowed me to develop a range of skills, including clairaudience, clairvoyance, empathic abilities, autowriting, energy reading, and Tarot. Remote psychic readings are facilitated by tapping into your energy field, providing accurate insights for both you and those close to you.',
|
|
12
12
|
attributesData: props_1.attributesData,
|
|
13
|
-
onlineStatus:
|
|
13
|
+
onlineStatus: psychic_1.PSYCHIC_ONLINE_STATUS.ONLINE,
|
|
14
14
|
profileImageSrc: '/card-person.jpg',
|
|
15
15
|
profileImageAlt: '',
|
|
16
16
|
title: 'TRUE HEALER',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PSYCHIC_ONLINE_STATUS } from '@appcorp/kismaa-utils';
|
|
1
|
+
import { PSYCHIC_ONLINE_STATUS } from '@appcorp/kismaa-utils/api/type/psychic';
|
|
2
2
|
import { BreadcrumbsProps } from '../../molecules/breadcrumbs';
|
|
3
3
|
import { AttributeItem } from '../attributes-section';
|
|
4
4
|
import { Expertise } from '../extended-user-card';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appcorp/kismaa-web-ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.69",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"main": "lib/main.js",
|
|
6
6
|
"module": "lib/module.js",
|
|
@@ -44,10 +44,9 @@
|
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@appcorp/app-corp-
|
|
48
|
-
"@appcorp/
|
|
49
|
-
"@
|
|
50
|
-
"@chromatic-com/storybook": "3.2.6",
|
|
47
|
+
"@appcorp/app-corp-vista": "^0.3.46",
|
|
48
|
+
"@appcorp/kismaa-utils": "^0.2.64",
|
|
49
|
+
"@chromatic-com/storybook": "^4",
|
|
51
50
|
"@headlessui/react": "^2",
|
|
52
51
|
"@headlessui/tailwindcss": "^0",
|
|
53
52
|
"@heroicons/react": "^2",
|
|
@@ -56,16 +55,11 @@
|
|
|
56
55
|
"@next/eslint-plugin-next": "^15",
|
|
57
56
|
"@next/mdx": "^15",
|
|
58
57
|
"@react-pakistan/util-functions": "^1.24.57",
|
|
59
|
-
"@storybook/addon-
|
|
60
|
-
"@storybook/addon-
|
|
61
|
-
"@storybook/addon-
|
|
62
|
-
"@storybook/addon-
|
|
63
|
-
"@storybook/
|
|
64
|
-
"@storybook/blocks": "^8",
|
|
65
|
-
"@storybook/nextjs": "^8",
|
|
66
|
-
"@storybook/react": "^8",
|
|
67
|
-
"@storybook/test": "^8",
|
|
68
|
-
"@storybook/types": "^8",
|
|
58
|
+
"@storybook/addon-docs": "^9",
|
|
59
|
+
"@storybook/addon-links": "^9",
|
|
60
|
+
"@storybook/addon-onboarding": "^9",
|
|
61
|
+
"@storybook/addon-themes": "^9",
|
|
62
|
+
"@storybook/nextjs": "^9",
|
|
69
63
|
"@tailwindcss/cli": "^4",
|
|
70
64
|
"@tailwindcss/forms": "^0.5.10",
|
|
71
65
|
"@tailwindcss/postcss": "^4",
|
|
@@ -100,14 +94,20 @@
|
|
|
100
94
|
"prettier-plugin-tailwindcss": "^0",
|
|
101
95
|
"react": "^19",
|
|
102
96
|
"react-dom": "^19",
|
|
97
|
+
"react-timeago": "^8.3.0",
|
|
103
98
|
"rimraf": "^6",
|
|
104
|
-
"storybook": "^
|
|
99
|
+
"storybook": "^9",
|
|
105
100
|
"swiper": "^11",
|
|
106
101
|
"tailwindcss": "^4",
|
|
107
102
|
"ts-jest": "^29",
|
|
108
103
|
"ts-node": "^10",
|
|
109
104
|
"typescript": "^5",
|
|
105
|
+
"uuid": "^13",
|
|
110
106
|
"zod": "^4"
|
|
111
107
|
},
|
|
112
|
-
"packageManager": "yarn@4.9.2"
|
|
108
|
+
"packageManager": "yarn@4.9.2",
|
|
109
|
+
"dependencies": {
|
|
110
|
+
"@popperjs/core": "^2.11.8",
|
|
111
|
+
"react-popper": "^2.3.0"
|
|
112
|
+
}
|
|
113
113
|
}
|