mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-21 04:39:06 +00:00
re-arrange code
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
export default function Record(props) {
|
||||
import AudioVisualizer from "./audioVisualizer.js";
|
||||
|
||||
export default function Recorder(props) {
|
||||
let mediaRecorder = null; // mediaRecorder instance
|
||||
|
||||
const startRecording = () => {
|
||||
@@ -17,23 +19,18 @@ export default function Record(props) {
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="flex flex-col justify-center h-screen">
|
||||
<div className="text-center py-6 mt-10">
|
||||
<h1 className="text-5xl font-bold text-blue-500">Reflector</h1>
|
||||
<p className="text-gray-500">Capture The Signal, Not The Noise</p>
|
||||
</div>
|
||||
<div className="flex flex-col items-center justify-center">
|
||||
{props.isRecording && <AudioVisualizer />}
|
||||
|
||||
<div className="flex flex-col items-center justify-center flex-grow -mt-10">
|
||||
{!props.isRecording ? (
|
||||
<button onClick={startRecording} data-color="blue">
|
||||
Record
|
||||
</button>
|
||||
) : (
|
||||
{props.isRecording ? (
|
||||
<button onClick={stopRecording} data-color="red">
|
||||
Stop
|
||||
</button>
|
||||
) : (
|
||||
<button onClick={startRecording} data-color="blue">
|
||||
Record
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user