Skip to content

Commit 011f97b

Browse files
committed
🔧 fix: minor fixes
1 parent 717415c commit 011f97b

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
lines changed

‎src/chat/chatbox.tsx

+5-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { CSSProperties, useEffect, useRef, useState } from "react";
44
import Button from "./button";
55
import Input from "./input";
66
import ChatLoader from "./chat-loader";
7-
import { Attachment, Close, MicIcon, SendIcon } from "../assets/icons";
7+
import { Attachment, Close, SendIcon } from "../assets/icons";
88
import { SarufiIcon } from "../assets/illustrations";
99
import Media from "./media";
1010
import DatePicker from "./message-actions/date-picker";
@@ -267,7 +267,9 @@ const Chatbox = ({
267267
>
268268
{!isRecording && (
269269
<>
270-
<button>
270+
<button
271+
onClick={() => alert("We don't support this feature yet.")}
272+
>
271273
<Attachment size={18} />
272274
</button>
273275
<DatePicker
@@ -279,7 +281,7 @@ const Chatbox = ({
279281
</>
280282
)}
281283
<RecordAudio
282-
readFile={(file) => console.log(file.size)}
284+
readFile={() => alert("We don't support this feature yet.")}
283285
saveIsRecording={(record) => setIsRecording(record)}
284286
/>
285287
</div>

‎src/chat/message-actions/audio-record.tsx

+10-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
MicIcon,
77
Pause,
88
Play,
9-
RecordingAudioIcon,
9+
// RecordingAudioIcon,
1010
SendIcon,
1111
} from "../../assets/icons";
1212

@@ -204,7 +204,14 @@ const RecordAudio = ({
204204
<button
205205
onClick={() => {
206206
if (recordedAudio.blob) {
207-
// URL.revokeObjectURL(recordedAudio.blob);
207+
setRecordedAudio({
208+
file: null,
209+
blob: "",
210+
error: "",
211+
fileBuffer: null,
212+
});
213+
setRecordingDuration(0);
214+
saveIsRecording(false);
208215
} else handleStopRecording();
209216
}}
210217
disabled={!isRecording || disabled}
@@ -232,7 +239,7 @@ const RecordAudio = ({
232239
gap: "0.5rem",
233240
}}
234241
>
235-
<RecordingAudioIcon size={18} />
242+
{/* <RecordingAudioIcon size={18} /> */}
236243
<span>{formatDuration(recordingDuration)}</span>
237244
</div>
238245
)}

‎src/chat/message-actions/date-picker.tsx

+3-7
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@ interface DatePickerProps {
1212
styles?: CSSProperties;
1313
}
1414

15-
// A date picker component that allows the user to select a date from a calendar.
16-
// only an icon is displayed when clicked a calendar view is seen, after selecting date, onSelect callback is called.
17-
// use normal input for a date picker.
18-
// Example:
19-
// <span class="datepicker-toggle-button"></span>
20-
// <input type="date" class="datepicker-input"></input>
2115
const DatePicker = ({
2216
styles,
2317
selectedDate,
@@ -38,7 +32,9 @@ const DatePicker = ({
3832
type="date"
3933
className="datepicker-input"
4034
value={date.toISOString().split("T")[0]}
41-
onChange={(e) => handleSelect(new Date(e.target.value))}
35+
onChange={(e) =>
36+
e.target.value && handleSelect(new Date(e.target.value))
37+
}
4238
min={contraints?.minDate?.toISOString().split("T")[0]}
4339
max={contraints?.maxDate?.toISOString().split("T")[0]}
4440
/>

0 commit comments

Comments
 (0)