@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
package/package.json
CHANGED
|
@@ -1,69 +1,63 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
"
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
"
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
"access": "public"
|
|
64
|
-
},
|
|
65
|
-
"typescript": {
|
|
66
|
-
"definition": "lib/index.d.ts"
|
|
67
|
-
},
|
|
68
|
-
"gitHead": "d9693199acbe3645190a03f1db346c3b19c09873"
|
|
2
|
+
"name": "@messenger-box/platform-browser",
|
|
3
|
+
"version": "0.0.1-alpha.420",
|
|
4
|
+
"description": "Sample core for higher packages to depend on",
|
|
5
|
+
"license": "ISC",
|
|
6
|
+
"author": "CDMBase LLC",
|
|
7
|
+
"main": "lib/index.js",
|
|
8
|
+
"typings": "lib/index.d.ts",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "yarn build:clean && yarn build:lib",
|
|
11
|
+
"build:clean": "rimraf lib",
|
|
12
|
+
"build:lib": "webpack",
|
|
13
|
+
"build:lib:watch": "yarn build:lib -- --watch",
|
|
14
|
+
"jest": "./node_modules/.bin/jest",
|
|
15
|
+
"prepublish": "yarn build",
|
|
16
|
+
"test": "jest",
|
|
17
|
+
"test:debug": "npm test -- --runInBand",
|
|
18
|
+
"test:watch": "npm test -- --watch",
|
|
19
|
+
"watch": "yarn build:lib:watch"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@ant-design/compatible": "^5.1.1",
|
|
23
|
+
"@chakra-ui/icons": "^1.0.16",
|
|
24
|
+
"@chakra-ui/react": "~1.6.12",
|
|
25
|
+
"@container-stack/file-info-client": "^0.0.53",
|
|
26
|
+
"@emotion/react": "^11",
|
|
27
|
+
"@emotion/styled": "^11",
|
|
28
|
+
"@messenger-box/core": "0.0.1-alpha.420",
|
|
29
|
+
"@messenger-box/platform-client": "0.0.1-alpha.420",
|
|
30
|
+
"bootstrap": "3.4.1",
|
|
31
|
+
"css-vars-ponyfill": "2.4.5",
|
|
32
|
+
"dynamic-virtualized-list": "github:mattermost/dynamic-virtualized-list#119db968c96643c7106d4d2c965f05b2e251bc83",
|
|
33
|
+
"emoji-mart": "^3.0.1",
|
|
34
|
+
"font-awesome": "4.7.0",
|
|
35
|
+
"framer-motion": "^4",
|
|
36
|
+
"jasny-bootstrap": "3.1.3",
|
|
37
|
+
"key-mirror": "1.0.1",
|
|
38
|
+
"moment-timezone": "0.5.33",
|
|
39
|
+
"react-bootstrap": "github:mattermost/react-bootstrap#c6957962364e0818a51bbfd13e89919903b422d6",
|
|
40
|
+
"react-icons": "^4.2.0",
|
|
41
|
+
"react-intl": "5.20.4",
|
|
42
|
+
"react-select": "5.2.0",
|
|
43
|
+
"react-virtualized-auto-sizer": "1.0.5",
|
|
44
|
+
"reselect": "4.0.0"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@types/bootstrap": "4.5.0",
|
|
48
|
+
"@types/moment-timezone": "0.5.30",
|
|
49
|
+
"@types/react-bootstrap": "0.32.22",
|
|
50
|
+
"@types/react-virtualized-auto-sizer": "1.0.0"
|
|
51
|
+
},
|
|
52
|
+
"peerDependencies": {
|
|
53
|
+
"@apollo/client": "*",
|
|
54
|
+
"lodash": "*"
|
|
55
|
+
},
|
|
56
|
+
"publishConfig": {
|
|
57
|
+
"access": "public"
|
|
58
|
+
},
|
|
59
|
+
"typescript": {
|
|
60
|
+
"definition": "lib/index.d.ts"
|
|
61
|
+
},
|
|
62
|
+
"gitHead": "24214a864c4c5ce31cf68a9dab80e8680f649945"
|
|
69
63
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Button } from '@chakra-ui/react';
|
|
3
|
+
import { CloseOutlined } from '@ant-design/icons';
|
|
4
|
+
import { css } from '@emotion/css';
|
|
5
|
+
import { styleSheet } from './style';
|
|
6
|
+
|
|
7
|
+
export default function InboxDetails({ handleToggle, toggleDrawer }: any) {
|
|
8
|
+
|
|
9
|
+
return (
|
|
10
|
+
<div className={css(styleSheet.detailDrawerStyles)}>
|
|
11
|
+
<div className="details">
|
|
12
|
+
<h4>Details</h4>
|
|
13
|
+
<Button
|
|
14
|
+
onClick={handleToggle}
|
|
15
|
+
as="a"
|
|
16
|
+
className="close-btn"
|
|
17
|
+
marginRight='10px'
|
|
18
|
+
rightIcon={<CloseOutlined color="black" />}
|
|
19
|
+
></Button>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export const styleSheet = {
|
|
2
|
+
detailDrawerStyles: {
|
|
3
|
+
width: '100%',
|
|
4
|
+
'& .details': {
|
|
5
|
+
borderBottom: '1px solid #eaeaea',
|
|
6
|
+
height: '55px',
|
|
7
|
+
display: 'flex',
|
|
8
|
+
alignItems: 'center',
|
|
9
|
+
paddingLeft: '10px',
|
|
10
|
+
justifyContent: 'space-between',
|
|
11
|
+
'& h4': {
|
|
12
|
+
color: 'black',
|
|
13
|
+
fontSize: '1em',
|
|
14
|
+
fontWeight: 'bold',
|
|
15
|
+
},
|
|
16
|
+
'& .close-btn ': {
|
|
17
|
+
marginTop: '0',
|
|
18
|
+
'& svg': {
|
|
19
|
+
color: 'black',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
'& .close-btn:hover ': {
|
|
23
|
+
background: '#eaeaea',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
} as any;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Avatar, Button } from '@chakra-ui/react';
|
|
3
|
+
import Moment from 'moment';
|
|
4
|
+
import { css } from '@emotion/css';
|
|
5
|
+
import { inboxData } from '../mock';
|
|
6
|
+
import { styleSheet } from './styles';
|
|
7
|
+
|
|
8
|
+
type IPropsType = {
|
|
9
|
+
handleSelectMessgae?: any;
|
|
10
|
+
user?: [] | any;
|
|
11
|
+
messageList?: any;
|
|
12
|
+
currentUser?: any;
|
|
13
|
+
userId?: any;
|
|
14
|
+
users?: any;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default function InboxSidebar({ handleSelectMessgae, user, messageList, userId, users }: IPropsType) {
|
|
18
|
+
const userList = users?.filter((item) => {
|
|
19
|
+
return item?.id !== userId;
|
|
20
|
+
});
|
|
21
|
+
return (
|
|
22
|
+
<div className={css(styleSheet.inboxSibarStyles)}>
|
|
23
|
+
{user?.length > 0 ? (
|
|
24
|
+
user?.map((item, index) => {
|
|
25
|
+
const lastMessage = messageList[messageList?.length - 1];
|
|
26
|
+
let memberId;
|
|
27
|
+
item?.members.find((ele) => {
|
|
28
|
+
if (ele.user !== userId) {
|
|
29
|
+
memberId = ele.user;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
const userMember = userList.find((element) => {
|
|
33
|
+
return element.id === memberId;
|
|
34
|
+
});
|
|
35
|
+
return (
|
|
36
|
+
<Button
|
|
37
|
+
as="a"
|
|
38
|
+
border="none"
|
|
39
|
+
bg="none"
|
|
40
|
+
width="100%"
|
|
41
|
+
borderRadius="10px"
|
|
42
|
+
_hover={{ backgroundColor: 'rgb(221, 221, 221)' }}
|
|
43
|
+
className="show-message"
|
|
44
|
+
paddingLeft="10px"
|
|
45
|
+
onClick={() => handleSelectMessgae(item)}
|
|
46
|
+
key={index}
|
|
47
|
+
>
|
|
48
|
+
<div className="inbox-contacts">
|
|
49
|
+
<Avatar size="md" backgroundColor="grey" borderRadius="50%" width="50px" />
|
|
50
|
+
<div className="last-message">
|
|
51
|
+
<h5>{userMember?.username}</h5>
|
|
52
|
+
<p>{lastMessage?.message}</p>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
</Button>
|
|
56
|
+
);
|
|
57
|
+
})
|
|
58
|
+
) : (
|
|
59
|
+
<div className="no-messages">
|
|
60
|
+
<h4>You have no unread messages</h4>
|
|
61
|
+
<p>When you book a trip or experience, messages from your host will show up here.</p>
|
|
62
|
+
<Button
|
|
63
|
+
variant="outline"
|
|
64
|
+
width="110px"
|
|
65
|
+
height="40px"
|
|
66
|
+
borderRadius="7px"
|
|
67
|
+
bg="none"
|
|
68
|
+
border="1px solid rgb(34 34 34)"
|
|
69
|
+
color="black"
|
|
70
|
+
fontWeight="600"
|
|
71
|
+
>
|
|
72
|
+
Explore
|
|
73
|
+
</Button>
|
|
74
|
+
</div>
|
|
75
|
+
)}
|
|
76
|
+
</div>
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// {
|
|
81
|
+
// cnl.displayName.split(',').length > 1 ?
|
|
82
|
+
// <span
|
|
83
|
+
// className="num_style">{cnl.displayName.split(',').length}</span> :
|
|
84
|
+
// <span className="icon icon__globe"
|
|
85
|
+
// color="white"><RiAdminFill /></span>
|
|
86
|
+
// }
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export const styleSheet = {
|
|
2
|
+
inboxSibarStyles: {
|
|
3
|
+
width: '100%',
|
|
4
|
+
marginRight: '20px',
|
|
5
|
+
cursor: 'pointer',
|
|
6
|
+
top: '0',
|
|
7
|
+
bottom: '0',
|
|
8
|
+
height: '100%',
|
|
9
|
+
overflow: 'auto',
|
|
10
|
+
padding: '10px',
|
|
11
|
+
'& .show-message': {
|
|
12
|
+
color: 'black',
|
|
13
|
+
textDecoration: 'none',
|
|
14
|
+
},
|
|
15
|
+
'& .username': {
|
|
16
|
+
color: 'black',
|
|
17
|
+
},
|
|
18
|
+
'& .inbox-contacts': {
|
|
19
|
+
display: 'flex',
|
|
20
|
+
marginTop: '10px',
|
|
21
|
+
paddingBottom: '15px',
|
|
22
|
+
width: '100%',
|
|
23
|
+
borderBottom: '1px solid #eaeaea',
|
|
24
|
+
paddingRight: '10px',
|
|
25
|
+
justifiedContent: 'space-between',
|
|
26
|
+
'& .last-message': {
|
|
27
|
+
marginLeft: '10px',
|
|
28
|
+
lineHeight: '3px',
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
'& .no-messages': {
|
|
32
|
+
textAlign: 'center',
|
|
33
|
+
margin: '0 auto',
|
|
34
|
+
padding: '10px',
|
|
35
|
+
'& h4': {
|
|
36
|
+
fontSize: '18px',
|
|
37
|
+
color: 'black',
|
|
38
|
+
},
|
|
39
|
+
'& p': {
|
|
40
|
+
color: 'rgb(113, 113, 113)',
|
|
41
|
+
fontSize: '16px',
|
|
42
|
+
},
|
|
43
|
+
'& .ant-btn': {
|
|
44
|
+
width: '110px',
|
|
45
|
+
height: '40px',
|
|
46
|
+
borderRadius: '7px',
|
|
47
|
+
border: '1px solid rgb(34 34 34)',
|
|
48
|
+
color: 'black',
|
|
49
|
+
fontWeight: '600',
|
|
50
|
+
'& :hover': {
|
|
51
|
+
color: 'black',
|
|
52
|
+
borderColor: 'black',
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
} as any;
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { BiImage } from 'react-icons/bi';
|
|
3
|
+
import { BiArchiveIn } from 'react-icons/bi';
|
|
4
|
+
import { BsFillArrowUpCircleFill } from 'react-icons/bs';
|
|
5
|
+
import { css } from '@emotion/css';
|
|
6
|
+
import { Button, InputGroup, InputRightElement, Textarea, Tooltip } from '@chakra-ui/react';
|
|
7
|
+
import { useGetMessagesQuery, useSendMessagesMutation } from '@messenger-box/platform-client';
|
|
8
|
+
import MsgList from '../MessagesList';
|
|
9
|
+
import { styleSheet } from './styles';
|
|
10
|
+
|
|
11
|
+
export default function Messages({ id, user, userId, currentUser }: any) {
|
|
12
|
+
const [message, setMessage] = useState('');
|
|
13
|
+
const [messageList, setMessageList] = useState([]);
|
|
14
|
+
const [height, setHeight] = useState<any>('40px');
|
|
15
|
+
const { data, loading, error, refetch } = useGetMessagesQuery({
|
|
16
|
+
variables: {
|
|
17
|
+
channelId: id,
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
if (!loading) {
|
|
22
|
+
setMessageList(data.messages.data);
|
|
23
|
+
}
|
|
24
|
+
}, [loading, id, data?.messages?.data, messageList]);
|
|
25
|
+
const [sendMsg, { }] = useSendMessagesMutation({
|
|
26
|
+
context: {},
|
|
27
|
+
});
|
|
28
|
+
const messagesEndRef = useRef(null);
|
|
29
|
+
const scrollToBottom = () => {
|
|
30
|
+
messagesEndRef.current?.scrollIntoView({ behavior: 'smooth' });
|
|
31
|
+
};
|
|
32
|
+
const handleEnterBtn = () => {
|
|
33
|
+
if (message) {
|
|
34
|
+
sendMsg({
|
|
35
|
+
variables: {
|
|
36
|
+
channelId: id,
|
|
37
|
+
content: message,
|
|
38
|
+
files: []
|
|
39
|
+
},
|
|
40
|
+
}).then(() => {
|
|
41
|
+
refetch().then((value) => {
|
|
42
|
+
setMessageList([...value.data.messages.data]);
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
setMessage('');
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
const item = user?.find((element) => {
|
|
49
|
+
return element.id !== userId;
|
|
50
|
+
});
|
|
51
|
+
// console.log(textarea)
|
|
52
|
+
const handleTextareaHeight = (e) => {
|
|
53
|
+
if (e.key === 'Enter' && message !== '') {
|
|
54
|
+
setHeight(40 + message.split('\n').length * 10 + 'px');
|
|
55
|
+
} else {
|
|
56
|
+
setHeight('40px');
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
return (
|
|
60
|
+
<div className={css(styleSheet.messageListStyles as any)}>
|
|
61
|
+
<div className="message-container">
|
|
62
|
+
<div className="message-username">
|
|
63
|
+
<h2>{item?.username}</h2>
|
|
64
|
+
<div>
|
|
65
|
+
<Tooltip
|
|
66
|
+
label="Archive"
|
|
67
|
+
placement="bottom-end"
|
|
68
|
+
backgroundColor="black"
|
|
69
|
+
// bg="white"
|
|
70
|
+
display="flex"
|
|
71
|
+
alignItems="center"
|
|
72
|
+
width="60px"
|
|
73
|
+
borderRadius="10px"
|
|
74
|
+
fontSize="15px"
|
|
75
|
+
height="40px"
|
|
76
|
+
justifyContent="center"
|
|
77
|
+
marginTop="5px"
|
|
78
|
+
color="white"
|
|
79
|
+
boxShadow="0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23)"
|
|
80
|
+
hasArrow={true}
|
|
81
|
+
>
|
|
82
|
+
<Button
|
|
83
|
+
border="none"
|
|
84
|
+
bg="none"
|
|
85
|
+
width="30px"
|
|
86
|
+
height="30px"
|
|
87
|
+
onClick={handleEnterBtn}
|
|
88
|
+
borderRadius="50%"
|
|
89
|
+
_hover={{ backgroundColor: 'rgb(221, 221, 221)' }}
|
|
90
|
+
>
|
|
91
|
+
<BiArchiveIn />
|
|
92
|
+
</Button>
|
|
93
|
+
</Tooltip>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
<div className="message-row">
|
|
97
|
+
<MsgList id={id} messageList={messageList} user={user} currentUser={currentUser} />
|
|
98
|
+
<div ref={messagesEndRef}></div>
|
|
99
|
+
<div className="message-input">
|
|
100
|
+
<Tooltip
|
|
101
|
+
label="Image"
|
|
102
|
+
placement="top"
|
|
103
|
+
// bg="white"
|
|
104
|
+
display="flex"
|
|
105
|
+
alignItems="center"
|
|
106
|
+
width="60px"
|
|
107
|
+
borderRadius="10px"
|
|
108
|
+
fontSize="15px"
|
|
109
|
+
height="40px"
|
|
110
|
+
justifyContent="center"
|
|
111
|
+
marginTop="5px"
|
|
112
|
+
color="black"
|
|
113
|
+
boxShadow="0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23)"
|
|
114
|
+
hasArrow={true}
|
|
115
|
+
>
|
|
116
|
+
<Button
|
|
117
|
+
border="none"
|
|
118
|
+
borderRadius="50%"
|
|
119
|
+
bg="none"
|
|
120
|
+
marginRight="5px"
|
|
121
|
+
height="40px"
|
|
122
|
+
width="40px"
|
|
123
|
+
_hover={{ backgroundColor: 'rgb(221, 221, 221)' }}
|
|
124
|
+
>
|
|
125
|
+
<BiImage color="#464646" style={{ fontSize: '25px' }} />
|
|
126
|
+
</Button>
|
|
127
|
+
</Tooltip>
|
|
128
|
+
<InputGroup size="md">
|
|
129
|
+
<Textarea
|
|
130
|
+
placeholder="Type your message"
|
|
131
|
+
value={message}
|
|
132
|
+
height={height}
|
|
133
|
+
onKeyUp={handleTextareaHeight}
|
|
134
|
+
// height={enter ? message.split('\n').length * 10 + 'px' : '40px'}
|
|
135
|
+
onChange={(e) => setMessage(e.target.value)}
|
|
136
|
+
/>
|
|
137
|
+
<InputRightElement>
|
|
138
|
+
<Button
|
|
139
|
+
border="none"
|
|
140
|
+
bg="none"
|
|
141
|
+
onClick={handleEnterBtn}
|
|
142
|
+
position="relative"
|
|
143
|
+
right="53px"
|
|
144
|
+
top="6px"
|
|
145
|
+
>
|
|
146
|
+
{message !== '' ? (
|
|
147
|
+
<BsFillArrowUpCircleFill color="rgb(34, 34, 34)" style={{ fontSize: '25px' }} />
|
|
148
|
+
) : (
|
|
149
|
+
''
|
|
150
|
+
)}
|
|
151
|
+
</Button>
|
|
152
|
+
</InputRightElement>
|
|
153
|
+
</InputGroup>
|
|
154
|
+
</div>
|
|
155
|
+
</div>
|
|
156
|
+
</div>
|
|
157
|
+
</div>
|
|
158
|
+
);
|
|
159
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
export const styleSheet = {
|
|
2
|
+
messageListStyles: {
|
|
3
|
+
width: '100%',
|
|
4
|
+
padding: '15px 10px 10px 30px',
|
|
5
|
+
'& .message-container': {
|
|
6
|
+
display: 'flex',
|
|
7
|
+
flexDirection: 'column',
|
|
8
|
+
justifyContent: 'space-between',
|
|
9
|
+
height: '65vh',
|
|
10
|
+
alignItems: 'center',
|
|
11
|
+
},
|
|
12
|
+
'& .message-row': {
|
|
13
|
+
marginLeft: '23px',
|
|
14
|
+
marginRight: '23px',
|
|
15
|
+
// maxHeight: '100%',
|
|
16
|
+
width: '60%',
|
|
17
|
+
overflow: 'auto',
|
|
18
|
+
'& .message-list ': {
|
|
19
|
+
// height :'58vh',
|
|
20
|
+
bottom: '80px',
|
|
21
|
+
width: '100%',
|
|
22
|
+
right: '0px',
|
|
23
|
+
left: '0px',
|
|
24
|
+
paddingTop: '0px',
|
|
25
|
+
top: '0px',
|
|
26
|
+
'& .ant-comment': {
|
|
27
|
+
width: '100%',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
'& .message-username': {
|
|
32
|
+
width: '100%',
|
|
33
|
+
display: 'flex',
|
|
34
|
+
color: 'black',
|
|
35
|
+
justifyContent: 'space-between',
|
|
36
|
+
alignItems: 'center',
|
|
37
|
+
'& div': {
|
|
38
|
+
// display: 'flex',
|
|
39
|
+
// justifyContent: 'space-evenly',
|
|
40
|
+
width: '50px',
|
|
41
|
+
'& svg': {
|
|
42
|
+
fontSize: '20px',
|
|
43
|
+
color: '#464646',
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
'& .username': {
|
|
48
|
+
color: 'black',
|
|
49
|
+
},
|
|
50
|
+
'& .message': {
|
|
51
|
+
width: '100%',
|
|
52
|
+
display: 'flex',
|
|
53
|
+
color: 'black',
|
|
54
|
+
justifyContent: 'space-between',
|
|
55
|
+
'& svg': {
|
|
56
|
+
color: '#464646',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
'& .message-input': {
|
|
60
|
+
width: '100%',
|
|
61
|
+
display: 'flex',
|
|
62
|
+
justifyContent: 'space-around',
|
|
63
|
+
marginTop: '30px',
|
|
64
|
+
'& textarea': {
|
|
65
|
+
borderRadius: '20px',
|
|
66
|
+
width: '93%',
|
|
67
|
+
overflow: 'hidden',
|
|
68
|
+
// maxHeight: '40px',
|
|
69
|
+
color: 'black',
|
|
70
|
+
lineHeight: '22px',
|
|
71
|
+
fontSize: '16px',
|
|
72
|
+
resize: 'none',
|
|
73
|
+
border: '1px solid rgb(221, 221, 221)',
|
|
74
|
+
padding: '9px 8px',
|
|
75
|
+
},
|
|
76
|
+
'& .image-btn': {
|
|
77
|
+
'& svg': {
|
|
78
|
+
fontSize: '25px',
|
|
79
|
+
fontWeight: '1px',
|
|
80
|
+
color: '#464646',
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import React, { useState, useEffect } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Avatar,
|
|
4
|
+
Box,
|
|
5
|
+
Text,
|
|
6
|
+
Modal,
|
|
7
|
+
ModalOverlay,
|
|
8
|
+
ModalContent,
|
|
9
|
+
ModalBody,
|
|
10
|
+
ModalCloseButton,
|
|
11
|
+
useDisclosure,
|
|
12
|
+
} from '@chakra-ui/react';
|
|
13
|
+
import Moment from 'moment';
|
|
14
|
+
import { AiFillFlag } from 'react-icons/ai';
|
|
15
|
+
import UserModalContent from '../UserModalContent';
|
|
16
|
+
|
|
17
|
+
export default function MsgList({ messageList, currentUser }: any) {
|
|
18
|
+
const { isOpen, onOpen, onClose } = useDisclosure();
|
|
19
|
+
return (
|
|
20
|
+
<>
|
|
21
|
+
{messageList?.map((element, index) => {
|
|
22
|
+
// if (message.author.username == user?.username ) {
|
|
23
|
+
return (
|
|
24
|
+
<div className="message-list" key={index}>
|
|
25
|
+
<Box display="flex" width="100%">
|
|
26
|
+
<Avatar
|
|
27
|
+
width="40px"
|
|
28
|
+
height="40px"
|
|
29
|
+
backgroundColor="grey"
|
|
30
|
+
borderRadius="50%"
|
|
31
|
+
src={element?.imageUrl ? element?.imageUrl : ''}
|
|
32
|
+
marginRight="15px"
|
|
33
|
+
onClick={onOpen}
|
|
34
|
+
></Avatar>
|
|
35
|
+
<Modal isOpen={isOpen} onClose={onClose} motionPreset="slideInBottom">
|
|
36
|
+
<ModalOverlay />
|
|
37
|
+
<ModalContent
|
|
38
|
+
backgroundColor="white"
|
|
39
|
+
width="1036px"
|
|
40
|
+
position="absolute"
|
|
41
|
+
left="530px"
|
|
42
|
+
top="100px"
|
|
43
|
+
height="700px"
|
|
44
|
+
borderRadius="10px"
|
|
45
|
+
boxShadow="0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23)"
|
|
46
|
+
>
|
|
47
|
+
<Box
|
|
48
|
+
display="flex"
|
|
49
|
+
justifyContent="space-between"
|
|
50
|
+
borderBottom="1px solid rgb(221, 221, 221)"
|
|
51
|
+
paddingBottom="15px"
|
|
52
|
+
paddingTop="15px"
|
|
53
|
+
>
|
|
54
|
+
<ModalCloseButton
|
|
55
|
+
as="a"
|
|
56
|
+
width="30px"
|
|
57
|
+
marginLeft="10px"
|
|
58
|
+
color="black"
|
|
59
|
+
_hover={{ color: 'black' }}
|
|
60
|
+
/>
|
|
61
|
+
</Box>
|
|
62
|
+
<ModalBody>
|
|
63
|
+
<UserModalContent
|
|
64
|
+
username={element?.author?.username}
|
|
65
|
+
image={element.imageUrl ? element.imageUrl : ''}
|
|
66
|
+
/>
|
|
67
|
+
</ModalBody>
|
|
68
|
+
</ModalContent>
|
|
69
|
+
</Modal>
|
|
70
|
+
<Box width="100%">
|
|
71
|
+
<Text fontSize="20px" color="black">
|
|
72
|
+
{element?.author?.username}
|
|
73
|
+
</Text>
|
|
74
|
+
<Box d="flex" justifyContent="space-between">
|
|
75
|
+
<Text color="grey">{element?.message}</Text>
|
|
76
|
+
{currentUser !== element?.author?.username ? <AiFillFlag color="black" /> : ''}
|
|
77
|
+
</Box>
|
|
78
|
+
</Box>
|
|
79
|
+
</Box>
|
|
80
|
+
</div>
|
|
81
|
+
);
|
|
82
|
+
// }
|
|
83
|
+
// else {
|
|
84
|
+
// return (
|
|
85
|
+
// <div className='message-list'>
|
|
86
|
+
// {element?.sendTo == user.username ? <Comment author={<p className='username'>{element?.author?.username}</p>} key={index} datetime={Moment().format('HH mm: A')} avatar={<Avatar>{element?.author?.username.charAt(0)}</Avatar>} content={<div className="message"><p>{element.message}</p></div>} /> : '' }
|
|
87
|
+
// </div>
|
|
88
|
+
// )
|
|
89
|
+
// }
|
|
90
|
+
})}
|
|
91
|
+
</>
|
|
92
|
+
);
|
|
93
|
+
}
|