Update ViewConvo.tsx

This commit is contained in:
Arjun Patel
2022-02-06 17:35:02 -08:00
parent 632f4de98d
commit 6c8de9f918
@@ -21,6 +21,8 @@ import UserAvatar, { UserAvatarSizes } from "../UserDetails/UserAvatar";
import { useRecoilValue, useSetRecoilState } from "recoil"; import { useRecoilValue, useSetRecoilState } from "recoil";
import { import {
allRelevantConversationsAtom, allRelevantConversationsAtom,
audioQueueCurrentClipSelector,
isRecordingAtom,
selectedConvoAtom, selectedConvoAtom,
userConvoAssociationSelector, userConvoAssociationSelector,
} from "../../recoil/main"; } from "../../recoil/main";
@@ -229,6 +231,9 @@ export default function ViewConvo(props: { conversationId: string }) {
toast("Coming soon!"); toast("Coming soon!");
}; };
const isRecording = useRecoilValue(isRecordingAtom);
const audioQueueCurrentItem = useRecoilValue(audioQueueCurrentClipSelector);
return ( return (
<> <>
{/* <Modal {/* <Modal
@@ -423,19 +428,27 @@ export default function ViewConvo(props: { conversationId: string }) {
<span className="mx-auto flex flex-row py-10 space-x-5"> <span className="mx-auto flex flex-row py-10 space-x-5">
<Tooltip title={"Press and hold R to send a voice clip."}> <Tooltip title={"Press and hold R to send a voice clip."}>
<span <span
className="ml-auto shadow-lg flex flex-row items-center p-5 className={`ml-auto shadow-lg flex flex-row items-center p-5
justify-center rounded-lg bg-slate-50 font-bold hover:cursor-pointer" justify-center rounded-lg font-bold hover:cursor-pointer ${
isRecording
? "bg-orange-700 text-white"
: "bg-slate-50 text-orange-700"
}`}
> >
<FaMicrophone className="text-xl text-orange-700" /> <FaMicrophone className="text-xl " />
</span> </span>
</Tooltip> </Tooltip>
<Tooltip title={"SPACE to play last conversation chunk."}> <Tooltip title={"SPACE to play last conversation chunk."}>
<span <span
className="shadow-lg flex flex-row items-center p-5 justify-center className={`shadow-lg flex flex-row items-center p-5 justify-center
rounded-lg bg-slate-50 font-bold" rounded-lg font-bold ${
!audioQueueCurrentItem
? "bg-slate-50 text-teal-600"
: " bg-teal-600 text-white"
}`}
> >
<FaPlay className="text-teal-600 text-xl" /> <FaPlay className="text-xl" />
</span> </span>
</Tooltip> </Tooltip>
</span> </span>