Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed MUI buttons from VoiceRecorder component #4712

Merged
merged 4 commits into from
Feb 3, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions src/Components/Patient/FileUpload.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import axios from "axios";
import { Button, CircularProgress, InputLabel } from "@material-ui/core";
import { CircularProgress, InputLabel } from "@material-ui/core";
import CloudUploadOutlineIcon from "@material-ui/icons/CloudUpload";
import loadable from "@loadable/component";
import React, { useCallback, useState, useEffect } from "react";
Expand Down Expand Up @@ -1294,20 +1294,15 @@ export const FileUpload = (props: FileUploadProps) => {
<>
<VoiceRecorder createAudioBlob={createAudioBlob} />
{audioBlob && (
<Button
color="primary"
variant="contained"
type="submit"
style={{ marginLeft: "auto" }}
startIcon={
<CloudUploadOutlineIcon>save</CloudUploadOutlineIcon>
}
<button
Pranshu1902 marked this conversation as resolved.
Show resolved Hide resolved
className="btn btn-primary flex gap-2"
rithviknishad marked this conversation as resolved.
Show resolved Hide resolved
onClick={() => {
handleAudioUpload();
}}
>
Save Recording
</Button>
<CloudUploadOutlineIcon>save</CloudUploadOutlineIcon> Save
Pranshu1902 marked this conversation as resolved.
Show resolved Hide resolved
Recording
</button>
)}
</>
)}
Expand Down
27 changes: 10 additions & 17 deletions src/Utils/VoiceRecorder.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as React from "react";
import useRecorder from "./useRecorder";
import { Button } from "@material-ui/core";
import MicIcon from "@material-ui/icons/Mic";
import MicOffIcon from "@material-ui/icons/MicOff";
import { useEffect, useState } from "react";
Expand Down Expand Up @@ -28,41 +27,35 @@ export const VoiceRecorder = (props: any) => {
<div className="text-xs">
Please allow browser permission before you start speaking
</div>
<div className="mt-2">
<div>
{isRecording ? (
<>
<div className="space-x-2 flex">
<div className="bg-gray-100 p-2 text-primary-700">
<i className="fas fa-microphone-alt animate-pulse mr-2"></i>
Recording...
</div>
<Button
color="primary"
variant="contained"
<button
Pranshu1902 marked this conversation as resolved.
Show resolved Hide resolved
className="btn btn-primary"
style={{ marginLeft: "auto" }}
startIcon={<MicOffIcon />}
onClick={stopRecording}
disabled={!isRecording}
>
Stop
</Button>
<MicOffIcon /> Stop
Pranshu1902 marked this conversation as resolved.
Show resolved Hide resolved
</button>
</div>
<div className="mx-3">
<span>{("0" + Math.floor((time / 60000) % 60)).slice(-2)}:</span>
<span>{("0" + Math.floor((time / 1000) % 60)).slice(-2)}</span>
</div>
</>
) : (
<Button
color="primary"
variant="contained"
style={{ marginLeft: "auto" }}
startIcon={<MicIcon />}
<button
Pranshu1902 marked this conversation as resolved.
Show resolved Hide resolved
className="btn btn-primary"
// style={{ marginLeft: "auto" }}
onClick={startRecording}
disabled={isRecording}
>
{audioURL ? "Re-Record" : "Record"}
</Button>
<MicIcon /> {audioURL ? "Re-Record" : "Record"}
Pranshu1902 marked this conversation as resolved.
Show resolved Hide resolved
</button>
)}
</div>
{audioURL && (
Expand Down