@messenger-box/platform-browser 0.0.1-alpha.42 → 0.0.1-alpha.420
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/CHANGELOG.md +540 -27
- package/jest.config.js +23 -7
- package/lib/components/InboxMessage/InboxDetails/index.d.ts +2 -0
- package/lib/components/InboxMessage/InboxDetails/style.d.ts +1 -0
- package/lib/components/InboxMessage/InboxSidebar/index.d.ts +11 -0
- package/lib/components/InboxMessage/InboxSidebar/styles.d.ts +1 -0
- package/lib/components/InboxMessage/Messages/index.d.ts +2 -0
- package/lib/components/InboxMessage/Messages/styles.d.ts +80 -0
- package/lib/components/InboxMessage/MessagesList/index.d.ts +2 -0
- package/lib/components/InboxMessage/Popover/index.d.ts +2 -0
- package/lib/components/InboxMessage/Popover/style.d.ts +27 -0
- package/lib/components/InboxMessage/UserModalContent/index.d.ts +2 -0
- package/lib/components/InboxMessage/UserModalContent/style.d.ts +1 -0
- package/lib/components/InboxMessage/index.d.ts +2 -0
- package/lib/components/InboxMessage/mock.d.ts +19 -0
- package/lib/components/InboxMessage/style.d.ts +1 -0
- package/lib/components/channel_view/DirectChannelView.d.ts +3 -0
- package/lib/components/channel_view/PublicChannelView.d.ts +3 -0
- package/lib/components/dashboard/menu_header.d.ts +5 -0
- package/lib/components/dashboard/modals/direct_modal.d.ts +9 -0
- package/lib/components/dashboard/modals.d.ts +8 -0
- package/lib/components/messenger/index.d.ts +6 -1
- package/lib/components/messenger/messagesList/index.d.ts +6 -4
- package/lib/components/messenger/messagesList/style.d.ts +1 -221
- package/lib/components/messenger/more_action/index.d.ts +11 -0
- package/lib/components/messenger/more_action/style.d.ts +1 -0
- package/lib/components/overlay_trigger.d.ts +3 -3
- package/lib/components/post/channel_intro_message/channel_intro_message.d.ts +2 -1
- package/lib/components/post/channel_layout/channel_identifier_router/channel_identifier_router.d.ts +2 -1
- package/lib/components/post/channel_view/channel_view.d.ts +2 -1
- package/lib/components/post/create_post/create_post.d.ts +2 -1
- package/lib/components/post/failed_post_options/failed_post_options.d.ts +2 -1
- package/lib/components/post/index.d.ts +5 -1
- package/lib/components/post/markdown/markdown.d.ts +2 -1
- package/lib/components/post/post/post.d.ts +2 -1
- package/lib/components/post/post_aria_label_div.d.ts +3 -2
- package/lib/components/post/post_body/post_body.d.ts +2 -1
- package/lib/components/post/post_header/post_header.d.ts +2 -1
- package/lib/components/post/post_header/post_header_custom_status.d.ts +2 -1
- package/lib/components/post/post_header/style.d.ts +1 -40
- package/lib/components/post/post_info/post_info.d.ts +2 -1
- package/lib/components/post/post_list/index.d.ts +2 -1
- package/lib/components/post/post_list/post_list.d.ts +2 -1
- package/lib/components/post/post_list_row/post_list_row.d.ts +2 -1
- package/lib/components/post/post_list_virtualized/latest_post_reader.d.ts +2 -1
- package/lib/components/post/post_list_virtualized/post_list_virtualized.d.ts +2 -1
- package/lib/components/post/post_markdown/post_markdown.d.ts +2 -1
- package/lib/components/post/post_message_view/post_message_view.d.ts +2 -1
- package/lib/components/post/post_pre_header/post_pre_header.d.ts +3 -2
- package/lib/components/post/post_profile_picture/post_profile_picture.d.ts +2 -1
- package/lib/components/post/post_view.d.ts +2 -1
- package/lib/components/post/profile_picture/profile_picture.d.ts +2 -1
- package/lib/components/post/show_more/show_more.d.ts +2 -1
- package/lib/components/post/style.d.ts +1 -93
- package/lib/components/post/threading/channel_threads/thread_footer/thread_footer.d.ts +2 -1
- package/lib/components/post/threading/common/button/button.d.ts +3 -3
- package/lib/components/post/threading/common/follow_button/follow_button.d.ts +2 -2
- package/lib/components/post/tutorial/tutorial_tip/tutorial_tip.d.ts +3 -3
- package/lib/components/post/user_profile/user_profile.d.ts +1 -1
- package/lib/components/status_icon.d.ts +2 -1
- package/lib/components/status_icon_new.d.ts +2 -2
- package/lib/compute.d.ts +8 -2
- package/lib/containers/Inbox.d.ts +3 -0
- package/lib/containers/Messenger.d.ts +5 -1
- package/lib/index.js +3864 -581
- package/lib/index.js.map +1 -1
- package/lib/packages/types/emojis.d.ts +5 -5
- package/lib/packages/types/files.d.ts +5 -5
- package/lib/packages/types/posts.d.ts +13 -13
- package/lib/packages/types/reactions.d.ts +1 -1
- package/lib/packages/types/utilities.d.ts +13 -13
- package/lib/style.d.ts +1 -37
- package/lib/utils/index.d.ts +2 -0
- package/lib/widgets/badges/badge.d.ts +3 -3
- package/lib/widgets/badges/bot_badge.d.ts +1 -1
- package/lib/widgets/badges/guest_badge.d.ts +1 -1
- package/lib/widgets/badges/style.d.ts +1 -23
- package/lib/widgets/icons/emoji_icon.d.ts +1 -1
- package/lib/widgets/icons/flag_icon_filled.d.ts +1 -1
- package/lib/widgets/icons/mattermost_logo.d.ts +1 -1
- package/lib/widgets/icons/status_away_avatar_icon.d.ts +1 -1
- package/lib/widgets/icons/status_away_icon.d.ts +1 -1
- package/lib/widgets/icons/status_dnd_avatar_icon.d.ts +1 -1
- package/lib/widgets/icons/status_dnd_icon.d.ts +1 -1
- package/lib/widgets/icons/status_offline_avatar_icon.d.ts +1 -1
- package/lib/widgets/icons/status_offline_icon.d.ts +1 -1
- package/lib/widgets/icons/status_online_avatar_icon.d.ts +1 -1
- package/lib/widgets/icons/status_online_icon.d.ts +1 -1
- package/lib/widgets/overlay_trigger.d.ts +3 -3
- package/lib/widgets/shared_user_indicator.d.ts +1 -1
- package/lib/widgets/simple_tooltip/simple_tooltip.d.ts +3 -3
- package/lib/widgets/users/avatar/avatar.d.ts +4 -4
- package/lib/widgets/users/avatar/style.d.ts +1 -75
- package/lib/widgets/users/avatars/avatars.d.ts +2 -2
- package/package.json +61 -67
- package/src/components/InboxMessage/InboxDetails/index.tsx +23 -0
- package/src/components/InboxMessage/InboxDetails/style.ts +27 -0
- package/src/components/InboxMessage/InboxSidebar/index.tsx +86 -0
- package/src/components/InboxMessage/InboxSidebar/styles.ts +57 -0
- package/src/components/InboxMessage/Messages/index.tsx +159 -0
- package/src/components/InboxMessage/Messages/styles.ts +85 -0
- package/src/components/InboxMessage/MessagesList/index.tsx +93 -0
- package/src/components/InboxMessage/Popover/index.tsx +57 -0
- package/src/components/InboxMessage/Popover/style.ts +27 -0
- package/src/components/InboxMessage/UserModalContent/index.tsx +60 -0
- package/src/components/InboxMessage/UserModalContent/style.ts +98 -0
- package/src/components/InboxMessage/index.tsx +286 -0
- package/src/components/InboxMessage/mock.ts +53 -0
- package/src/components/InboxMessage/style.ts +189 -0
- package/src/components/channel_view/DirectChannelView.tsx +25 -0
- package/src/components/channel_view/PublicChannelView.tsx +24 -0
- package/src/components/dashboard/menu_header.tsx +49 -0
- package/src/components/dashboard/modals/direct_modal.tsx +46 -0
- package/src/components/dashboard/modals.tsx +93 -0
- package/src/components/messenger/avatar/index.tsx +2 -4
- package/src/components/messenger/avatar/style.ts +3 -3
- package/src/components/messenger/index.tsx +258 -94
- package/src/components/messenger/messagesList/index.tsx +673 -249
- package/src/components/messenger/messagesList/messageBox.tsx +2 -1
- package/src/components/messenger/messagesList/style.ts +240 -14
- package/src/components/messenger/more_action/index.tsx +68 -0
- package/src/components/messenger/more_action/style.ts +45 -0
- package/src/components/messenger/postMessage/postMessage.tsx +2 -3
- package/src/components/messenger/postMessage/style.ts +3 -3
- package/src/components/messenger/sidebarThreadList/index.tsx +11 -10
- package/src/components/messenger/style.ts +16 -16
- package/src/components/messenger/threadSidebar/index.tsx +5 -5
- package/src/components/messenger/threadSidebar/style.ts +7 -7
- package/src/components/messenger/types/message.ts +1 -0
- package/src/components/post/channel_intro_message/channel_intro_message.tsx +0 -1
- package/src/components/post/index.tsx +102 -25
- package/src/components/post/post/post.tsx +8 -1
- package/src/components/post/post_header/post_header_custom_status.tsx +1 -2
- package/src/components/post/post_header/style.ts +3 -6
- package/src/components/post/style.ts +22 -8
- package/src/components/post/tutorial/tutorial_tip/tutorial_tip.tsx +1 -0
- package/src/components/post/user_profile/user_profile.tsx +1 -0
- package/src/compute.tsx +58 -37
- package/src/containers/Dashboard.tsx +488 -1
- package/src/containers/Inbox.tsx +13 -0
- package/src/containers/Loading.tsx +1 -1
- package/src/containers/Messenger.tsx +9 -4
- package/src/module.ts +10 -7
- package/src/style.ts +382 -19
- package/src/utils/index.ts +22 -0
- package/src/widgets/badges/badge.tsx +1 -2
- package/src/widgets/badges/style.ts +3 -3
- package/src/widgets/icons/accordion_toggle_icon.tsx +1 -1
- package/src/widgets/icons/add_reaction_icon.tsx +1 -1
- package/src/widgets/icons/admin_eye_icon.tsx +1 -1
- package/src/widgets/icons/alert_icon.tsx +1 -1
- package/src/widgets/icons/archive_icon.tsx +1 -1
- package/src/widgets/icons/arrow_right_icon.tsx +1 -1
- package/src/widgets/icons/at_icon.tsx +1 -1
- package/src/widgets/icons/attachment_icon.tsx +1 -1
- package/src/widgets/icons/back_icon.tsx +1 -1
- package/src/widgets/icons/bot_icon.tsx +1 -1
- package/src/widgets/icons/camera_icon.tsx +1 -1
- package/src/widgets/icons/checkbox_checked_icon.tsx +1 -1
- package/src/widgets/icons/checkbox_partial_icon.tsx +1 -1
- package/src/widgets/icons/close_circle_icon.tsx +1 -1
- package/src/widgets/icons/close_circle_solid_icon.tsx +1 -1
- package/src/widgets/icons/close_icon.tsx +1 -1
- package/src/widgets/icons/dots_horizontal.tsx +1 -1
- package/src/widgets/icons/download_icon.tsx +1 -1
- package/src/widgets/icons/draft_icon.tsx +1 -1
- package/src/widgets/icons/ellipsis_h_icon.tsx +1 -1
- package/src/widgets/icons/email_icon.tsx +1 -1
- package/src/widgets/icons/fa_add_icon.tsx +1 -1
- package/src/widgets/icons/fa_back_icon.tsx +1 -1
- package/src/widgets/icons/fa_dropdown_icon.tsx +1 -1
- package/src/widgets/icons/fa_edit_icon.tsx +1 -1
- package/src/widgets/icons/fa_logout_icon.tsx +1 -1
- package/src/widgets/icons/fa_next_icon.tsx +1 -1
- package/src/widgets/icons/fa_previous_icon.tsx +1 -1
- package/src/widgets/icons/fa_reload_icon.tsx +1 -1
- package/src/widgets/icons/fa_remove_icon.tsx +1 -1
- package/src/widgets/icons/fa_search_icon.tsx +1 -1
- package/src/widgets/icons/fa_select_icon.tsx +1 -1
- package/src/widgets/icons/fa_success_icon.tsx +1 -1
- package/src/widgets/icons/fa_warning_icon.tsx +1 -1
- package/src/widgets/icons/flag_icon.tsx +1 -1
- package/src/widgets/icons/gfycat_icon.tsx +1 -1
- package/src/widgets/icons/gif_reactions_icon.tsx +1 -1
- package/src/widgets/icons/gif_search_clear_icon.tsx +1 -1
- package/src/widgets/icons/gif_search_icon.tsx +1 -1
- package/src/widgets/icons/gif_trending_icon.tsx +1 -1
- package/src/widgets/icons/globe_icon.tsx +1 -1
- package/src/widgets/icons/icons.stories.js +1 -1
- package/src/widgets/icons/info_icon.tsx +1 -1
- package/src/widgets/icons/info_small_icon.tsx +1 -1
- package/src/widgets/icons/invite_icon.tsx +1 -1
- package/src/widgets/icons/invite_members_icon.tsx +1 -1
- package/src/widgets/icons/link_icon.tsx +1 -1
- package/src/widgets/icons/lock_icon.tsx +1 -1
- package/src/widgets/icons/mail_icon.tsx +1 -1
- package/src/widgets/icons/mail_plus_icon.tsx +1 -1
- package/src/widgets/icons/member_icon.tsx +1 -1
- package/src/widgets/icons/mentions_icon.tsx +1 -1
- package/src/widgets/icons/menu_icon.tsx +1 -1
- package/src/widgets/icons/message_icon.tsx +1 -1
- package/src/widgets/icons/pin_icon.tsx +1 -1
- package/src/widgets/icons/plugin_channel_header_icon.tsx +1 -1
- package/src/widgets/icons/plugin_icon.tsx +1 -1
- package/src/widgets/icons/reply_icon.tsx +1 -1
- package/src/widgets/icons/scroll_to_bottom_icon.tsx +1 -1
- package/src/widgets/icons/search_icon.tsx +1 -1
- package/src/widgets/icons/shield_outline_icon.tsx +1 -1
- package/src/widgets/icons/unarchive_icon.tsx +1 -1
- package/src/widgets/icons/unread_below_icon.tsx +1 -1
- package/src/widgets/icons/user_guide_icon.tsx +1 -1
- package/src/widgets/shared_user_indicator.tsx +1 -0
- package/src/widgets/simple_tooltip/simple_tooltip.tsx +1 -0
- package/src/widgets/users/avatar/avatar.tsx +1 -2
- package/src/widgets/users/avatar/style.ts +3 -3
- package/src/widgets/users/avatars/avatars.tsx +1 -0
- package/tsconfig.json +2 -1
- package/webpack.config.js +1 -1
- package/lib/components/messenger/mock.d.ts +0 -50
- package/lib/components/messenger/postMessage/postMessage.d.ts +0 -1
- package/lib/components/messenger/postMessage/style.d.ts +0 -22
- package/lib/components/messenger/sidebarThreadList/index.d.ts +0 -7
- package/lib/components/messenger/threadSidebar/index.d.ts +0 -1
- package/lib/components/messenger/threadSidebar/style.d.ts +0 -62
- package/lib/components/messenger/types/message.d.ts +0 -14
- package/src/api.ts +0 -35
- package/src/components/Counter.tsx +0 -52
- package/src/containers/Clock.tsx +0 -0
- package/src/containers/Counter.tsx +0 -42
- package/src/containers/PersonList.tsx +0 -20
- package/src/containers/ServerCounter.tsx +0 -140
- package/src/graphql/index.ts +0 -3
- package/src/graphql/mutations/addCount.graphql +0 -5
- package/src/graphql/mutations/addPerson.graphql +0 -6
- package/src/graphql/mutations/index.ts +0 -2
- package/src/graphql/queries/count.graphql +0 -5
- package/src/graphql/queries/index.ts +0 -3
- package/src/graphql/queries/person.graphql +0 -22
- package/src/graphql/queries/persons.graphql +0 -6
- package/src/graphql/subscriptions/count.graphql +0 -5
- package/src/graphql/subscriptions/index.ts +0 -1
- package/src/redux/__mocks__/api.ts +0 -4
- package/src/redux/actions/__tests__/sampleActions.test.ts +0 -159
- package/src/redux/actions/index.ts +0 -1
- package/src/redux/actions/sampleActions.ts +0 -91
- package/src/redux/index.ts +0 -2
- package/src/redux/reducers/Store.ts +0 -10
- package/src/redux/reducers/__tests__/sampleReducers.test.ts +0 -39
- package/src/redux/reducers/index.ts +0 -7
- package/src/redux/reducers/sampleReducers.ts +0 -71
- /package/src/components/post/channel_layout/{channel_controller.test.jsx → channel_controller.test.tsx} +0 -0
- /package/src/components/post/channel_layout/{channel_controller.jsx → channel_controller.tsx} +0 -0
|
@@ -1,324 +1,748 @@
|
|
|
1
|
-
import React, { FC } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import React, { FC, useState } from 'react';
|
|
2
|
+
import { Avatar, Col, Popover, Row } from 'antd';
|
|
3
|
+
import { Comment, } from '@ant-design/compatible';
|
|
4
4
|
import { useSelector } from 'react-redux';
|
|
5
|
-
import
|
|
6
|
-
import '
|
|
7
|
-
import { Comment, Popover, Avatar } from 'antd';
|
|
8
|
-
import { BiEdit } from 'react-icons/bi';
|
|
9
|
-
import { BiPaperPlane } from 'react-icons/bi';
|
|
5
|
+
// import 'antd/dist/antd.css';
|
|
6
|
+
import { BiDotsVerticalRounded, BiPaperPlane, BiDotsHorizontalRounded } from 'react-icons/bi';
|
|
10
7
|
import Moment from 'moment';
|
|
11
|
-
import {
|
|
8
|
+
import { css } from '@emotion/css';
|
|
12
9
|
import { styleSheet3 } from './style';
|
|
13
10
|
import { IoBookmarkOutline } from 'react-icons/io5';
|
|
14
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
MdModeEditOutline,
|
|
13
|
+
MdOutlineAddReaction,
|
|
14
|
+
MdOutlineCloudDownload,
|
|
15
|
+
MdOutlineDesktopMac,
|
|
16
|
+
MdOutlineEmojiEmotions,
|
|
17
|
+
} from 'react-icons/md';
|
|
18
|
+
import { VscChromeClose } from 'react-icons/vsc';
|
|
19
|
+
import { FaRobot } from 'react-icons/fa';
|
|
20
|
+
import { TiUserAdd } from 'react-icons/ti';
|
|
21
|
+
import { RiShareForwardLine } from 'react-icons/ri';
|
|
22
|
+
import { BsReply } from 'react-icons/bs';
|
|
23
|
+
import { GrClose } from 'react-icons/gr';
|
|
15
24
|
import { styleSheet2 } from '../../post/style';
|
|
25
|
+
import { Picker } from 'emoji-mart';
|
|
26
|
+
import MoreAction from '../more_action';
|
|
27
|
+
import { Button, Modal } from 'react-bootstrap';
|
|
28
|
+
import { IPostFragment } from '@messenger-box/core';
|
|
29
|
+
|
|
16
30
|
interface IProps {
|
|
17
|
-
userMessagesList:
|
|
31
|
+
userMessagesList: IPostFragment[];
|
|
18
32
|
handleShowSideBar: () => void;
|
|
33
|
+
handleDeleteMessage: any;
|
|
34
|
+
handleEditMessage: any;
|
|
35
|
+
channel: any;
|
|
36
|
+
currentUsrId: string;
|
|
19
37
|
}
|
|
20
38
|
|
|
21
|
-
export const MessagesList: FC<IProps> = ({
|
|
22
|
-
|
|
39
|
+
export const MessagesList: FC<IProps> = ({
|
|
40
|
+
userMessagesList,
|
|
41
|
+
handleShowSideBar,
|
|
42
|
+
handleDeleteMessage,
|
|
43
|
+
handleEditMessage,
|
|
44
|
+
channel,
|
|
45
|
+
currentUsrId
|
|
46
|
+
}) => {
|
|
47
|
+
const [showMoreAction, setShowMoreAction] = useState<boolean>(false);
|
|
23
48
|
const userId = useSelector<any>((state) => state.user.auth0UserId);
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
});
|
|
29
|
-
const
|
|
49
|
+
const [pinMessage, setPinMessage] = useState<boolean>(false);
|
|
50
|
+
const [displayEmoji, setDisplayEmoji] = useState(false);
|
|
51
|
+
const [msgIndex, setMsgIndex] = useState();
|
|
52
|
+
const [emoji, setEmoji] = useState([]);
|
|
53
|
+
const [msgClr, setMsgClr] = useState({});
|
|
54
|
+
const [id, setId] = useState<any>();
|
|
55
|
+
const [showPreview, setShowPreview] = useState<any>(false);
|
|
56
|
+
const [clickedImage, setClickedImage] = useState<any>({});
|
|
57
|
+
const [show, setShow] = useState(false);
|
|
58
|
+
const [showAddMember, setShowAddMember] = useState(false);
|
|
59
|
+
const [inputValue, setInputValue] = useState({ id: '', msg: '' });
|
|
60
|
+
|
|
61
|
+
console.log('-------Selected channel for chatting---------', channel)
|
|
62
|
+
console.log('-------All messages for selected channel---------', userMessagesList)
|
|
63
|
+
|
|
64
|
+
const emojiClick = (msgId, id) => {
|
|
65
|
+
setDisplayEmoji(!displayEmoji);
|
|
66
|
+
setMsgIndex(msgId);
|
|
67
|
+
setId(id);
|
|
68
|
+
};
|
|
69
|
+
const handleOnSelect = (e) => {
|
|
70
|
+
// setEnterValue(enterValue + emoji.native)
|
|
71
|
+
setEmoji((emoji) => [...emoji, e.native]);
|
|
72
|
+
setDisplayEmoji(false);
|
|
73
|
+
setMsgIndex(null);
|
|
74
|
+
};
|
|
75
|
+
const handlePinBtn = (id: any) => {
|
|
76
|
+
userMessagesList.find((element) => {
|
|
77
|
+
if (element.id == id) {
|
|
78
|
+
return (element.isPinned = !element.isPinned);
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
setShowMoreAction(false);
|
|
82
|
+
setPinMessage(!pinMessage);
|
|
83
|
+
};
|
|
84
|
+
const handleEdit = (name) => {
|
|
85
|
+
handleEditMessage(inputValue.id, inputValue.msg);
|
|
86
|
+
setShowMoreAction(false);
|
|
87
|
+
handleClose(name);
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
const handleClose = (name) => {
|
|
91
|
+
switch (name) {
|
|
92
|
+
case 'editMessage': {
|
|
93
|
+
setShow(false);
|
|
94
|
+
break;
|
|
95
|
+
}
|
|
96
|
+
case 'addMember': {
|
|
97
|
+
setShowAddMember(false);
|
|
98
|
+
break;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
const handleShow = (id, msg) => {
|
|
103
|
+
setInputValue({ id: id, msg: msg });
|
|
104
|
+
setShow(true);
|
|
105
|
+
};
|
|
106
|
+
const handleChange = (e) => {
|
|
107
|
+
setInputValue({ ...inputValue, msg: e.target.value });
|
|
108
|
+
};
|
|
109
|
+
const removeEmoji = (index) => {
|
|
110
|
+
setEmoji(emoji.filter((e) => emoji.indexOf(e) !== index));
|
|
111
|
+
};
|
|
112
|
+
const styles = {
|
|
113
|
+
backgroundColor: '#fffbed',
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
const handleShowPreview = (file, msgDetails) => {
|
|
117
|
+
setClickedImage({ file: file, msgDetail: msgDetails })
|
|
118
|
+
setShowPreview(true)
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const handleDownload = (id) => {
|
|
122
|
+
document.getElementById(id).click()
|
|
123
|
+
}
|
|
124
|
+
|
|
30
125
|
return (
|
|
31
126
|
<div>
|
|
127
|
+
<Modal show={show} onHide={() => handleClose('editMessage')}>
|
|
128
|
+
<Modal.Header
|
|
129
|
+
style={{ backgroundColor: '#2b5ebf', color: 'white', display: 'flex', alignItems: 'center' }}
|
|
130
|
+
>
|
|
131
|
+
<Modal.Title>Edit Message</Modal.Title>
|
|
132
|
+
<VscChromeClose
|
|
133
|
+
onClick={() => handleClose('addMember')}
|
|
134
|
+
fontSize="16px"
|
|
135
|
+
style={{ marginLeft: 'auto', cursor: 'pointer' }}
|
|
136
|
+
/>
|
|
137
|
+
</Modal.Header>
|
|
138
|
+
<Modal.Body>
|
|
139
|
+
<input type="text" value={inputValue.msg} onChange={(e) => handleChange(e)} />
|
|
140
|
+
</Modal.Body>
|
|
141
|
+
<Modal.Footer>
|
|
142
|
+
<Button onClick={() => handleClose('editMessage')}>Close</Button>
|
|
143
|
+
<Button
|
|
144
|
+
style={{ backgroundColor: '#2b5ebf', color: 'white' }}
|
|
145
|
+
onClick={() => handleEdit('editMessage')}
|
|
146
|
+
>
|
|
147
|
+
Save
|
|
148
|
+
</Button>
|
|
149
|
+
</Modal.Footer>
|
|
150
|
+
</Modal>
|
|
151
|
+
<Modal show={showAddMember} onHide={() => handleClose('addMember')}>
|
|
152
|
+
<Modal.Header
|
|
153
|
+
style={{ backgroundColor: '#2b5ebf', color: 'white', display: 'flex', alignItems: 'center' }}
|
|
154
|
+
>
|
|
155
|
+
<Modal.Title>Add New Members to My First Public Channel</Modal.Title>
|
|
156
|
+
<VscChromeClose
|
|
157
|
+
onClick={() => handleClose('addMember')}
|
|
158
|
+
fontSize="16px"
|
|
159
|
+
style={{ marginLeft: 'auto', cursor: 'pointer' }}
|
|
160
|
+
/>
|
|
161
|
+
</Modal.Header>
|
|
162
|
+
<Modal.Body>
|
|
163
|
+
<input type="search" onChange={(e) => handleChange(e)} />
|
|
164
|
+
</Modal.Body>
|
|
165
|
+
</Modal>
|
|
32
166
|
<div className={css(styleSheet2.customStyle as any)}>
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
display: 'flex',
|
|
40
|
-
flexDirection: 'column',
|
|
41
|
-
}}
|
|
42
|
-
>
|
|
43
|
-
<Avatar
|
|
44
|
-
size={{ xxl: 100 }}
|
|
167
|
+
{!channel ? (
|
|
168
|
+
<Popover
|
|
169
|
+
placement="right"
|
|
170
|
+
title={<a>{'@' + 'surveybot'}</a>}
|
|
171
|
+
content={
|
|
172
|
+
<div
|
|
45
173
|
style={{
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
marginLeft: '25px',
|
|
49
|
-
alignItems: 'center',
|
|
174
|
+
display: 'flex',
|
|
175
|
+
flexDirection: 'column',
|
|
50
176
|
}}
|
|
51
177
|
>
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
178
|
+
<Avatar
|
|
179
|
+
size={{ xxl: 100 }}
|
|
180
|
+
style={{
|
|
181
|
+
backgroundColor: 'black',
|
|
182
|
+
marginBottom: '15px',
|
|
183
|
+
marginLeft: '25px',
|
|
184
|
+
alignItems: 'center',
|
|
185
|
+
}}
|
|
186
|
+
>
|
|
187
|
+
<FaRobot style={{ marginTop: '22px' }} fontSize="50px" fill="white" />
|
|
188
|
+
</Avatar>
|
|
189
|
+
<p style={{ fontWeight: 'bold' }}>Surveybot</p>
|
|
190
|
+
<p>Survey bot collects your..</p>
|
|
191
|
+
<div>
|
|
192
|
+
<h5>
|
|
193
|
+
Local Time <span>{Moment().format('HH:mm A')}</span>
|
|
194
|
+
</h5>
|
|
195
|
+
</div>
|
|
196
|
+
<a className="icon-popover">
|
|
197
|
+
<BiPaperPlane style={{ fontSize: '15px', marginRight: '3px' }} />
|
|
198
|
+
Send Message
|
|
199
|
+
</a>
|
|
60
200
|
</div>
|
|
61
|
-
|
|
201
|
+
}
|
|
202
|
+
trigger="click"
|
|
203
|
+
>
|
|
204
|
+
<Avatar className="main_avatar">
|
|
205
|
+
<FaRobot className="inner_main_avatar" />
|
|
206
|
+
</Avatar>
|
|
207
|
+
</Popover>
|
|
208
|
+
) : (
|
|
209
|
+
''
|
|
210
|
+
)}
|
|
211
|
+
{channel ? (
|
|
212
|
+
<div>
|
|
213
|
+
<p style={{ fontSize: '20px', fontWeight: 600, color: '#4b4a4e' }}>
|
|
214
|
+
Beginning of {channel.type !== 'DIRECT' ?
|
|
215
|
+
channel.title :
|
|
216
|
+
channel.displayName.split('_').length === 2 ?
|
|
217
|
+
channel.displayName.split('_')[0].split('-')[0] !== currentUsrId ?
|
|
218
|
+
channel.displayName.split('_')[0].split('-')[1] :
|
|
219
|
+
channel.displayName.split('_')[1].split('-')[1] : channel.displayName
|
|
220
|
+
}
|
|
221
|
+
</p>
|
|
222
|
+
{channel.type !== 'DIRECT' ? (
|
|
223
|
+
''
|
|
224
|
+
) : (
|
|
225
|
+
<h5>Direct messages and files shared here are not shown to people outside this area.</h5>
|
|
226
|
+
)}
|
|
227
|
+
<div className='di_chat_head'>
|
|
228
|
+
<a
|
|
229
|
+
style={{ marginRight: '1.5em' }}
|
|
230
|
+
onClick={() => {
|
|
231
|
+
setShowAddMember(true);
|
|
232
|
+
}}
|
|
233
|
+
>
|
|
234
|
+
<TiUserAdd /> <h5>Invite others to this channel</h5>
|
|
235
|
+
</a>
|
|
236
|
+
<a>
|
|
237
|
+
<MdModeEditOutline /> <h5>Set a Header</h5>
|
|
238
|
+
</a>
|
|
62
239
|
</div>
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
Direct messages and files shared here are not shown to people outside this area.
|
|
77
|
-
</p>
|
|
240
|
+
</div>
|
|
241
|
+
) : (
|
|
242
|
+
<>
|
|
243
|
+
<div className="text-nav">
|
|
244
|
+
<h5>surveybot</h5>
|
|
245
|
+
<span>BOT</span>
|
|
246
|
+
</div>
|
|
247
|
+
<p className="p_style">This is the start of your direct message history with surveybot.</p>
|
|
248
|
+
<p className="p_style">
|
|
249
|
+
Direct messages and files shared here are not shown to people outside this area.
|
|
250
|
+
</p>
|
|
251
|
+
</>
|
|
252
|
+
)}
|
|
78
253
|
</div>
|
|
79
254
|
<Row className={css(styleSheet3.customStyle as any)}>
|
|
80
|
-
{userMessagesList?.map((item
|
|
81
|
-
if (!item.
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
255
|
+
{userMessagesList?.map((item, index: number) => {
|
|
256
|
+
if (!msgClr.hasOwnProperty(item.author.username)) {
|
|
257
|
+
let temp = msgClr;
|
|
258
|
+
let color = '#';
|
|
259
|
+
for (let i = 0; i < 6; i++) {
|
|
260
|
+
color += Math.floor(Math.random() * 10);
|
|
261
|
+
}
|
|
262
|
+
temp[item.author.username] = color;
|
|
263
|
+
setMsgClr(temp);
|
|
264
|
+
}
|
|
265
|
+
// if (!item.loginUser) {
|
|
266
|
+
return (
|
|
267
|
+
<Col
|
|
268
|
+
md={24}
|
|
269
|
+
key={index}
|
|
270
|
+
className={css(styleSheet3.customStyleDemo as any)}
|
|
271
|
+
style={item.isPinned ? styles : null}
|
|
272
|
+
>
|
|
273
|
+
{index !== 0 ?
|
|
274
|
+
Moment(userMessagesList[index].createdAt).format('DD/MM/YYYY')
|
|
275
|
+
!== Moment(userMessagesList[index - 1].createdAt).format('DD/MM/YYYY') ?
|
|
276
|
+
<div className="text-divider">
|
|
277
|
+
{Moment(item.createdAt).diff(Moment().format(), "year") == 0
|
|
278
|
+
? Moment(item.createdAt).diff(Moment().format(), "day") == 0
|
|
279
|
+
? 'Today'
|
|
280
|
+
: Moment(item.createdAt).diff(Moment().format(), "day") == -1
|
|
281
|
+
? 'Yesterday'
|
|
282
|
+
: Moment(item.createdAt).diff(Moment().format(), "day") >= -6
|
|
283
|
+
? `${Moment(item.createdAt).format('dddd')}`
|
|
284
|
+
: `${Moment(item.createdAt).format('MMMM DD')}`
|
|
285
|
+
: `${Moment(item.createdAt).format('MMMM Do, YYYY')}`
|
|
286
|
+
}
|
|
98
287
|
</div>
|
|
288
|
+
: ''
|
|
289
|
+
:
|
|
290
|
+
<div className="text-divider">
|
|
291
|
+
{Moment(item.createdAt).diff(Moment().format(), "year") == 0
|
|
292
|
+
? Moment(item.createdAt).diff(Moment().format(), "day") == 0
|
|
293
|
+
? 'Today'
|
|
294
|
+
: Moment(item.createdAt).diff(Moment().format(), "day") == -1
|
|
295
|
+
? 'Yesterday'
|
|
296
|
+
: Moment(item.createdAt).diff(Moment().format(), "day") >= -6
|
|
297
|
+
? `${Moment(item.createdAt).format('dddd')}`
|
|
298
|
+
: `${Moment(item.createdAt).format('MMMM DD')}`
|
|
299
|
+
: `${Moment(item.createdAt).format('MMMM Do, YYYY')}`
|
|
300
|
+
}
|
|
301
|
+
</div>}
|
|
302
|
+
{displayEmoji && msgIndex === index ? (
|
|
303
|
+
<Picker
|
|
304
|
+
onSelect={handleOnSelect}
|
|
305
|
+
native={true}
|
|
306
|
+
set="apple"
|
|
307
|
+
emoji="point_up"
|
|
308
|
+
title="Pick your emoji..."
|
|
309
|
+
emojiSize={24}
|
|
310
|
+
perLine={6}
|
|
311
|
+
color="#ae65c5"
|
|
312
|
+
sheetSize={16}
|
|
313
|
+
showPreview={true}
|
|
314
|
+
showSkinTones={false}
|
|
315
|
+
notFoundEmoji="sleuth_or_spy"
|
|
316
|
+
/>
|
|
317
|
+
) : (
|
|
318
|
+
''
|
|
319
|
+
)}
|
|
320
|
+
<div className="btn-hover">
|
|
321
|
+
<div className="hover_btns">
|
|
322
|
+
<button>
|
|
323
|
+
<BiDotsHorizontalRounded
|
|
324
|
+
fontSize="16px"
|
|
325
|
+
fill="gray"
|
|
326
|
+
onClick={() => setShowMoreAction(!showMoreAction)}
|
|
327
|
+
/>
|
|
328
|
+
{showMoreAction ? (
|
|
329
|
+
<MoreAction
|
|
330
|
+
handleShowSideBar={handleShowSideBar}
|
|
331
|
+
handleDeleteMessage={() => {
|
|
332
|
+
handleDeleteMessage(item.id);
|
|
333
|
+
setShowMoreAction(false);
|
|
334
|
+
}}
|
|
335
|
+
handleEditMessage={() => handleShow(item.id, item.message)}
|
|
336
|
+
handlePinBtn={handlePinBtn}
|
|
337
|
+
id={item.id}
|
|
338
|
+
pinMessage={pinMessage}
|
|
339
|
+
/>
|
|
340
|
+
) : null}
|
|
341
|
+
</button>
|
|
342
|
+
<button onClick={() => emojiClick(index, item.id)}>
|
|
343
|
+
<MdOutlineEmojiEmotions fontSize="16px" fill="gray" />
|
|
344
|
+
</button>
|
|
345
|
+
<button>
|
|
346
|
+
<IoBookmarkOutline fontSize="16px" color="gray" />
|
|
347
|
+
</button>
|
|
348
|
+
<button onClick={handleShowSideBar}>
|
|
349
|
+
<BsReply fontSize="16px" fill="gray" />
|
|
350
|
+
</button>
|
|
99
351
|
</div>
|
|
100
|
-
|
|
352
|
+
</div>
|
|
353
|
+
{/*<div className="text-divider">Today</div>*/}
|
|
354
|
+
{item.message.endsWith('joined the channel')
|
|
355
|
+
?
|
|
101
356
|
<Comment
|
|
102
357
|
className="chat-cmt"
|
|
103
358
|
// actions={actions}
|
|
104
|
-
author={<a>
|
|
359
|
+
// author={<a>{item.author !== null?item.author.username:'User'}</a>}
|
|
360
|
+
author={<a>System</a>}
|
|
105
361
|
avatar={
|
|
106
|
-
<
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
style={{
|
|
119
|
-
backgroundColor: 'black',
|
|
120
|
-
marginBottom: '15px',
|
|
121
|
-
marginLeft: '25px',
|
|
122
|
-
alignItems: 'center',
|
|
123
|
-
}}
|
|
124
|
-
>
|
|
125
|
-
<FaRobot
|
|
126
|
-
style={{ marginTop: '22px' }}
|
|
127
|
-
fontSize="50px"
|
|
128
|
-
fill="white"
|
|
129
|
-
/>
|
|
130
|
-
</Avatar>
|
|
131
|
-
<p style={{ fontWeight: 'bold' }}>Surveybot</p>
|
|
132
|
-
<p>Survey bot collects your..</p>
|
|
133
|
-
<div>
|
|
134
|
-
<h5>
|
|
135
|
-
Local Time <span>{Moment().format('HH:mm A')}</span>
|
|
136
|
-
</h5>
|
|
137
|
-
</div>
|
|
138
|
-
<a className="icon-popover"><BiPaperPlane style={{fontSize : '15px' , marginRight : '3px' }} />Send Message</a>
|
|
139
|
-
</div>
|
|
140
|
-
}
|
|
141
|
-
trigger="click"
|
|
142
|
-
>
|
|
143
|
-
<Avatar style={{ backgroundColor: 'black' }}>
|
|
144
|
-
<FaRobot style={{ marginTop: '4px' }} fontSize="20px" fill="white" />
|
|
145
|
-
</Avatar>
|
|
146
|
-
</Popover>
|
|
362
|
+
<Avatar style={{ background: 'gray' }}>
|
|
363
|
+
<MdOutlineDesktopMac
|
|
364
|
+
style={{ marginTop: '4px', width: '24px', height: '25px' }} />
|
|
365
|
+
</Avatar>
|
|
366
|
+
}
|
|
367
|
+
content={
|
|
368
|
+
<>
|
|
369
|
+
<p>
|
|
370
|
+
<a>{item.message.split(' ')[0]}</a>
|
|
371
|
+
` ${item.message.split(' ').splice(1).join(' ')}
|
|
372
|
+
</p>
|
|
373
|
+
</>
|
|
147
374
|
}
|
|
148
|
-
content={<p>{item?.message}</p>}
|
|
149
375
|
datetime={
|
|
150
|
-
// <Tooltip title={Moment().format('YYYY-MM-DD HH:mm:ss')}>
|
|
151
376
|
<div>
|
|
152
|
-
|
|
153
|
-
<span>{Moment().format('HH:mm A')}</span>
|
|
377
|
+
<span>{Moment(item.createdAt).format('HH:mm A')}</span>
|
|
154
378
|
</div>
|
|
155
|
-
/*</Tooltip>*/
|
|
156
379
|
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
);
|
|
160
|
-
} else {
|
|
161
|
-
return (
|
|
162
|
-
<Col md={24} key={index} className={css(styleSheet3.customStyleDemo as any)}>
|
|
163
|
-
<div className="btn-hover">
|
|
164
|
-
<div className="hover_btns">
|
|
165
|
-
<button>
|
|
166
|
-
<BiDotsHorizontalRounded fontSize="16px" fill="gray" />
|
|
167
|
-
</button>
|
|
168
|
-
<button>
|
|
169
|
-
<MdOutlineEmojiEmotions fontSize="16px" fill="gray" />
|
|
170
|
-
</button>
|
|
171
|
-
<button>
|
|
172
|
-
<IoBookmarkOutline fontSize="16px" color="gray" />
|
|
173
|
-
</button>
|
|
174
|
-
<button onClick={handleShowSideBar}>
|
|
175
|
-
<BsReply fontSize="16px" fill="gray" />
|
|
176
|
-
</button>
|
|
177
|
-
</div>
|
|
178
|
-
</div>
|
|
179
|
-
<div className="text-divider">Today</div>
|
|
380
|
+
/>
|
|
381
|
+
:
|
|
180
382
|
<Comment
|
|
383
|
+
className="chat-cmt"
|
|
181
384
|
// actions={actions}
|
|
182
|
-
author={<a>{
|
|
385
|
+
// author={<a>{item.author !== null?item.author.username:'User'}</a>}
|
|
386
|
+
author={<a>{item.author ? item.author.username : 'user'}</a>}
|
|
183
387
|
avatar={
|
|
184
388
|
<Popover
|
|
185
389
|
placement="right"
|
|
186
|
-
title={<a>{'@' +
|
|
390
|
+
title={<a>{'@' + item.author.username}</a>}
|
|
187
391
|
content={
|
|
188
392
|
<div
|
|
189
393
|
style={{
|
|
190
394
|
display: 'flex',
|
|
191
395
|
flexDirection: 'column',
|
|
192
|
-
alignItems: 'center',
|
|
193
396
|
}}
|
|
194
397
|
>
|
|
195
398
|
<Avatar
|
|
196
|
-
size=
|
|
399
|
+
size="large"
|
|
197
400
|
style={{
|
|
198
|
-
backgroundColor: '
|
|
199
|
-
textTransform: 'uppercase',
|
|
200
|
-
fontSize: '50px',
|
|
401
|
+
backgroundColor: 'red',
|
|
201
402
|
marginBottom: '15px',
|
|
403
|
+
marginLeft: '25px',
|
|
404
|
+
alignItems: 'center',
|
|
202
405
|
}}
|
|
203
406
|
>
|
|
204
|
-
{
|
|
407
|
+
{item.author.username
|
|
408
|
+
.match(/\b(\w)/g)
|
|
409
|
+
.join('')
|
|
410
|
+
.toUpperCase()}
|
|
205
411
|
</Avatar>
|
|
206
|
-
<
|
|
412
|
+
<p style={{ fontWeight: 'bold' }}>{item.author.username}</p>
|
|
413
|
+
{/*<p>Survey bot collects your..</p>*/}
|
|
207
414
|
<div>
|
|
208
415
|
<h5>
|
|
209
|
-
Local Time
|
|
416
|
+
Local Time{' '}
|
|
417
|
+
<span>{Moment(item.createdAt).format('HH:mm A')}</span>
|
|
210
418
|
</h5>
|
|
211
419
|
</div>
|
|
212
|
-
<a className="icon-popover"
|
|
420
|
+
<a className="icon-popover">
|
|
421
|
+
<BiPaperPlane style={{ fontSize: '15px', marginRight: '3px' }} />
|
|
422
|
+
Send Message
|
|
423
|
+
</a>
|
|
213
424
|
</div>
|
|
214
425
|
}
|
|
215
426
|
trigger="click"
|
|
216
427
|
>
|
|
217
|
-
<Avatar style={{ backgroundColor:
|
|
218
|
-
{
|
|
428
|
+
<Avatar style={{ backgroundColor: `${msgClr[item.author.username]}` }}>
|
|
429
|
+
{item.author.username
|
|
430
|
+
.match(/\b(\w)/g)
|
|
431
|
+
.join('')
|
|
432
|
+
.toUpperCase()}
|
|
219
433
|
</Avatar>
|
|
220
434
|
</Popover>
|
|
221
435
|
}
|
|
222
|
-
content={<p>{item?.message}</p>}
|
|
223
|
-
datetime={
|
|
224
|
-
// <Tooltip title={Moment().format('YYYY-MM-DD HH:mm:ss')}>
|
|
225
|
-
<div>
|
|
226
|
-
{/*<span>{Moment().fromNow()}</span>*/}
|
|
227
|
-
<span>{Moment().format('HH:mm A')} </span>
|
|
228
|
-
</div>
|
|
229
|
-
/*</Tooltip>*/
|
|
230
|
-
}
|
|
231
|
-
></Comment>
|
|
232
|
-
</Col>
|
|
233
|
-
);
|
|
234
|
-
}
|
|
235
|
-
})}
|
|
236
|
-
</Row>
|
|
237
|
-
</div>
|
|
238
|
-
);
|
|
239
|
-
};
|
|
240
|
-
|
|
241
|
-
export const ThreadMessagesList: FC<IProps> = ({userMessagesList, handleShowSideBar}) => {
|
|
242
|
-
|
|
243
|
-
const {css} = useFela();
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
return (
|
|
247
|
-
<div>
|
|
248
|
-
<Row className={css(styleSheet3.customStyle as any)}>
|
|
249
|
-
{userMessagesList?.map((item: IMessageList, index: number) => {
|
|
250
|
-
if (!item.loginUser) {
|
|
251
|
-
return (
|
|
252
|
-
<Col md={24} key={index} className={css(styleSheet3.customStyleDemo as any)}>
|
|
253
|
-
<div className='btn-hover'>
|
|
254
|
-
<div className='hover_btns'>
|
|
255
|
-
<button><BiDotsHorizontalRounded fontSize='16px' fill='gray'/></button>
|
|
256
|
-
<button><MdOutlineEmojiEmotions fontSize='16px' fill='gray'/></button>
|
|
257
|
-
<button><IoBookmarkOutline fontSize='16px' color='gray'/></button>
|
|
258
|
-
</div>
|
|
259
|
-
</div>
|
|
260
|
-
<div className="text-divider">Text h.biu guu divider</div>
|
|
261
|
-
<Comment
|
|
262
|
-
className='chat-cmt'
|
|
263
|
-
// actions={actions}
|
|
264
|
-
author={<a>Slack Bot</a>}
|
|
265
|
-
avatar={
|
|
266
|
-
<Avatar style={{backgroundColor: "black"}}><FaRobot style={{marginTop:'4px'}} fontSize='20px' fill='white'/></Avatar>
|
|
267
|
-
}
|
|
268
436
|
content={
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
437
|
+
<>
|
|
438
|
+
<p style={{ color: "black" }}>{item?.message}</p>
|
|
439
|
+
{item.files.totalCount > 0
|
|
440
|
+
? item.files.data.map(file => {
|
|
441
|
+
if (['gif', 'png', 'bmp', 'jpeg', 'jpg'].includes(file.extension)) {
|
|
442
|
+
return (
|
|
443
|
+
<div className="msg_img_preview">
|
|
444
|
+
<div className="options_style">
|
|
445
|
+
<MdOutlineCloudDownload
|
|
446
|
+
onClick={() => handleDownload(file.id)} />
|
|
447
|
+
<RiShareForwardLine />
|
|
448
|
+
<BiDotsVerticalRounded />
|
|
449
|
+
</div>
|
|
450
|
+
<img src={file.url} className="preview_img_style"
|
|
451
|
+
onClick={e => handleShowPreview(file, item)}></img>
|
|
452
|
+
<a href={file.url} download={file.name} id={file.id}
|
|
453
|
+
style={{ display: 'none' }}></a>
|
|
454
|
+
</div>
|
|
455
|
+
)
|
|
456
|
+
}
|
|
457
|
+
})
|
|
458
|
+
: ''
|
|
459
|
+
}
|
|
460
|
+
{emoji && item.id === id
|
|
461
|
+
? emoji.map((e, index) => {
|
|
462
|
+
return (
|
|
463
|
+
<button
|
|
464
|
+
className="reactionClass"
|
|
465
|
+
onClick={() => {
|
|
466
|
+
removeEmoji(index);
|
|
467
|
+
}}
|
|
468
|
+
>
|
|
469
|
+
{e}
|
|
470
|
+
<span>1</span>
|
|
471
|
+
</button>
|
|
472
|
+
);
|
|
473
|
+
})
|
|
474
|
+
: ''
|
|
475
|
+
}
|
|
476
|
+
{emoji.length && item.id === id ? (
|
|
477
|
+
<button
|
|
478
|
+
style={{
|
|
479
|
+
border: '0px',
|
|
480
|
+
fontSize: '20px',
|
|
481
|
+
padding: '2px',
|
|
482
|
+
position: 'absolute',
|
|
483
|
+
}}
|
|
484
|
+
>
|
|
485
|
+
<MdOutlineAddReaction fill="gray" />
|
|
486
|
+
</button>
|
|
487
|
+
) : (
|
|
488
|
+
''
|
|
489
|
+
)}
|
|
490
|
+
</>
|
|
303
491
|
}
|
|
304
492
|
datetime={
|
|
305
493
|
// <Tooltip title={Moment().format('YYYY-MM-DD HH:mm:ss')}>
|
|
306
494
|
<div>
|
|
307
495
|
{/*<span>{Moment().fromNow()}</span>*/}
|
|
308
|
-
<span>{Moment().format('HH:mm A')}
|
|
496
|
+
<span>{Moment(item.createdAt).format('HH:mm A')}</span>
|
|
309
497
|
</div>
|
|
310
498
|
/*</Tooltip>*/
|
|
311
499
|
}
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
500
|
+
/>
|
|
501
|
+
}
|
|
502
|
+
</Col>
|
|
503
|
+
);
|
|
504
|
+
// } else {
|
|
505
|
+
// return (
|
|
506
|
+
// <Col
|
|
507
|
+
// md={24}
|
|
508
|
+
// key={index}
|
|
509
|
+
// className={css(styleSheet3.customStyleDemo as any)}
|
|
510
|
+
// style={item?.isPin ? styles : null}
|
|
511
|
+
// >
|
|
512
|
+
// {displayEmoji && msgIndex === index ?
|
|
513
|
+
// <Picker
|
|
514
|
+
// onSelect={handleOnSelect}
|
|
515
|
+
// native={true}
|
|
516
|
+
// set="apple"
|
|
517
|
+
// emoji="point_up"
|
|
518
|
+
// title="Pick your emoji..."
|
|
519
|
+
// emojiSize={24}
|
|
520
|
+
// perLine={6}
|
|
521
|
+
// color="#ae65c5"
|
|
522
|
+
// sheetSize={16}
|
|
523
|
+
// showPreview={true}
|
|
524
|
+
// showSkinTones={false}
|
|
525
|
+
// notFoundEmoji="sleuth_or_spy"
|
|
526
|
+
// /> : ''
|
|
527
|
+
// }
|
|
528
|
+
// <div className="btn-hover">
|
|
529
|
+
// <div className="hover_btns">
|
|
530
|
+
// <button>
|
|
531
|
+
// <BiDotsHorizontalRounded
|
|
532
|
+
// fontSize="16px"
|
|
533
|
+
// fill="gray"
|
|
534
|
+
// onClick={() => setShowMoreAction(!showMoreAction)}
|
|
535
|
+
// />
|
|
536
|
+
// {showMoreAction ? (
|
|
537
|
+
// <MoreAction
|
|
538
|
+
// handleShowSideBar={handleShowSideBar}
|
|
539
|
+
// handleDeleteMessage={handleDeleteMessage}
|
|
540
|
+
// id={item.id}
|
|
541
|
+
// handlePinBtn={handlePinBtn}
|
|
542
|
+
// pinMessage={pinMessage}
|
|
543
|
+
// />
|
|
544
|
+
// ) : null}
|
|
545
|
+
// </button>
|
|
546
|
+
// <button onClick={() => emojiClick(index)}>
|
|
547
|
+
// <MdOutlineEmojiEmotions fontSize="16px" fill="gray"/>
|
|
548
|
+
// </button>
|
|
549
|
+
// <button>
|
|
550
|
+
// <IoBookmarkOutline fontSize="16px" color="gray"/>
|
|
551
|
+
// </button>
|
|
552
|
+
// <button onClick={handleShowSideBar}>
|
|
553
|
+
// <BsReply fontSize="16px" fill="gray"/>
|
|
554
|
+
// </button>
|
|
555
|
+
// </div>
|
|
556
|
+
// </div>
|
|
557
|
+
// {
|
|
558
|
+
// item.timeIsToday ?
|
|
559
|
+
// !separatorDisplaying ?
|
|
560
|
+
// <>
|
|
561
|
+
// <div className="text-divider">Today</div>
|
|
562
|
+
// {separatorDisplaying = true}
|
|
563
|
+
// </>: '' : ''
|
|
564
|
+
// }
|
|
565
|
+
// <Comment
|
|
566
|
+
// // actions={actions}
|
|
567
|
+
// author={<a>{getUserAccount?.username}</a>}
|
|
568
|
+
// avatar={
|
|
569
|
+
// <Popover
|
|
570
|
+
// placement="right"
|
|
571
|
+
// title={<a>{'@' + getUserAccount.username}</a>}
|
|
572
|
+
// content={
|
|
573
|
+
// <div
|
|
574
|
+
// style={{
|
|
575
|
+
// display: 'flex',
|
|
576
|
+
// flexDirection: 'column',
|
|
577
|
+
// alignItems: 'center',
|
|
578
|
+
// }}
|
|
579
|
+
// >
|
|
580
|
+
// <Avatar
|
|
581
|
+
// size={{xxl: 100}}
|
|
582
|
+
// style={{
|
|
583
|
+
// backgroundColor: 'blue',
|
|
584
|
+
// textTransform: 'uppercase',
|
|
585
|
+
// fontSize: '50px',
|
|
586
|
+
// marginBottom: '15px',
|
|
587
|
+
// }}
|
|
588
|
+
// >
|
|
589
|
+
// {getUserAccount?.username.substring(0, 1)}
|
|
590
|
+
// </Avatar>
|
|
591
|
+
// <a>{getUserAccount?.email}</a>
|
|
592
|
+
// <div>
|
|
593
|
+
// <h5>
|
|
594
|
+
// Local Time <span>{Moment().format('HH:mm A')}</span>
|
|
595
|
+
// </h5>
|
|
596
|
+
// </div>
|
|
597
|
+
// <a
|
|
598
|
+
// className="icon-popover"
|
|
599
|
+
// style={{display: 'flex', justifyContent: 'c'}}
|
|
600
|
+
// >
|
|
601
|
+
// <BiEdit style={{fontSize: '15px', marginRight: '3px'}}/>
|
|
602
|
+
// Edit Account Setting
|
|
603
|
+
// </a>
|
|
604
|
+
// </div>
|
|
605
|
+
// }
|
|
606
|
+
// trigger="click"
|
|
607
|
+
// >
|
|
608
|
+
// <Avatar style={{backgroundColor: 'blue', textTransform: 'uppercase'}}>
|
|
609
|
+
// {getUserAccount?.username.substring(0, 1)}
|
|
610
|
+
// </Avatar>
|
|
611
|
+
// </Popover>
|
|
612
|
+
// }
|
|
613
|
+
// content={<p>{item?.message}</p>}
|
|
614
|
+
// datetime={
|
|
615
|
+
// // <Tooltip title={Moment().format('YYYY-MM-DD HH:mm:ss')}>
|
|
616
|
+
// <div>
|
|
617
|
+
// {/*<span>{Moment().fromNow()}</span>*/}
|
|
618
|
+
// <span>{Moment().format('HH:mm A')} </span>
|
|
619
|
+
// </div>
|
|
620
|
+
// /*</Tooltip>*/
|
|
621
|
+
// }
|
|
622
|
+
// />
|
|
623
|
+
// </Col>
|
|
624
|
+
// );
|
|
625
|
+
// }
|
|
318
626
|
})}
|
|
319
627
|
</Row>
|
|
320
|
-
</div>
|
|
321
628
|
|
|
629
|
+
<Modal className={css(styleSheet3.modalCustomStyle as any)} show={showPreview}
|
|
630
|
+
onHide={() => handleClose('directChannel')}>
|
|
631
|
+
<div className="mod_head_style">
|
|
632
|
+
<Modal.Header
|
|
633
|
+
style={{ backgroundColor: '', color: 'white', display: 'flex' }}>
|
|
634
|
+
<div className="header_main">
|
|
635
|
+
<div className="header_img">{clickedImage.msgDetail?.author.username
|
|
636
|
+
.match(/\b(\w)/g)
|
|
637
|
+
.join('')
|
|
638
|
+
.toUpperCase()}</div>
|
|
639
|
+
<div className="header_text">
|
|
640
|
+
<h4>{clickedImage.msgDetail?.author.username}</h4>
|
|
641
|
+
<p>{clickedImage.file?.name}</p>
|
|
642
|
+
</div>
|
|
643
|
+
</div>
|
|
644
|
+
<GrClose onClick={() => setShowPreview(false)} />
|
|
645
|
+
</Modal.Header>
|
|
646
|
+
</div>
|
|
647
|
+
<div className="modal_main">
|
|
648
|
+
|
|
649
|
+
<Modal.Body>
|
|
650
|
+
<div>
|
|
651
|
+
<img className="clk_img" src={clickedImage.file?.url} />
|
|
652
|
+
</div>
|
|
653
|
+
</Modal.Body>
|
|
654
|
+
</div>
|
|
655
|
+
<div className="mod_head_style">
|
|
656
|
+
<Modal.Footer>
|
|
657
|
+
<p>Working..........</p>
|
|
658
|
+
</Modal.Footer>
|
|
659
|
+
</div>
|
|
660
|
+
</Modal>
|
|
661
|
+
</div>
|
|
322
662
|
);
|
|
323
663
|
};
|
|
324
664
|
|
|
665
|
+
// export const ThreadMessagesList: FC<IProps> = ({ userMessagesList, handleShowSideBar }) => {
|
|
666
|
+
//
|
|
667
|
+
// return <></>;
|
|
668
|
+
// return (
|
|
669
|
+
// <div>
|
|
670
|
+
// <Row className={css(styleSheet3.customStyle as any)}>
|
|
671
|
+
// {userMessagesList?.map((item: IMessageList, index: number) => {
|
|
672
|
+
// if (!item.loginUser) {
|
|
673
|
+
// return (
|
|
674
|
+
// <Col md={24} key={index} className={css(styleSheet3.customStyleDemo as any)}>
|
|
675
|
+
// <div className="btn-hover">
|
|
676
|
+
// <div className="hover_btns">
|
|
677
|
+
// <button>
|
|
678
|
+
// <BiDotsHorizontalRounded fontSize="16px" fill="gray"/>
|
|
679
|
+
// </button>
|
|
680
|
+
// <button>
|
|
681
|
+
// <MdOutlineEmojiEmotions fontSize="16px" fill="gray"/>
|
|
682
|
+
// </button>
|
|
683
|
+
// <button>
|
|
684
|
+
// <IoBookmarkOutline fontSize="16px" color="gray"/>
|
|
685
|
+
// </button>
|
|
686
|
+
// </div>
|
|
687
|
+
// </div>
|
|
688
|
+
// <div className="text-divider">Text h.biu guu divider</div>
|
|
689
|
+
// <Comment
|
|
690
|
+
// className="chat-cmt"
|
|
691
|
+
// // actions={actions}
|
|
692
|
+
// author={<a>Slack Bot</a>}
|
|
693
|
+
// avatar={
|
|
694
|
+
// <Avatar style={{backgroundColor: 'black'}}>
|
|
695
|
+
// <FaRobot style={{marginTop: '4px'}} fontSize="20px" fill="white"/>
|
|
696
|
+
// </Avatar>
|
|
697
|
+
// }
|
|
698
|
+
// content={<p>{item?.message}</p>}
|
|
699
|
+
// datetime={
|
|
700
|
+
// // <Tooltip title={Moment().format('YYYY-MM-DD HH:mm:ss')}>
|
|
701
|
+
// <div>
|
|
702
|
+
// {/*<span>{Moment().fromNow()}</span>*/}
|
|
703
|
+
// <span>{Moment().format('HH:mm A')}</span>
|
|
704
|
+
// </div>
|
|
705
|
+
// /*</Tooltip>*/
|
|
706
|
+
// }
|
|
707
|
+
// ></Comment>
|
|
708
|
+
// </Col>
|
|
709
|
+
// );
|
|
710
|
+
// } else {
|
|
711
|
+
// return (
|
|
712
|
+
// <Col md={24} key={index} className={css(styleSheet3.customStyleDemo as any)}>
|
|
713
|
+
// <div className="btn-hover">
|
|
714
|
+
// <div className="hover_btns">
|
|
715
|
+
// <button>
|
|
716
|
+
// <BiDotsHorizontalRounded fontSize="16px" fill="gray"/>
|
|
717
|
+
// </button>
|
|
718
|
+
// <button>
|
|
719
|
+
// <MdOutlineEmojiEmotions fontSize="16px" fill="gray"/>
|
|
720
|
+
// </button>
|
|
721
|
+
// <button>
|
|
722
|
+
// <IoBookmarkOutline fontSize="16px" color="gray"/>
|
|
723
|
+
// </button>
|
|
724
|
+
// </div>
|
|
725
|
+
// </div>
|
|
726
|
+
// <div className="text-divider">Text h.biu guu divider</div>
|
|
727
|
+
// <Comment
|
|
728
|
+
// // actions={actions}
|
|
729
|
+
// author={<a>Han Solo</a>}
|
|
730
|
+
// avatar={<Avatar style={{backgroundColor: 'blue'}}>HS</Avatar>}
|
|
731
|
+
// content={<p>{item?.message}</p>}
|
|
732
|
+
// datetime={
|
|
733
|
+
// // <Tooltip title={Moment().format('YYYY-MM-DD HH:mm:ss')}>
|
|
734
|
+
// <div>
|
|
735
|
+
// {/*<span>{Moment().fromNow()}</span>*/}
|
|
736
|
+
// <span>{Moment().format('HH:mm A')} </span>
|
|
737
|
+
// </div>
|
|
738
|
+
// /*</Tooltip>*/
|
|
739
|
+
// }
|
|
740
|
+
// ></Comment>
|
|
741
|
+
// </Col>
|
|
742
|
+
// );
|
|
743
|
+
// }
|
|
744
|
+
// })}
|
|
745
|
+
// </Row>
|
|
746
|
+
// </div>
|
|
747
|
+
// );
|
|
748
|
+
// };
|