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,289 @@
|
|
|
1
|
+
.contact_profile .profile_image {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
align-content: center;
|
|
5
|
+
width: 200px !important;
|
|
6
|
+
height: 200px !important;
|
|
7
|
+
margin-top: 25px;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.contact_container {
|
|
11
|
+
max-width: 100%;
|
|
12
|
+
background-color:var(--primary-white);
|
|
13
|
+
overflow: auto;
|
|
14
|
+
height: 100vh;
|
|
15
|
+
right: 0px;
|
|
16
|
+
top: 0px
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.contact_container .contact_header {
|
|
20
|
+
position: fixed;
|
|
21
|
+
padding:6px 12px;
|
|
22
|
+
display: flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
background-color: var(--gray_color);
|
|
25
|
+
/* height: 62px; */
|
|
26
|
+
padding-left: 25px;
|
|
27
|
+
border-left: 1px solid var(--border_color);
|
|
28
|
+
width: 100%
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.contact_header p {
|
|
32
|
+
color : var(--black)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.contact_profile {
|
|
36
|
+
position: relative;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.text p {
|
|
40
|
+
display: flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
padding-top: 17px;
|
|
43
|
+
padding-left: 20px;
|
|
44
|
+
padding-right: 30px;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.text p span {
|
|
48
|
+
margin-left: 20px;
|
|
49
|
+
font-size: 17px;
|
|
50
|
+
position: relative;
|
|
51
|
+
width: 100%;
|
|
52
|
+
color: var(--black);
|
|
53
|
+
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
p .btnn {
|
|
58
|
+
color: var(--danger) !important
|
|
59
|
+
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.contact_container .contactp {
|
|
63
|
+
position: relative;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
text {
|
|
67
|
+
position: relative;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.text p svg {
|
|
71
|
+
height: 20px;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.text p .svgg {
|
|
75
|
+
color: var(--danger);
|
|
76
|
+
height: 24px;
|
|
77
|
+
width: 24px;
|
|
78
|
+
position: relative;
|
|
79
|
+
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.contact-container .contact_profile {
|
|
83
|
+
position: relative;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.contact-container .text {
|
|
87
|
+
|
|
88
|
+
position: relative;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
div .contact_status {
|
|
92
|
+
position: relative;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
div .contactsocialInfo {
|
|
96
|
+
position: relative;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.contact_container .textt {
|
|
100
|
+
position: relative;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.contact_status .bio {
|
|
104
|
+
color: var(--black);
|
|
105
|
+
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.contact_container .textt {
|
|
109
|
+
background-color: var(--primary-white);
|
|
110
|
+
padding-left: 15px;
|
|
111
|
+
margin-top: 10px;
|
|
112
|
+
position: relative;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.contact_container .contactp {
|
|
116
|
+
position: relative;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.txt {
|
|
120
|
+
font-size: 14px;
|
|
121
|
+
padding-left: 42px !important;
|
|
122
|
+
padding-top: 0px !important
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.dlttxt {
|
|
126
|
+
padding-bottom: 17px;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.showMe {
|
|
130
|
+
position: relative;
|
|
131
|
+
animation: contactPro 0.75s;
|
|
132
|
+
animation-iteration-count: 1;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.svgg .btnn {
|
|
136
|
+
color: var(--danger) !important
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
@keyframes contactPro {
|
|
141
|
+
0% {
|
|
142
|
+
opacity: 0;
|
|
143
|
+
transform: translateY(-50px);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
30% {
|
|
147
|
+
opacity: 0;
|
|
148
|
+
transform: translateY(-50px);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
100% {
|
|
152
|
+
opacity: 1;
|
|
153
|
+
transform: translateY(0);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.contact_container .contact_header p {
|
|
158
|
+
font-size: 16px;
|
|
159
|
+
padding-top: 15px;
|
|
160
|
+
padding-left: 30px;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.contact_profile {
|
|
164
|
+
display: flex;
|
|
165
|
+
justify-content: center;
|
|
166
|
+
background-color: var(--primary-white);
|
|
167
|
+
margin-top: 67px
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
.contact_name {
|
|
173
|
+
display: flex;
|
|
174
|
+
justify-content: center;
|
|
175
|
+
background:var(--primary-white);
|
|
176
|
+
padding-top: 15px;
|
|
177
|
+
color: var(--black);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.contact_name div {
|
|
181
|
+
font-size: 24px;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.contact_name div p {
|
|
185
|
+
font-size: 16px;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.contactsocialInfo {
|
|
189
|
+
background-color:var(--primary-white);
|
|
190
|
+
margin-top: 10px;
|
|
191
|
+
padding: 17px 30px 17px 30px;
|
|
192
|
+
display: flex;
|
|
193
|
+
justify-content: space-between
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.contact_status {
|
|
197
|
+
background-color: var(--primary-white);
|
|
198
|
+
padding: 17px 30px 5px 30px;
|
|
199
|
+
line-height: 0.8;
|
|
200
|
+
margin-top: 10px
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
div .searchmsg {
|
|
204
|
+
padding: 72px 50px 72px 50px;
|
|
205
|
+
font-size: 0.875rem;
|
|
206
|
+
background-color: var(--primary-white);
|
|
207
|
+
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
.mediaContainer{
|
|
212
|
+
|
|
213
|
+
max-width: 30vw;
|
|
214
|
+
background-color:var(--contact-profile-bg);
|
|
215
|
+
overflow: auto;
|
|
216
|
+
height: 100vh;
|
|
217
|
+
right: 0px;
|
|
218
|
+
top: 0px
|
|
219
|
+
|
|
220
|
+
}
|
|
221
|
+
.mediaContainer .media_header {
|
|
222
|
+
position: fixed;
|
|
223
|
+
display: flex;
|
|
224
|
+
align-items: center;
|
|
225
|
+
background-color: var(--gray_color);
|
|
226
|
+
height: 62px;
|
|
227
|
+
padding-left: 25px;
|
|
228
|
+
border-left: 1px solid var(--border_color);
|
|
229
|
+
width: 100%
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.media_header p{
|
|
233
|
+
|
|
234
|
+
color : var(--black)
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/* .media_Container{
|
|
238
|
+
width: 30vw;
|
|
239
|
+
} */
|
|
240
|
+
|
|
241
|
+
.media_header .keyboard{
|
|
242
|
+
color: var(--contact-media-text);
|
|
243
|
+
position: relative;
|
|
244
|
+
top: 20px;
|
|
245
|
+
left: 25px;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.css-heg063-MuiTabs-flexContainer{
|
|
249
|
+
justify-content: space-around !important;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.media_header{
|
|
253
|
+
background-color: var(--profile-header);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.MuiTabs-flexContainer {
|
|
257
|
+
background-color: var(--profile-header) !important;
|
|
258
|
+
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.css-1h9z7r5-MuiButtonBase-root-MuiTab-root.Mui-selected{
|
|
262
|
+
color: var( --contact-media-text ) !important;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.css-1160xiw-MuiPaper-root-MuiDrawer-paper{
|
|
266
|
+
background-color: var(--primary-white) !important;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.MuiTab-textColorPrimary{
|
|
270
|
+
color: var(--contact-media-text ) !important;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.MuiBox-root {
|
|
274
|
+
background-color: var(--primary-white) !important;
|
|
275
|
+
}
|
|
276
|
+
.MuiTabs-indicator{
|
|
277
|
+
background-color: var(--sender_chatbg) !important;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.MuiPaper-root{
|
|
281
|
+
box-shadow: none !important;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.profile_image{
|
|
285
|
+
cursor: pointer;
|
|
286
|
+
}
|
|
287
|
+
.user_unblock{
|
|
288
|
+
filter: invert(1);
|
|
289
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
const DialogBox = (props) => {
|
|
4
|
+
|
|
5
|
+
const { dialogueBoxRef } = props;
|
|
6
|
+
return <dialog
|
|
7
|
+
ref={dialogueBoxRef}
|
|
8
|
+
style={{
|
|
9
|
+
width: '100%', height: '100%', maxHeight: '100%', maxWidth: '100%', backgroundColor: 'var(--white)', ...props.style
|
|
10
|
+
}}>
|
|
11
|
+
{props.children}
|
|
12
|
+
</dialog>;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default DialogBox;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import React, { useState, useRef } from "react";
|
|
2
|
+
// Cropping Module
|
|
3
|
+
import Cropper from "react-cropper";
|
|
4
|
+
import "cropperjs/dist/cropper.css";
|
|
5
|
+
import styled from "styled-components";
|
|
6
|
+
import { MOBILE_MAX_WIDTH_LIMIT } from "../../../lib/constant";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
const ImageCropperWrapper = styled.div`
|
|
11
|
+
position: relative;
|
|
12
|
+
`;
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
var rotateDegree = 0;
|
|
17
|
+
export default function ImageCropper(props) {
|
|
18
|
+
const { imageUrl, setCroppedImg } = props;
|
|
19
|
+
let cropperRef = useRef();
|
|
20
|
+
|
|
21
|
+
//rounded image
|
|
22
|
+
const getRoundedCanvas = (sourceCanvas) => {
|
|
23
|
+
try {
|
|
24
|
+
let canvas = document.createElement("canvas");
|
|
25
|
+
let context = canvas.getContext("2d");
|
|
26
|
+
let width = sourceCanvas.width;
|
|
27
|
+
let height = sourceCanvas.height;
|
|
28
|
+
canvas.width = width;
|
|
29
|
+
canvas.height = height;
|
|
30
|
+
context.imageSmoothingEnabled = true;
|
|
31
|
+
context.imageSmoothingQuality = "high";
|
|
32
|
+
context.drawImage(sourceCanvas, 0, 0, width, height);
|
|
33
|
+
context.globalCompositeOperation = "destination-in";
|
|
34
|
+
context.beginPath();
|
|
35
|
+
context.arc(
|
|
36
|
+
width / 2,
|
|
37
|
+
height / 2,
|
|
38
|
+
Math.min(width, height) / 2,
|
|
39
|
+
0,
|
|
40
|
+
2 * Math.PI,
|
|
41
|
+
true
|
|
42
|
+
);
|
|
43
|
+
context.fill();
|
|
44
|
+
return canvas;
|
|
45
|
+
} catch (error) {
|
|
46
|
+
console.error('error', error);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const handleRotate = () => {
|
|
51
|
+
try {
|
|
52
|
+
const imageElement = cropperRef?.current;
|
|
53
|
+
const cropper = imageElement?.cropper;
|
|
54
|
+
rotateDegree = rotateDegree >= 360 ? 0 : rotateDegree + 90;
|
|
55
|
+
cropper.rotateTo(rotateDegree);
|
|
56
|
+
} catch (error) {
|
|
57
|
+
console.error('error', error);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const onCrop = () => {
|
|
62
|
+
try {
|
|
63
|
+
const imageElement = cropperRef?.current;
|
|
64
|
+
const cropper = imageElement?.cropper;
|
|
65
|
+
const resultCrop = cropper.getCroppedCanvas({
|
|
66
|
+
maxWidth: 4096,
|
|
67
|
+
maxHeight: 4096,
|
|
68
|
+
fillColor: "#fff",
|
|
69
|
+
imageSmoothingEnabled: true,
|
|
70
|
+
imageSmoothingQuality: "high",
|
|
71
|
+
});
|
|
72
|
+
const result = props.cropRoundImg
|
|
73
|
+
? getRoundedCanvas(resultCrop)
|
|
74
|
+
: resultCrop;
|
|
75
|
+
setCroppedImg(result && result.toDataURL("image/jpeg", 1.0));
|
|
76
|
+
} catch (error) {
|
|
77
|
+
console.error('error', error);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
return (
|
|
83
|
+
<ImageCropperWrapper>
|
|
84
|
+
<div className="CroppingDiv col-12 ">
|
|
85
|
+
<div className="row m-0 mb-3 d-flex justify-content-center align-items-center">
|
|
86
|
+
<div className="col-12 p-0">
|
|
87
|
+
<Cropper
|
|
88
|
+
style={{
|
|
89
|
+
maxHeight: 450,
|
|
90
|
+
width: window.innerWidth < MOBILE_MAX_WIDTH_LIMIT && window.innerWidth ,
|
|
91
|
+
}}
|
|
92
|
+
aspectRatio={1/1 || NaN}
|
|
93
|
+
guides={false}
|
|
94
|
+
src={imageUrl}
|
|
95
|
+
ref={cropperRef}
|
|
96
|
+
viewMode={1}
|
|
97
|
+
dragMode="move"
|
|
98
|
+
cropBoxMovable={true}
|
|
99
|
+
crop={onCrop}
|
|
100
|
+
rotatable={true}
|
|
101
|
+
scalable={true}
|
|
102
|
+
checkOrientation={1}
|
|
103
|
+
/>
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
|
+
|
|
108
|
+
<style jsx>
|
|
109
|
+
{`
|
|
110
|
+
|
|
111
|
+
.CroppingDiv {
|
|
112
|
+
position: relative;
|
|
113
|
+
}
|
|
114
|
+
.CroppingDiv img {
|
|
115
|
+
display: block;
|
|
116
|
+
width: 100%;
|
|
117
|
+
height: 100%;
|
|
118
|
+
object-fit: contain;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.cropper-view-box, .cropper-face {
|
|
122
|
+
border-radius: 50%;
|
|
123
|
+
}
|
|
124
|
+
`}
|
|
125
|
+
</style>
|
|
126
|
+
</ImageCropperWrapper>
|
|
127
|
+
);
|
|
128
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
|
+
import { mobile } from '../../../utils/media';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
const LoaderContainer = styled.div`
|
|
7
|
+
width: ${props => props.width || '30vw'} ;
|
|
8
|
+
height: ${props => props.height || 'calc(100vh - 135px)'};
|
|
9
|
+
position: ${props => props.position || 'absolute'} ;
|
|
10
|
+
top: 135px;
|
|
11
|
+
display: flex;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
align-items: center;
|
|
14
|
+
background: var(--primary_white);
|
|
15
|
+
z-index: 999;
|
|
16
|
+
|
|
17
|
+
.loader {
|
|
18
|
+
border: 4px solid var(--black);
|
|
19
|
+
border-left-color: transparent;
|
|
20
|
+
width: 36px;
|
|
21
|
+
height: 36px;
|
|
22
|
+
border-radius: 50%;
|
|
23
|
+
animation: spin89345 1s linear infinite;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@keyframes spin89345 {
|
|
27
|
+
0% {
|
|
28
|
+
transform: rotate(0deg);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
100% {
|
|
32
|
+
transform: rotate(360deg);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
${mobile(css`
|
|
37
|
+
width: ${props => props.width || '100vw'} ;
|
|
38
|
+
`)}
|
|
39
|
+
`;
|
|
40
|
+
|
|
41
|
+
const Loader = ({theme, width, height, maxHeight, maxWidth, position}) => {
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<>
|
|
45
|
+
<LoaderContainer width={width} height={height} maxHeight={maxHeight} maxWidth={maxWidth} theme={theme} position={position}>
|
|
46
|
+
<div className='loader' />
|
|
47
|
+
</LoaderContainer>
|
|
48
|
+
</>
|
|
49
|
+
|
|
50
|
+
)}
|
|
51
|
+
|
|
52
|
+
export default Loader;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
const UserPagingLoaderWrapper = styled.div`
|
|
5
|
+
width: 100%;
|
|
6
|
+
display: flex;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
align-items: center;
|
|
9
|
+
height: 40px;
|
|
10
|
+
.loader {
|
|
11
|
+
width: 8px;
|
|
12
|
+
height: 15px;
|
|
13
|
+
border-radius: 4px;
|
|
14
|
+
display: block;
|
|
15
|
+
background-color: currentColor;
|
|
16
|
+
margin: 20px auto;
|
|
17
|
+
position: relative;
|
|
18
|
+
color: var(--black);
|
|
19
|
+
animation: animloader 0.3s 0.3s linear infinite alternate;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.loader::after,
|
|
23
|
+
.loader::before {
|
|
24
|
+
content: '';
|
|
25
|
+
width: 8px;
|
|
26
|
+
height: 15px;
|
|
27
|
+
border-radius: 4px;
|
|
28
|
+
background: currentColor;
|
|
29
|
+
position: absolute;
|
|
30
|
+
top: 50%;
|
|
31
|
+
transform: translateY(-50%);
|
|
32
|
+
left: 20px;
|
|
33
|
+
animation: animloader 0.3s 0.45s linear infinite alternate;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.loader::before {
|
|
37
|
+
left: -20px;
|
|
38
|
+
animation-delay: 0s;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@keyframes animloader {
|
|
42
|
+
0% {
|
|
43
|
+
height: 20px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
100% {
|
|
47
|
+
height: 4px;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
`;
|
|
52
|
+
|
|
53
|
+
const UserPagingLoader = () => {
|
|
54
|
+
return (
|
|
55
|
+
<UserPagingLoaderWrapper>
|
|
56
|
+
<div className='loader'>
|
|
57
|
+
</div>
|
|
58
|
+
</UserPagingLoaderWrapper>
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export default UserPagingLoader;
|