isometrik-chat 0.1.0
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/README.md +74 -0
- package/babel.config.js +6 -0
- package/dist/index.js +684 -0
- package/package.json +59 -0
- package/public/Logo-192x192.png +0 -0
- package/public/Logo-512x512.png +0 -0
- package/public/favicon.ico +0 -0
- package/public/fonts/BenjaminVictoria.ttf +0 -0
- package/public/icons/arrow_logo.svg +9 -0
- package/public/icons/assets/ic_placeholder_banner.svg +1 -0
- package/public/icons/attach-file.svg +9 -0
- package/public/icons/audio_pause.svg +1 -0
- package/public/icons/audio_play.svg +6 -0
- package/public/icons/back.svg +3 -0
- package/public/icons/bell.svg +1 -0
- package/public/icons/block.svg +1 -0
- package/public/icons/bottom-arrow.svg +1 -0
- package/public/icons/camera-switch.svg +12 -0
- package/public/icons/camera.svg +4 -0
- package/public/icons/cancel.svg +1 -0
- package/public/icons/chat empty placeholder.svg +58 -0
- package/public/icons/chat_audio_pause.png +0 -0
- package/public/icons/chat_audio_play.png +0 -0
- package/public/icons/close.svg +5 -0
- package/public/icons/crossCarousel.svg +3 -0
- package/public/icons/delete.svg +3 -0
- package/public/icons/disappear.svg +24 -0
- package/public/icons/document.png +0 -0
- package/public/icons/document.svg +1 -0
- package/public/icons/downloadCarousel.svg +6 -0
- package/public/icons/edit-pencil.svg +6 -0
- package/public/icons/emoji.svg +8 -0
- package/public/icons/emojiCarousel.svg +3 -0
- package/public/icons/filter.svg +1 -0
- package/public/icons/forwardCarousel.svg +3 -0
- package/public/icons/gallery.svg +1 -0
- package/public/icons/goToMessageCarousel.svg +3 -0
- package/public/icons/ic_uil_arrow-left.svg +1 -0
- package/public/icons/ic_uil_eye-slash.svg +1 -0
- package/public/icons/ic_uil_eye.svg +1 -0
- package/public/icons/leftArrowCarousel.svg +6 -0
- package/public/icons/light-mode.svg +14 -0
- package/public/icons/lock.svg +1 -0
- package/public/icons/login_background.png +0 -0
- package/public/icons/menu .svg +5 -0
- package/public/icons/menuCarousel.svg +5 -0
- package/public/icons/message.svg +3 -0
- package/public/icons/placeholder.svg +958 -0
- package/public/icons/poll.svg +1 -0
- package/public/icons/retake.png +0 -0
- package/public/icons/right-arrow.svg +3 -0
- package/public/icons/right.svg +3 -0
- package/public/icons/round-star.svg +1 -0
- package/public/icons/search.svg +3 -0
- package/public/icons/send.svg +10 -0
- package/public/icons/starCarousel.svg +3 -0
- package/public/icons/status.svg +1 -0
- package/public/icons/sticker.svg +1 -0
- package/public/icons/thumb-down.svg +1 -0
- package/public/icons/user.svg +1 -0
- package/public/icons/users.svg +1 -0
- package/public/icons/voice.png +0 -0
- package/public/index.html +38 -0
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +25 -0
- package/public/offline.html +12 -0
- package/public/robots.txt +3 -0
- package/public/service-worker.js +81 -0
- package/src/App.js +15 -0
- package/src/App.test.js +8 -0
- package/src/Authpage.js +16 -0
- package/src/ChatContext.js +172 -0
- package/src/Data/index.js +110 -0
- package/src/assets/icons.js +49 -0
- package/src/assets/images/WhatsApp.html +258 -0
- package/src/assets/images/WhatsApp_files/301446776_522918349234681_1974693392291574064_n.jpg +0 -0
- package/src/assets/images/WhatsApp_files/app-bf223f825866ee433b07.css +242 -0
- package/src/assets/images/WhatsApp_files/app.77ee8aa7a4c593101105.js +77 -0
- package/src/assets/images/WhatsApp_files/lazy_loaded_high_priority_components.85a06e74a0a4ade1640b.css +16 -0
- package/src/assets/images/WhatsApp_files/lazy_loaded_low_priority_components.8621270bc215a9298a97.css +47 -0
- package/src/assets/images/WhatsApp_files/libsignal-protocol-ee5b8ba.min.js +21 -0
- package/src/assets/images/WhatsApp_files/main.48b845d68e066fb27a75.css +161 -0
- package/src/assets/images/WhatsApp_files/runtime.e6018f3c1e255e8f4dc7.js +2 -0
- package/src/assets/images/WhatsApp_files/stylex-d50abd61e6cf7eab2afd855adccf14e5.css +2841 -0
- package/src/assets/images/WhatsApp_files/vendor1_app.58a51d93a250f83ab555.js +79 -0
- package/src/assets/images/bg.jpeg +0 -0
- package/src/assets/images/drkbg.jpg +0 -0
- package/src/assets/images/notFound.jpeg +0 -0
- package/src/assets/images/watsapp.jpg +0 -0
- package/src/assets/images/watsappbg.png +0 -0
- package/src/assets/images/wb.jpg +0 -0
- package/src/assets/images/whatsapp.jpeg +0 -0
- package/src/components/ChatBox/AudioBubble.js +162 -0
- package/src/components/ChatBox/ChatBubble.js +232 -0
- package/src/components/ChatBox/DocumentBubble.js +87 -0
- package/src/components/ChatBox/MessagesBox.js +533 -0
- package/src/components/CustomModal.js +60 -0
- package/src/components/Icon.js +10 -0
- package/src/components/ImageComponent.js +24 -0
- package/src/components/MediaDocs.js +155 -0
- package/src/components/MediaDocumentContainer.js +55 -0
- package/src/components/MessageInfoDropdown.js +124 -0
- package/src/components/Modal/AllowMicPermissionModal.js +63 -0
- package/src/components/Modal/BlockUnblockChatModal.js +78 -0
- package/src/components/Modal/CameraPermissionBlockedModal.js +61 -0
- package/src/components/Modal/CameraPermissionRequestModal.js +60 -0
- package/src/components/Modal/ClearChatModal.js +78 -0
- package/src/components/Modal/DeleteChatModal.js +79 -0
- package/src/components/Modal/MicPermissionDisableModal.js +63 -0
- package/src/components/Modal/Modal.js +103 -0
- package/src/components/Modal/ModalDialog.js +103 -0
- package/src/components/Modal/ProfilePictureUploadPreview.js +160 -0
- package/src/components/OutsideAlerter/OutsideAlerter.js +38 -0
- package/src/components/ProfilePicture/ProfilePicture.js +127 -0
- package/src/components/Registration/Login.js +265 -0
- package/src/components/Registration/SignUp.js +322 -0
- package/src/components/SnackBar.js +42 -0
- package/src/components/common/Modal/useDetectOutsideClick.js +23 -0
- package/src/components/common/styled/PageWrapper.js +25 -0
- package/src/components/formcontrol/CustomButton.js +38 -0
- package/src/components/formcontrol/InputText.js +60 -0
- package/src/global-styles.js +42 -0
- package/src/hooks/useDeviceType.js +28 -0
- package/src/hooks/useThrottle.js +29 -0
- package/src/index.css +225 -0
- package/src/index.js +23 -0
- package/src/lib/constant.js +21 -0
- package/src/lib/functionality.js +13 -0
- package/src/lib/helpers.js +320 -0
- package/src/lib/mockData/index.js +76 -0
- package/src/lib/session/index.js +31 -0
- package/src/lib/validation.js +4 -0
- package/src/logo.svg +1 -0
- package/src/pages/WhatsappMainBox/index.js +574 -0
- package/src/reportWebVitals.js +13 -0
- package/src/services/deliveryStatus.js +27 -0
- package/src/setupTests.js +5 -0
- package/src/utils/chatSdk.js +14 -0
- package/src/utils/global.js +57 -0
- package/src/utils/media.js +79 -0
- package/src/view/component/BlockedContactSlide.js +134 -0
- package/src/view/component/Carousle/UpperMenuBar.js +106 -0
- package/src/view/component/Carousle/index.js +204 -0
- package/src/view/component/Chatbox.js/AudioRecorder.js +311 -0
- package/src/view/component/Chatbox.js/ChatBubbleReply.js +27 -0
- package/src/view/component/Chatbox.js/TakePhoto.js +363 -0
- package/src/view/component/Chatbox.js/index.js +856 -0
- package/src/view/component/Chatbox.js/styles.css +231 -0
- package/src/view/component/Contact/index.js +56 -0
- package/src/view/component/Contact/styles.css +208 -0
- package/src/view/component/ContactInfo/index.js +543 -0
- package/src/view/component/ContactInfo/styles.css +289 -0
- package/src/view/component/Context/index.js +3 -0
- package/src/view/component/DialogBox.js +15 -0
- package/src/view/component/ImageCropper/ImageCropper.js +128 -0
- package/src/view/component/Loader/Loader.js +52 -0
- package/src/view/component/Loader/UserPagingLoader.js +62 -0
- package/src/view/component/MainChatBox/index.js +819 -0
- package/src/view/component/MainChatBox/styles.css +124 -0
- package/src/view/component/Menu/index.js +261 -0
- package/src/view/component/Menu/styles.css +68 -0
- package/src/view/component/Profile/ProfileInfoContainer.js +112 -0
- package/src/view/component/Profile/ProfileUpdate.js +178 -0
- package/src/view/component/Profile/TakeProfilePhoto.js +391 -0
- package/src/view/component/Profile/index.js +550 -0
- package/src/view/component/Profile/styles.css +370 -0
- package/src/view/component/ReplyChatMessage/ReplyChatMessage.js +48 -0
- package/src/view/component/SeachBar/index.js +106 -0
- package/src/view/component/SeachBar/styles.css +53 -0
- package/src/view/component/Siderbar/index.js +512 -0
- package/src/view/component/Siderbar/styles.css +138 -0
- package/src/view/component/Toaster/Toaster.js +117 -0
- package/src/view/component/UserDetailsCard/UserDetailCard.js +337 -0
- package/src/view/component/deleteMessageMoal.js +80 -0
- package/src/view/component/emoji/index.js +22 -0
- package/src/view/component/emoji/sstyles.css +0 -0
- package/src/view/component/forwardData/index.js +327 -0
- package/src/view/component/forwardData/styles.css +112 -0
- package/src/view/component/forwardPopup/index.js +55 -0
- package/src/view/component/forwardPopup/styles.css +144 -0
- package/src/view/component/mediaList/index.js +92 -0
- package/src/view/component/menuDialog/index.js +71 -0
- package/src/view/component/menuDialog/styles.css +24 -0
- package/src/view/component/pagination/pagination.js +52 -0
- package/src/view/component/pagination/paginationForMsg.js +43 -0
- package/src/view/component/sidebarChat/index.js +321 -0
- package/src/view/component/sidebarChat/styles.css +109 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import { getMonth, isImage, isVideo } from "../lib/helpers";
|
|
4
|
+
import ImageComponent from "./ImageComponent";
|
|
5
|
+
|
|
6
|
+
const MediaListContainer = styled.div`
|
|
7
|
+
display: flex;
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
flex-wrap: wrap;
|
|
10
|
+
justify-content: flex-start;
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
margin-right: 1rem;
|
|
13
|
+
`;
|
|
14
|
+
|
|
15
|
+
const MediaBody = styled.div`
|
|
16
|
+
height: 112px;
|
|
17
|
+
width: 112px;
|
|
18
|
+
margin: 4px 4px 10px;
|
|
19
|
+
display: flex;
|
|
20
|
+
`;
|
|
21
|
+
|
|
22
|
+
const MediaDocsWrapper = styled.div`
|
|
23
|
+
display: flex;
|
|
24
|
+
background-color: var(--chat-info-drawer-media-background);
|
|
25
|
+
border-radius: 10px;
|
|
26
|
+
background-image: linear-gradient(
|
|
27
|
+
rgba(0, 0, 0, 0) 70%,
|
|
28
|
+
rgba(0, 0, 0, 0.6) 100%
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
.media-images {
|
|
32
|
+
height: 112px;
|
|
33
|
+
width: 112px;
|
|
34
|
+
padding: 10px;
|
|
35
|
+
background-repeat: no-repeat;
|
|
36
|
+
object-fit: cover;
|
|
37
|
+
}
|
|
38
|
+
`;
|
|
39
|
+
|
|
40
|
+
const MediaDocsContainer = styled.div`
|
|
41
|
+
display: flex;
|
|
42
|
+
overflow: scroll;
|
|
43
|
+
flex-wrap: wrap;
|
|
44
|
+
padding-top: 1rem;
|
|
45
|
+
`;
|
|
46
|
+
|
|
47
|
+
const NoMediaFoundWrapper = styled.div`
|
|
48
|
+
display: flex;
|
|
49
|
+
width: 100%;
|
|
50
|
+
height: 80vh;
|
|
51
|
+
|
|
52
|
+
.no_media{
|
|
53
|
+
margin: auto;
|
|
54
|
+
}
|
|
55
|
+
`;
|
|
56
|
+
|
|
57
|
+
const getMonthwiseMedia = (mediaDocs) => {
|
|
58
|
+
let obj = {};
|
|
59
|
+
mediaDocs?.forEach((element) => {
|
|
60
|
+
const key = getMonth(element.sentAt);
|
|
61
|
+
// if the key doesn't exist in the map, create a new array for it
|
|
62
|
+
if (!obj.hasOwnProperty(key)) {
|
|
63
|
+
obj[key] = [];
|
|
64
|
+
}
|
|
65
|
+
// add the value to the array corresponding to the key
|
|
66
|
+
if (element?.customType !== 'document') { // put the check for document , if the element is document then not show in this list
|
|
67
|
+
obj[key].push({
|
|
68
|
+
timeStamp: element?.sentAt,
|
|
69
|
+
mediaUrl: element?.attachments[0]?.mediaUrl,
|
|
70
|
+
extension: element?.attachments[0]?.extension,
|
|
71
|
+
mediaId: element?.attachments[0]?.mediaId,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
return obj;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
function MediaDocs(props) {
|
|
81
|
+
const { mediaDocs, handleImgVidClick } = props;
|
|
82
|
+
|
|
83
|
+
const mediaDocsHelper = () => {
|
|
84
|
+
if (mediaDocs?.length > 0) {
|
|
85
|
+
return Object.entries(getMonthwiseMedia(mediaDocs)).map(([key, value]) => (
|
|
86
|
+
<>
|
|
87
|
+
{
|
|
88
|
+
value?.length > 0 &&
|
|
89
|
+
<span className="letter" id={`${key.toUpperCase()}`}>
|
|
90
|
+
{key}
|
|
91
|
+
</span>
|
|
92
|
+
}
|
|
93
|
+
<MediaDocsContainer>
|
|
94
|
+
{value?.length > 0 ? value.map((m) => {
|
|
95
|
+
const fileExtension = m.extension;
|
|
96
|
+
if (isImage(fileExtension)) {
|
|
97
|
+
return (
|
|
98
|
+
<MediaListContainer
|
|
99
|
+
onClick={() => handleImgVidClick(m.mediaId)} >
|
|
100
|
+
<MediaBody>
|
|
101
|
+
<MediaDocsWrapper>
|
|
102
|
+
<ImageComponent
|
|
103
|
+
className="media-images"
|
|
104
|
+
src={m?.mediaUrl}
|
|
105
|
+
/>
|
|
106
|
+
</MediaDocsWrapper>
|
|
107
|
+
</MediaBody>
|
|
108
|
+
</MediaListContainer>
|
|
109
|
+
);
|
|
110
|
+
} else if (isVideo(fileExtension)) {
|
|
111
|
+
return (
|
|
112
|
+
<MediaListContainer
|
|
113
|
+
onClick={() => handleImgVidClick(m.mediaId)} >
|
|
114
|
+
<MediaBody>
|
|
115
|
+
<MediaDocsWrapper>
|
|
116
|
+
<video
|
|
117
|
+
controls
|
|
118
|
+
style={{ objectFit: "contain" }}
|
|
119
|
+
className="media-images"
|
|
120
|
+
>
|
|
121
|
+
<source src={m.mediaUrl} type="video/mp4" />
|
|
122
|
+
</video>
|
|
123
|
+
</MediaDocsWrapper>
|
|
124
|
+
</MediaBody>
|
|
125
|
+
</MediaListContainer>
|
|
126
|
+
);
|
|
127
|
+
} else {
|
|
128
|
+
return <p>Unsupported media format</p>;
|
|
129
|
+
}
|
|
130
|
+
}) :
|
|
131
|
+
<NoMediaFoundWrapper>
|
|
132
|
+
<p className="no_media">{'No media'}</p>
|
|
133
|
+
</NoMediaFoundWrapper>
|
|
134
|
+
}
|
|
135
|
+
</MediaDocsContainer>
|
|
136
|
+
</>
|
|
137
|
+
));
|
|
138
|
+
} else {
|
|
139
|
+
return (
|
|
140
|
+
<NoMediaFoundWrapper>
|
|
141
|
+
<p>{'No media'}</p>
|
|
142
|
+
</NoMediaFoundWrapper>
|
|
143
|
+
)
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
return (
|
|
148
|
+
<>
|
|
149
|
+
{
|
|
150
|
+
mediaDocsHelper()
|
|
151
|
+
}
|
|
152
|
+
</>
|
|
153
|
+
)
|
|
154
|
+
}
|
|
155
|
+
export default MediaDocs;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import ChatBubble from './ChatBox/ChatBubble';
|
|
4
|
+
import { getCookie } from '../lib/session';
|
|
5
|
+
|
|
6
|
+
const MediaDocumentContainerWrapper = styled.div`
|
|
7
|
+
position: relative;
|
|
8
|
+
flex-wrap: wrap;
|
|
9
|
+
`;
|
|
10
|
+
|
|
11
|
+
const NoDocumentFound = styled.p`
|
|
12
|
+
color: var(--black);
|
|
13
|
+
`;
|
|
14
|
+
|
|
15
|
+
const ChatBubbleWrapper = styled.div`
|
|
16
|
+
margin: 0.25rem 0;
|
|
17
|
+
padding: 0.5rem;
|
|
18
|
+
width: fit-content;
|
|
19
|
+
border-bottom-right-radius: 7.5px;
|
|
20
|
+
border-bottom-left-radius: 7.5px;
|
|
21
|
+
--tw-bg-opacity: 1;
|
|
22
|
+
background-color: ${props => props.selfChat ? 'var(--sender_chatbg)' : 'var(--toast-background)'};
|
|
23
|
+
position: relative;
|
|
24
|
+
`;
|
|
25
|
+
|
|
26
|
+
const NoDocumentContentFoundWrapper = styled.div`
|
|
27
|
+
display: flex;
|
|
28
|
+
justify-content: center;
|
|
29
|
+
align-items: center;
|
|
30
|
+
height: 80vh;
|
|
31
|
+
`;
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
const MediaDocumentContainer = (props) => {
|
|
35
|
+
const { mediaDocs } = props;
|
|
36
|
+
const userId = getCookie('userId');
|
|
37
|
+
return (
|
|
38
|
+
<MediaDocumentContainerWrapper>
|
|
39
|
+
{
|
|
40
|
+
mediaDocs?.filter(chat => chat?.customType === 'document')?.length > 0 ?
|
|
41
|
+
mediaDocs.filter(chat => chat?.customType === 'document').map(chat => (
|
|
42
|
+
<ChatBubbleWrapper selfChat={userId === chat?.senderInfo?.userId || userId === chat?.senderId}>
|
|
43
|
+
<ChatBubble isNotShowDropDown={true} chat={chat} />
|
|
44
|
+
</ChatBubbleWrapper>
|
|
45
|
+
))
|
|
46
|
+
:
|
|
47
|
+
<NoDocumentContentFoundWrapper>
|
|
48
|
+
<NoDocumentFound>{'No Docs'}</NoDocumentFound>
|
|
49
|
+
</NoDocumentContentFoundWrapper>
|
|
50
|
+
}
|
|
51
|
+
</MediaDocumentContainerWrapper>
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export default MediaDocumentContainer
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import styled, { css } from "styled-components";
|
|
3
|
+
import { BOTTOM_ARROW } from "../utils/global";
|
|
4
|
+
import MenuDialog from "../view/component/menuDialog";
|
|
5
|
+
import ImageComponent from "./ImageComponent";
|
|
6
|
+
import OutsideAlerter from "./OutsideAlerter/OutsideAlerter";
|
|
7
|
+
|
|
8
|
+
const MenuContainer = styled.div`
|
|
9
|
+
position: absolute;
|
|
10
|
+
background: var(--modal_color);
|
|
11
|
+
color: var(--black);
|
|
12
|
+
// top: 30px;
|
|
13
|
+
right: 30px;
|
|
14
|
+
top: ${props => props.top ? `${props.top}px` : ``};
|
|
15
|
+
// right: ${props => props.left ? `${props.left}px` : ``};
|
|
16
|
+
z-index: 999;
|
|
17
|
+
padding: 1rem 0;
|
|
18
|
+
display: flex;
|
|
19
|
+
justify-content: center;
|
|
20
|
+
align-items: center;
|
|
21
|
+
visibility: hidden;
|
|
22
|
+
transform: translateY(-10px);
|
|
23
|
+
transition: opacity 331ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,
|
|
24
|
+
transform 220ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
|
|
25
|
+
transform-origin: right top;
|
|
26
|
+
width: 230px;
|
|
27
|
+
${(props) =>
|
|
28
|
+
props?.isOpen &&
|
|
29
|
+
css`
|
|
30
|
+
opacity: 1;
|
|
31
|
+
visibility: visible;
|
|
32
|
+
transform: translateY(0);
|
|
33
|
+
`}
|
|
34
|
+
${(props) =>
|
|
35
|
+
props?.userChat &&
|
|
36
|
+
css`
|
|
37
|
+
left:100% !important;
|
|
38
|
+
`}
|
|
39
|
+
|
|
40
|
+
${(props) =>
|
|
41
|
+
props?.messageLength &&
|
|
42
|
+
css`
|
|
43
|
+
top:0px !important;
|
|
44
|
+
`}
|
|
45
|
+
`;
|
|
46
|
+
|
|
47
|
+
const Image= styled.div`
|
|
48
|
+
${(props) =>
|
|
49
|
+
props?.isMedia &&
|
|
50
|
+
css`
|
|
51
|
+
.user_self_chat .bottom_arrow {
|
|
52
|
+
background-color: var(--white);
|
|
53
|
+
}
|
|
54
|
+
`}
|
|
55
|
+
`;
|
|
56
|
+
|
|
57
|
+
function MessageInfoDropdown(props) {
|
|
58
|
+
const {messageInfo , theme,setMessageInfo,chat,setMessageChat,setslideShow,setSearchShow, menuData,userChat,messageLength,isMedia,setIsReply,isReply,setReply,reply,setDeleteMessage,deleteMessage,getReplyMessageData,isOpen,setIsOpen } = props;
|
|
59
|
+
const [modalPosition, setModalPosition] = useState({ x: 0, y: 0 });
|
|
60
|
+
|
|
61
|
+
// const [isOpen, setIsOpen] = useState(false);
|
|
62
|
+
const handler =(event)=>{
|
|
63
|
+
// setMessageChat(chat);
|
|
64
|
+
setIsOpen(!isOpen);
|
|
65
|
+
if (window.innerHeight - event.clientY < 150 ) {
|
|
66
|
+
setModalPosition({ y: -100 });
|
|
67
|
+
}else{
|
|
68
|
+
setModalPosition(({y : 30}));
|
|
69
|
+
}
|
|
70
|
+
event.stopPropagation();
|
|
71
|
+
}
|
|
72
|
+
return (
|
|
73
|
+
<>
|
|
74
|
+
{/* <OutsideAlerter onClose={() => setIsOpen(false)}> */}
|
|
75
|
+
<Image>
|
|
76
|
+
<ImageComponent
|
|
77
|
+
onClick={(e) => handler(e)}
|
|
78
|
+
src={BOTTOM_ARROW}
|
|
79
|
+
className={props?.theme ? "darkicons bottom_arrow " : "lighticons bottom_arrow"}
|
|
80
|
+
/> </Image>
|
|
81
|
+
{isOpen && (
|
|
82
|
+
<MenuContainer top={modalPosition.y} isOpen={isOpen} userChat={userChat} messageLength={messageLength}>
|
|
83
|
+
<MenuDialog
|
|
84
|
+
menuData={menuData}
|
|
85
|
+
theme={theme}
|
|
86
|
+
setIsMenu={setIsOpen}
|
|
87
|
+
isMenu={isOpen}
|
|
88
|
+
setMessageInfo={setMessageInfo}
|
|
89
|
+
messageInfo={messageInfo}
|
|
90
|
+
chat={chat}
|
|
91
|
+
setMessageChat={setMessageChat}
|
|
92
|
+
messageChat={chat}
|
|
93
|
+
setslideShow={setslideShow}
|
|
94
|
+
setSearchShow={setSearchShow}
|
|
95
|
+
setIsReply={setIsReply}
|
|
96
|
+
setReply={setReply}
|
|
97
|
+
reply={reply}
|
|
98
|
+
setDeleteMessage={setDeleteMessage}
|
|
99
|
+
deleteMessage={deleteMessage}
|
|
100
|
+
// getReplyMessageData={getReplyMessageData}
|
|
101
|
+
|
|
102
|
+
/>
|
|
103
|
+
</MenuContainer>
|
|
104
|
+
)}
|
|
105
|
+
{/* </OutsideAlerter> */}
|
|
106
|
+
<style>{`
|
|
107
|
+
.user_chat .bottom_arrow {
|
|
108
|
+
// background-color: var(--white);
|
|
109
|
+
height:30px;
|
|
110
|
+
width:30px;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.user_self_chat .bottom_arrow {
|
|
114
|
+
// background-color: var(--sender_chatbg);
|
|
115
|
+
height:30px;
|
|
116
|
+
width:30px;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
`}</style>
|
|
120
|
+
</>
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export default MessageInfoDropdown;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
|
+
import { mobile } from '../../utils/media';
|
|
4
|
+
|
|
5
|
+
const ModalContainer = styled.div`
|
|
6
|
+
background-color: var(--modal_color);
|
|
7
|
+
color: var(--black);
|
|
8
|
+
position: absolute;
|
|
9
|
+
width: 32rem;
|
|
10
|
+
top: 50%;
|
|
11
|
+
left: 50%;
|
|
12
|
+
box-shadow: 0 4px 8px 0 rgb(0 0 0 / 20%), 0 6px 20px 0 rgb(0 0 0 / 19%);
|
|
13
|
+
-webkit-transform: translate(-50%,-50%);
|
|
14
|
+
-ms-transform: translate(-50%,-50%);
|
|
15
|
+
transform: translate(-50%,-50%);
|
|
16
|
+
padding: 2rem 1.5rem;
|
|
17
|
+
z-index: 999;
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
${mobile(css`
|
|
21
|
+
max-width: 320px;
|
|
22
|
+
`)}
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
const ModalTitle = styled.h5`
|
|
26
|
+
margin-top: 20px;
|
|
27
|
+
text-transform:capitalize;
|
|
28
|
+
${mobile(css`
|
|
29
|
+
font-size: 18px;
|
|
30
|
+
`)}
|
|
31
|
+
`;
|
|
32
|
+
|
|
33
|
+
const ModalDescription = styled.p`
|
|
34
|
+
font-size: 15px;
|
|
35
|
+
margin-top: 1rem;
|
|
36
|
+
${mobile(css`
|
|
37
|
+
font-size: 14px;
|
|
38
|
+
`)}
|
|
39
|
+
`;
|
|
40
|
+
|
|
41
|
+
const ConfirmButton = styled.button`
|
|
42
|
+
margin-left:auto;
|
|
43
|
+
margin-top: 3rem;
|
|
44
|
+
border-radius:20px;
|
|
45
|
+
border:none;
|
|
46
|
+
padding:5px 20px;
|
|
47
|
+
background-color:var(--button-primary-background);
|
|
48
|
+
color:var(--white);
|
|
49
|
+
`;
|
|
50
|
+
|
|
51
|
+
const AllowMicPermissionModal = (props) => {
|
|
52
|
+
const { onClose } = props;
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<ModalContainer>
|
|
56
|
+
<ModalTitle>{'Allow microphone'}</ModalTitle>
|
|
57
|
+
<ModalDescription>{`To record Voice Messages, Isometrik needs access to your microphone permission.`}</ModalDescription>
|
|
58
|
+
<ConfirmButton onClick={onClose}>{'OK, got it!'}</ConfirmButton>
|
|
59
|
+
</ModalContainer>
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export default AllowMicPermissionModal;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
|
+
import { mobile } from '../../utils/media';
|
|
4
|
+
|
|
5
|
+
const ModalContainer = styled.div`
|
|
6
|
+
background-color: var(--modal_color);
|
|
7
|
+
color: var(--black);
|
|
8
|
+
position: absolute;
|
|
9
|
+
width: 32rem;
|
|
10
|
+
top: 50%;
|
|
11
|
+
left: 50%;
|
|
12
|
+
box-shadow: 0 4px 8px 0 rgb(0 0 0 / 20%), 0 6px 20px 0 rgb(0 0 0 / 19%);
|
|
13
|
+
-webkit-transform: translate(-50%,-50%);
|
|
14
|
+
-ms-transform: translate(-50%,-50%);
|
|
15
|
+
transform: translate(-50%,-50%);
|
|
16
|
+
padding: 20px 24px 6px 22px;
|
|
17
|
+
${mobile(css`
|
|
18
|
+
max-width: 320px;
|
|
19
|
+
`)}
|
|
20
|
+
`;
|
|
21
|
+
|
|
22
|
+
const ModalTitle = styled.h5`
|
|
23
|
+
margin-top: 20px;
|
|
24
|
+
${mobile(css`
|
|
25
|
+
font-size: 18px;
|
|
26
|
+
`)}
|
|
27
|
+
`;
|
|
28
|
+
|
|
29
|
+
const ModalDescription = styled.p`
|
|
30
|
+
font-size: 18px;
|
|
31
|
+
${mobile(css`
|
|
32
|
+
font-size: 14px;
|
|
33
|
+
`)}
|
|
34
|
+
`;
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
const ButtonAction = styled.div`
|
|
38
|
+
display:flex;
|
|
39
|
+
justify-content: flex-end;
|
|
40
|
+
margin:3rem 0 20px;
|
|
41
|
+
|
|
42
|
+
${mobile(css`
|
|
43
|
+
margin:1.5rem 0 20px;
|
|
44
|
+
`)}
|
|
45
|
+
|
|
46
|
+
.cancleBtn{
|
|
47
|
+
background:var(--white);
|
|
48
|
+
color:var(--button-primary-background);
|
|
49
|
+
border:1px solid var(--border_color);}
|
|
50
|
+
|
|
51
|
+
.logoutBtn{
|
|
52
|
+
background-color:var(--button-primary-background);
|
|
53
|
+
color:var(--white);
|
|
54
|
+
}
|
|
55
|
+
`;
|
|
56
|
+
|
|
57
|
+
const Button = styled.button`
|
|
58
|
+
margin-left:15px;
|
|
59
|
+
border-radius:20px;
|
|
60
|
+
border:none;
|
|
61
|
+
padding:5px 20px 5px 20px;
|
|
62
|
+
`;
|
|
63
|
+
|
|
64
|
+
const BlockUnblockChatModal = (props) => {
|
|
65
|
+
const { cancelButtonClick, confirmButtonClick, isUserBlocked, userName} = props;
|
|
66
|
+
return (
|
|
67
|
+
<ModalContainer>
|
|
68
|
+
<ModalTitle>{isUserBlocked ? `Unblock ${userName} ?` : `Block ${userName} ?`}</ModalTitle>
|
|
69
|
+
<ModalDescription>{`${isUserBlocked ? ` ` : `Are you sure you want to block ${userName}, blocked users will no longer be able to message you ?`}`}</ModalDescription>
|
|
70
|
+
<ButtonAction className="logoutActionbtn">
|
|
71
|
+
<Button className="cancleBtn" onClick={cancelButtonClick} >Cancel</Button>
|
|
72
|
+
<Button className="logoutBtn" onClick={confirmButtonClick} >{isUserBlocked ? 'Unblock' : 'Block'}</Button>
|
|
73
|
+
</ButtonAction>
|
|
74
|
+
</ModalContainer>
|
|
75
|
+
)
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export default BlockUnblockChatModal;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
|
+
import { mobile } from '../../utils/media';
|
|
4
|
+
|
|
5
|
+
const ModalContainer = styled.div`
|
|
6
|
+
background-color: var(--modal_color);
|
|
7
|
+
color: var(--black);
|
|
8
|
+
position: absolute;
|
|
9
|
+
max-width: 500px;
|
|
10
|
+
max-height: 700px;
|
|
11
|
+
top: 50%;
|
|
12
|
+
left: 50%;
|
|
13
|
+
-webkit-transform: translate(-50%,-50%);
|
|
14
|
+
-ms-transform: translate(-50%,-50%);
|
|
15
|
+
transform: translate(-50%,-50%);
|
|
16
|
+
padding: 0 2rem;
|
|
17
|
+
padding-bottom: 3rem;
|
|
18
|
+
visibility: visible;
|
|
19
|
+
|
|
20
|
+
${mobile(css`
|
|
21
|
+
width: 90%;
|
|
22
|
+
padding: 0 1.5rem 2rem;
|
|
23
|
+
`)}
|
|
24
|
+
`;
|
|
25
|
+
|
|
26
|
+
const ModalHeaderTitle = styled.h3`
|
|
27
|
+
font-size: 2rem;
|
|
28
|
+
color: var(--black);
|
|
29
|
+
padding-top: 2rem;
|
|
30
|
+
margin-left: 1rem;
|
|
31
|
+
margin-bottom: 1rem;
|
|
32
|
+
`;
|
|
33
|
+
|
|
34
|
+
const ModalHeaderText = styled.p`
|
|
35
|
+
margin-bottom: 0;
|
|
36
|
+
color: var(--black);
|
|
37
|
+
margin-left: 1rem;
|
|
38
|
+
padding-top:${props => props.isPaddingTop ? '2rem' : 'unset'};
|
|
39
|
+
`;
|
|
40
|
+
|
|
41
|
+
const ModalAllowCameraCTA = styled.button`
|
|
42
|
+
border: none;
|
|
43
|
+
padding: 10px 20px;
|
|
44
|
+
background: var(--profile-name);
|
|
45
|
+
color: #fff;
|
|
46
|
+
border-radius: 45px;
|
|
47
|
+
margin: 2rem 0 0;
|
|
48
|
+
`;
|
|
49
|
+
|
|
50
|
+
const CameraPermissionBlockedModal = (props) => {
|
|
51
|
+
const { onClick } = props;
|
|
52
|
+
return (
|
|
53
|
+
<ModalContainer isPadding>
|
|
54
|
+
<ModalHeaderTitle>{'Allow Camera'}</ModalHeaderTitle>
|
|
55
|
+
<ModalHeaderText >{`To take photos, Isometrik needs access to your computer's camera. Click Camera icon in the URL bar and choose. Always allow ${window.location.href} to access your camera.`}</ModalHeaderText>
|
|
56
|
+
<ModalAllowCameraCTA onClick={onClick}>{'OK, got it'}</ModalAllowCameraCTA>
|
|
57
|
+
</ModalContainer>
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export default CameraPermissionBlockedModal;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
|
+
import { mobile } from '../../utils/media';
|
|
4
|
+
|
|
5
|
+
const ModalContainer = styled.div`
|
|
6
|
+
background-color: var(--modal_color);
|
|
7
|
+
color: var(--black);
|
|
8
|
+
position: absolute;
|
|
9
|
+
max-width: 500px;
|
|
10
|
+
max-height: 700px;
|
|
11
|
+
top: 50%;
|
|
12
|
+
left: 50%;
|
|
13
|
+
-webkit-transform: translate(-50%,-50%);
|
|
14
|
+
-ms-transform: translate(-50%,-50%);
|
|
15
|
+
transform: translate(-50%,-50%);
|
|
16
|
+
padding: 0 2rem;
|
|
17
|
+
padding-bottom: 3rem;
|
|
18
|
+
visibility: visible;
|
|
19
|
+
|
|
20
|
+
${mobile(css`
|
|
21
|
+
width: 90%;
|
|
22
|
+
`)}
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
const ModalHeaderTitle = styled.h3`
|
|
26
|
+
font-size: 2rem;
|
|
27
|
+
color: var(--black);
|
|
28
|
+
padding-top: 2rem;
|
|
29
|
+
margin-left: 1rem;
|
|
30
|
+
margin-bottom: 1rem;
|
|
31
|
+
`;
|
|
32
|
+
|
|
33
|
+
const ModalHeaderText = styled.p`
|
|
34
|
+
margin-bottom: 0;
|
|
35
|
+
color: var(--black);
|
|
36
|
+
margin-left: 1rem;
|
|
37
|
+
padding-top:${props => props.isPaddingTop ? '2rem' : 'unset'};
|
|
38
|
+
`;
|
|
39
|
+
|
|
40
|
+
const ModalAllowCameraCTA = styled.button`
|
|
41
|
+
border: none;
|
|
42
|
+
padding: 10px 20px;
|
|
43
|
+
background: var(--profile-name);
|
|
44
|
+
color: #fff;
|
|
45
|
+
border-radius: 45px;
|
|
46
|
+
margin: 2rem 0 0;
|
|
47
|
+
`;
|
|
48
|
+
|
|
49
|
+
const CameraPermissionRequestModal = (props) => {
|
|
50
|
+
const { onClick } = props;
|
|
51
|
+
return (
|
|
52
|
+
<ModalContainer >
|
|
53
|
+
<ModalHeaderTitle>{'Allow Camera'}</ModalHeaderTitle>
|
|
54
|
+
<ModalHeaderText>{`To take photos, click "Allow" above to give the Isometrik access to your camera.`}</ModalHeaderText>
|
|
55
|
+
<ModalAllowCameraCTA onClick={onClick}>{'OK, got it'}</ModalAllowCameraCTA>
|
|
56
|
+
</ModalContainer>
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export default CameraPermissionRequestModal;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
|
+
import { mobile } from '../../utils/media';
|
|
4
|
+
|
|
5
|
+
const ModalContainer = styled.div`
|
|
6
|
+
background-color: var(--modal_color);
|
|
7
|
+
color: var(--black);
|
|
8
|
+
position: absolute;
|
|
9
|
+
width: 32rem;
|
|
10
|
+
top: 50%;
|
|
11
|
+
left: 50%;
|
|
12
|
+
box-shadow: 0 4px 8px 0 rgb(0 0 0 / 20%), 0 6px 20px 0 rgb(0 0 0 / 19%);
|
|
13
|
+
-webkit-transform: translate(-50%,-50%);
|
|
14
|
+
-ms-transform: translate(-50%,-50%);
|
|
15
|
+
transform: translate(-50%,-50%);
|
|
16
|
+
padding: 20px 24px 6px 22px;
|
|
17
|
+
${mobile(css`
|
|
18
|
+
max-width: 320px;
|
|
19
|
+
`)}
|
|
20
|
+
`;
|
|
21
|
+
|
|
22
|
+
const ModalTitle = styled.h5`
|
|
23
|
+
margin-top: 20px;
|
|
24
|
+
${mobile(css`
|
|
25
|
+
font-size: 18px;
|
|
26
|
+
`)}
|
|
27
|
+
`;
|
|
28
|
+
|
|
29
|
+
const ModalDescription = styled.p`
|
|
30
|
+
font-size: 18px;
|
|
31
|
+
${mobile(css`
|
|
32
|
+
font-size: 14px;
|
|
33
|
+
`)}
|
|
34
|
+
`;
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
const ButtonAction = styled.div`
|
|
38
|
+
display:flex;
|
|
39
|
+
justify-content: flex-end;
|
|
40
|
+
margin:3rem 0 20px;
|
|
41
|
+
|
|
42
|
+
${mobile(css`
|
|
43
|
+
margin:1.5rem 0 20px;
|
|
44
|
+
`)}
|
|
45
|
+
|
|
46
|
+
.cancleBtn{
|
|
47
|
+
background:var(--white);
|
|
48
|
+
color:var(--button-primary-background);
|
|
49
|
+
border:1px solid var(--border_color);}
|
|
50
|
+
|
|
51
|
+
.logoutBtn{
|
|
52
|
+
background-color:var(--button-primary-background);
|
|
53
|
+
color:var(--white);
|
|
54
|
+
}
|
|
55
|
+
`;
|
|
56
|
+
|
|
57
|
+
const Button = styled.button`
|
|
58
|
+
margin-left:15px;
|
|
59
|
+
border-radius:20px;
|
|
60
|
+
border:none;
|
|
61
|
+
padding:5px 20px 5px 20px;
|
|
62
|
+
`;
|
|
63
|
+
|
|
64
|
+
const ClearChatModal = (props) => {
|
|
65
|
+
const { cancelButtonClick, confirmButtonClick} = props;
|
|
66
|
+
return (
|
|
67
|
+
<ModalContainer>
|
|
68
|
+
<ModalTitle>{'Clear this chat ?'}</ModalTitle>
|
|
69
|
+
<ModalDescription>{'Messages will only be removed from this device and your devices on the newer versions of Isometrik.'}</ModalDescription>
|
|
70
|
+
<ButtonAction className="logoutActionbtn">
|
|
71
|
+
<Button className="cancleBtn" onClick={cancelButtonClick} >Cancel</Button>
|
|
72
|
+
<Button className="logoutBtn" onClick={confirmButtonClick} >{"Clear chat"}</Button>
|
|
73
|
+
</ButtonAction>
|
|
74
|
+
</ModalContainer>
|
|
75
|
+
)
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export default ClearChatModal;
|