refactor: audio UX and deafen
This commit is contained in:
@@ -5,17 +5,18 @@ import JoinVoice from './JoinVoice';
|
||||
import { useVoice } from '../../../common/component/Voice';
|
||||
|
||||
type Props = {
|
||||
visible: boolean,
|
||||
context?: "channel" | "dm",
|
||||
id: number,
|
||||
}
|
||||
|
||||
const Dashboard = ({ context = "channel", id }: Props) => {
|
||||
const { joinVoice, joined, joining, voicingInfo } = useVoice({ id, context });
|
||||
const Dashboard = ({ context = "channel", id, visible }: Props) => {
|
||||
const { joinVoice, joined, joining, voicingInfo, setMute, setDeafen, leave } = useVoice({ id, context });
|
||||
// const dispatch = useDispatch();
|
||||
|
||||
|
||||
return <div className='absolute -left-full -translate-x-full -top-1 z-50 shadow rounded p-2 bg-white dark:bg-black px-2 py-4'>
|
||||
{joined ? <VoiceManagement info={voicingInfo} /> : <JoinVoice join={joinVoice} joining={joining} />}
|
||||
return <div className={`h-full flex-col gap-1 w-[226px] overflow-y-scroll p-2 shadow-[inset_1px_0px_0px_rgba(0,_0,_0,_0.1)] ${visible ? "flex" : "hidden"}`}>
|
||||
{joined ? <VoiceManagement info={voicingInfo} setMute={setMute} setDeafen={setDeafen} leave={leave} /> : <JoinVoice join={joinVoice} joining={joining} />}
|
||||
</div>;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user