l-min-components 1.7.1552 → 1.7.1554

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "l-min-components",
3
- "version": "1.7.1552",
3
+ "version": "1.7.1554",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/assets",
@@ -1,4 +1,4 @@
1
- import React, { useContext, useState } from 'react';
1
+ import React, { useContext, useState } from "react";
2
2
  import {
3
3
  CommentContainer,
4
4
  CommentContent,
@@ -11,25 +11,25 @@ import {
11
11
  CommentContentAction,
12
12
  CommentContentForm,
13
13
  CommentRecorder,
14
- } from './style/comment.style';
15
- import DeleteIcon from '../../../../assets/svg/delete-icon';
16
- import moment from 'moment';
17
- import ResponseAudio from './responseAudio';
18
- import DeleteModal from './modals/deleteModal';
14
+ } from "./style/comment.style";
15
+ import DeleteIcon from "../../../../assets/svg/delete-icon";
16
+ import moment from "moment";
17
+ import ResponseAudio from "./responseAudio";
18
+ import DeleteModal from "./modals/deleteModal";
19
19
  import {
20
20
  AudioWaveComponent,
21
21
  FullPageLoader,
22
22
  OutletContext,
23
23
  useAudioPlayer,
24
- } from '../../..';
25
- import { CloseIcon } from '../../../header/assets/svg/close';
26
- import classNames from 'classnames';
27
- import { useRecorder } from 'react-microphone-recorder';
28
- import styled from 'styled-components';
29
- import { FaPause } from 'react-icons/fa';
30
- import useApi from '../api';
31
- import formatDuration from '../../../../utils/formatDuration.';
32
- import ResponseAudioV2 from './responseAudio.v2';
24
+ } from "../../..";
25
+ import { CloseIcon } from "../../../header/assets/svg/close";
26
+ import classNames from "classnames";
27
+ import { useRecorder } from "react-microphone-recorder";
28
+ import styled from "styled-components";
29
+ import { FaPause } from "react-icons/fa";
30
+ import useApi from "../api";
31
+ import formatDuration from "../../../../utils/formatDuration.";
32
+ import ResponseAudioV2 from "./responseAudio.v2";
33
33
  /**
34
34
  * @param {Object} props
35
35
  * @param {boolean} props.editMode
@@ -49,7 +49,7 @@ const Comment = ({
49
49
  const { affiliateAccount } = useContext(OutletContext);
50
50
  const [toggleDelete, setToggleDelete] = useState(false);
51
51
  const [showForm, setShowForm] = useState(null);
52
- const [value, setValue] = useState('');
52
+ const [value, setValue] = useState("");
53
53
  const {
54
54
  handleAddComment,
55
55
  addCommentData,
@@ -94,17 +94,17 @@ const Comment = ({
94
94
  questionActivityID,
95
95
  testId,
96
96
  data,
97
- enterpriseId,
97
+ enterpriseId
98
98
  );
99
99
  if (res?.data) {
100
100
  const comment = res?.data?.data?.answer?.comments?.[0];
101
101
  setData(comment);
102
102
  setShowForm(null);
103
- setValue('');
103
+ setValue("");
104
104
  }
105
105
  } else {
106
106
  const formData = new FormData();
107
- formData.append('upload', audioFile);
107
+ formData.append("upload", audioFile);
108
108
  const resMedia = await handleUpload(formData);
109
109
  const media = resMedia?.data?.results?.[0];
110
110
  if (media) {
@@ -120,7 +120,7 @@ const Comment = ({
120
120
  questionActivityID,
121
121
  testId,
122
122
  data,
123
- enterpriseId,
123
+ enterpriseId
124
124
  );
125
125
  if (res?.data) {
126
126
  const comment = res?.data?.data?.answer?.comments?.[0];
@@ -138,12 +138,12 @@ const Comment = ({
138
138
  questionActivityID,
139
139
  testId,
140
140
  0,
141
- enterpriseId,
141
+ enterpriseId
142
142
  );
143
143
  if (res?.data) {
144
144
  setData(null);
145
145
  setToggleDelete(false);
146
- setValue('');
146
+ setValue("");
147
147
  setShowForm(null);
148
148
  }
149
149
  };
@@ -188,11 +188,11 @@ const Comment = ({
188
188
  <CommentContentHeader>
189
189
  <p className="name">{data?.author_name}</p>
190
190
  <p className="date">
191
- {moment(data?.created_at).format('MMM DD, YYYY, HH:MM A')}
191
+ {moment(data?.created_at).format("MMM DD, YYYY, hh:mm A")}
192
192
  </p>
193
193
  </CommentContentHeader>
194
194
  <CommentContentBody>
195
- {data?.type === 'audio' && data?.audio && (
195
+ {data?.type === "audio" && data?.audio && (
196
196
  <div className="comment_audio">
197
197
  <ResponseAudioV2
198
198
  url={data?.audio?.uploaded_media_url}
@@ -207,11 +207,11 @@ const Comment = ({
207
207
  />
208
208
  </div>
209
209
  )}
210
- {data?.type === 'text' && data?.text && (
210
+ {data?.type === "text" && data?.text && (
211
211
  <p className="text">{data?.text}</p>
212
212
  )}
213
213
  </CommentContentBody>
214
- {editMode && data?.type !== 'audio' && (
214
+ {editMode && data?.type !== "audio" && (
215
215
  <CommentContentBodyFooter>
216
216
  <button
217
217
  onClick={() => {
@@ -234,7 +234,7 @@ const Comment = ({
234
234
  className="sm-btn"
235
235
  disabled={disabledAdd}
236
236
  onClick={() => {
237
- setShowForm('Text');
237
+ setShowForm("Text");
238
238
  }}
239
239
  >
240
240
  {findText("Add comment")}
@@ -244,7 +244,7 @@ const Comment = ({
244
244
  {showForm && (
245
245
  <>
246
246
  <CommentContentForm>
247
- {showForm === 'Text' && (
247
+ {showForm === "Text" && (
248
248
  <textarea
249
249
  placeholder={findText("Input comment here")}
250
250
  value={value}
@@ -253,10 +253,10 @@ const Comment = ({
253
253
  }}
254
254
  />
255
255
  )}
256
- {showForm === 'Audio' && (
256
+ {showForm === "Audio" && (
257
257
  <AudioRecordPlayer
258
258
  url={audioFile ? audioURL : null}
259
- isRecording={recordingState === 'recording'}
259
+ isRecording={recordingState === "recording"}
260
260
  start={startRecording}
261
261
  stopRecord={stopRecording}
262
262
  reset={resetRecording}
@@ -273,15 +273,15 @@ const Comment = ({
273
273
  active: showForm === item?.text,
274
274
  })}
275
275
  onClick={() => {
276
- if (showForm === 'Text') {
277
- setShowForm('Audio');
276
+ if (showForm === "Text") {
277
+ setShowForm("Audio");
278
278
  } else {
279
- setShowForm('Text');
279
+ setShowForm("Text");
280
280
  }
281
281
  }}
282
282
  >
283
283
  <item.icon
284
- color={showForm === item?.text ? '#fff' : ''}
284
+ color={showForm === item?.text ? "#fff" : ""}
285
285
  />
286
286
  {item?.text}
287
287
  </li>
@@ -327,7 +327,7 @@ const AudioRecordPlayer = ({
327
327
  {playWave || url ? (
328
328
  <div className="audioContent">
329
329
  <TrashIcon
330
- className={classNames('trash-icon', {
330
+ className={classNames("trash-icon", {
331
331
  disabled: isRecording || !isReady,
332
332
  })}
333
333
  onClick={resetHandler}
@@ -338,7 +338,7 @@ const AudioRecordPlayer = ({
338
338
  type="extra-small"
339
339
  color="#FDBA00"
340
340
  count={16}
341
- playState={playWave ? 'play' : 'stop'}
341
+ playState={playWave ? "play" : "stop"}
342
342
  />
343
343
 
344
344
  {isRecording ? (
@@ -387,7 +387,7 @@ export const PauseIcon = ({ onClick, className, disabled }) => (
387
387
  >
388
388
  <path
389
389
  d="M13.3333 15.8337C12.875 15.8337 12.4828 15.6706 12.1567 15.3445C11.8306 15.0184 11.6672 14.6259 11.6667 14.167V5.83366C11.6667 5.37533 11.83 4.9831 12.1567 4.65699C12.4833 4.33088 12.8756 4.16755 13.3333 4.16699C13.7911 4.16644 14.1836 4.32977 14.5108 4.65699C14.8381 4.98422 15.0011 5.37644 15 5.83366V14.167C15 14.6253 14.8369 15.0178 14.5108 15.3445C14.1847 15.6712 13.7922 15.8342 13.3333 15.8337ZM6.66667 15.8337C6.20833 15.8337 5.81611 15.6706 5.49 15.3445C5.16389 15.0184 5.00056 14.6259 5 14.167V5.83366C5 5.37533 5.16333 4.9831 5.49 4.65699C5.81667 4.33088 6.20889 4.16755 6.66667 4.16699C7.12444 4.16644 7.51694 4.32977 7.84417 4.65699C8.17139 4.98422 8.33444 5.37644 8.33333 5.83366V14.167C8.33333 14.6253 8.17028 15.0178 7.84417 15.3445C7.51806 15.6712 7.12556 15.8342 6.66667 15.8337Z"
390
- fill={disabled ? '#C6CCCC' : '#FEBF10'}
390
+ fill={disabled ? "#C6CCCC" : "#FEBF10"}
391
391
  />
392
392
  </svg>
393
393
  );
@@ -403,7 +403,7 @@ export const PlayIcon = ({ onClick, className, disabled }) => (
403
403
  >
404
404
  <path
405
405
  d="M3 9V6.49379C3 3.38216 5.1502 2.10793 7.78127 3.66375L9.90398 4.91686L12.0267 6.16996C14.6578 7.72578 14.6578 10.2742 12.0267 11.83L9.90398 13.0831L7.78127 14.3362C5.1502 15.8921 3 14.6178 3 11.5062V9Z"
406
- fill={disabled ? '#C6CCCC' : '#FEBF10'}
406
+ fill={disabled ? "#C6CCCC" : "#FEBF10"}
407
407
  />
408
408
  </svg>
409
409
  );
@@ -417,7 +417,7 @@ const TextIcon = ({ color }) => (
417
417
  >
418
418
  <path
419
419
  d="M5.04 11.2969L1.5 20.2969H3.51L4.275 18.0919H7.665L8.46 20.2969H10.5L6.975 11.2969H5.04ZM4.815 16.5919L5.985 13.3819L7.155 16.5919H4.815ZM17.73 6.79688H15.33L10.5 20.2969H12.84L13.965 16.8619H19.005L20.16 20.2969H22.5L17.73 6.79688ZM14.505 15.0469L16.275 9.66187C16.3635 9.38437 16.425 9.09788 16.455 8.80688C16.4955 9.09488 16.551 9.37987 16.62 9.66187L18.495 15.0469H14.505Z"
420
- fill={color || '#4A4D4D'}
420
+ fill={color || "#4A4D4D"}
421
421
  />
422
422
  </svg>
423
423
  );
@@ -433,35 +433,35 @@ export const TrashIcon = ({ className, disabled, onClick }) => (
433
433
  >
434
434
  <path
435
435
  d="M17.5 4.98307C14.725 4.70807 11.9333 4.56641 9.15 4.56641C7.5 4.56641 5.85 4.64974 4.2 4.81641L2.5 4.98307"
436
- stroke={disabled ? '#C6CCCC' : '#F95454'}
436
+ stroke={disabled ? "#C6CCCC" : "#F95454"}
437
437
  stroke-width="1.5"
438
438
  stroke-linecap="round"
439
439
  stroke-linejoin="round"
440
440
  />
441
441
  <path
442
442
  d="M7.08594 4.14297L7.26927 3.0513C7.4026 2.25964 7.5026 1.66797 8.91094 1.66797H11.0943C12.5026 1.66797 12.6109 2.29297 12.7359 3.05964L12.9193 4.14297"
443
- stroke={disabled ? '#C6CCCC' : '#F95454'}
443
+ stroke={disabled ? "#C6CCCC" : "#F95454"}
444
444
  stroke-width="1.5"
445
445
  stroke-linecap="round"
446
446
  stroke-linejoin="round"
447
447
  />
448
448
  <path
449
449
  d="M15.7057 7.61719L15.1641 16.0089C15.0724 17.3172 14.9974 18.3339 12.6724 18.3339H7.3224C4.9974 18.3339 4.9224 17.3172 4.83073 16.0089L4.28906 7.61719"
450
- stroke={disabled ? '#C6CCCC' : '#F95454'}
450
+ stroke={disabled ? "#C6CCCC" : "#F95454"}
451
451
  stroke-width="1.5"
452
452
  stroke-linecap="round"
453
453
  stroke-linejoin="round"
454
454
  />
455
455
  <path
456
456
  d="M8.60938 13.749H11.3844"
457
- stroke={disabled ? '#C6CCCC' : '#F95454'}
457
+ stroke={disabled ? "#C6CCCC" : "#F95454"}
458
458
  stroke-width="1.5"
459
459
  stroke-linecap="round"
460
460
  stroke-linejoin="round"
461
461
  />
462
462
  <path
463
463
  d="M7.91406 10.416H12.0807"
464
- stroke={disabled ? '#C6CCCC' : '#F95454'}
464
+ stroke={disabled ? "#C6CCCC" : "#F95454"}
465
465
  stroke-width="1.5"
466
466
  stroke-linecap="round"
467
467
  stroke-linejoin="round"
@@ -479,7 +479,7 @@ const AudioIcon = ({ color }) => {
479
479
  >
480
480
  <path
481
481
  d="M11.5405 1.00679C12.104 0.501288 13 0.900788 13 1.65729V17.9373C13 18.6943 12.104 19.0938 11.5405 18.5883L7.4375 14.9053C7.00173 14.5139 6.43671 14.2974 5.851 14.2973H3.5C2.80381 14.2973 2.13613 14.0207 1.64384 13.5284C1.15156 13.0362 0.875 12.3685 0.875 11.6723V7.92229C0.875 6.47229 2.05 5.29729 3.5 5.29729H5.851C6.43671 5.29718 7.00173 5.08065 7.4375 4.68929L11.5405 1.00629V1.00679ZM17.169 1.99529C17.2823 1.87442 17.4389 1.80347 17.6045 1.79803C17.7701 1.79259 17.931 1.85311 18.052 1.96629L18.0575 1.97129L18.0525 1.96629L18.053 1.96729L18.0545 1.96829L18.0575 1.97129L18.067 1.98029L18.097 2.00929C18.252 2.1676 18.3997 2.33294 18.5395 2.50479C18.9192 2.97496 19.2563 3.47794 19.547 4.00779C20.276 5.32679 21 7.27379 21 9.79729C21 12.3208 20.276 14.2673 19.547 15.5873C19.2561 16.1168 18.9188 16.6194 18.539 17.0893C18.3991 17.2613 18.2515 17.4268 18.0965 17.5853C18.0866 17.595 18.0766 17.6047 18.0665 17.6143L18.0575 17.6233L18.0545 17.6263L18.053 17.6273V17.6278C18.053 17.6278 18.383 17.2973 18.052 17.6278C17.9305 17.7371 17.771 17.7945 17.6077 17.7877C17.4443 17.7808 17.2902 17.7103 17.1783 17.5911C17.0664 17.4719 17.0056 17.3137 17.009 17.1502C17.0124 16.9868 17.0797 16.8312 17.1965 16.7168L17.1975 16.7163L17.199 16.7148L17.215 16.6988C17.2399 16.6742 17.2644 16.6492 17.2885 16.6238C17.354 16.5538 17.4515 16.4458 17.57 16.2998C17.9027 15.8876 18.1982 15.4467 18.453 14.9823C19.099 13.8143 19.75 12.0738 19.75 9.79729C19.75 7.52079 19.099 5.78029 18.453 4.61229C18.1982 4.14769 17.9028 3.70663 17.57 3.29429C17.4576 3.15611 17.3392 3.02298 17.215 2.89529C17.2097 2.88992 17.2044 2.88458 17.199 2.87929L17.1975 2.87779L17.1965 2.87679C17.0761 2.76333 17.0057 2.60679 17.0005 2.44147C16.9954 2.27615 17.0559 2.11552 17.169 1.99479V1.99529ZM15.167 4.99729C15.2228 4.93709 15.29 4.88848 15.3646 4.85424C15.4392 4.82001 15.5199 4.80081 15.6019 4.79774C15.684 4.79468 15.7658 4.80781 15.8428 4.83638C15.9197 4.86496 15.9903 4.90842 16.0505 4.96429L16.0825 4.99529L16.0505 4.96529H16.051L16.052 4.96629L16.0545 4.96879L16.0615 4.97479L16.0825 4.99529C16.1854 5.09835 16.2838 5.20579 16.3775 5.31729C16.56 5.53529 16.8005 5.85329 17.04 6.26379C17.6684 7.33537 17.9997 8.55507 18 9.79729C18 11.3088 17.5185 12.5103 17.04 13.3313C16.8 13.7413 16.56 14.0598 16.377 14.2778C16.2833 14.3893 16.1849 14.4967 16.082 14.5998L16.0725 14.6093C16.0689 14.6128 16.0652 14.6163 16.0615 14.6198L16.0545 14.6263L16.052 14.6288L16.0505 14.6303L16.0545 14.6263L16.0505 14.6303C15.9288 14.7404 15.7687 14.7983 15.6047 14.7914C15.4407 14.7844 15.286 14.7133 15.174 14.5932C15.0621 14.4732 15.0018 14.3139 15.0063 14.1498C15.0108 13.9858 15.0796 13.83 15.198 13.7163L15.199 13.7153L15.207 13.7073C15.2155 13.6988 15.23 13.6848 15.2495 13.6643C15.3083 13.6027 15.365 13.5392 15.4195 13.4738C15.5645 13.3008 15.762 13.0408 15.96 12.7013C16.477 11.8208 16.7497 10.8183 16.75 9.79729C16.75 8.55879 16.3565 7.57279 15.96 6.89379C15.762 6.55379 15.565 6.29379 15.42 6.12129C15.3522 6.04057 15.2812 5.96267 15.207 5.88779L15.1985 5.87929L15.199 5.87979C15.0779 5.76693 15.0065 5.61061 15.0005 5.44516C14.9945 5.2797 15.0544 5.11863 15.167 4.99729Z"
482
- fill={color || '#4A4D4D'}
482
+ fill={color || "#4A4D4D"}
483
483
  />
484
484
  </svg>
485
485
  );