starting off header with the full window dimensions
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
import { Header, HeaderName } from "carbon-components-react";
|
||||
import { useEffect, useMemo, useRef, useState } from "react";
|
||||
|
||||
import { Avatar } from "antd";
|
||||
import Logo from "../Logo";
|
||||
import { useGetUserDetails } from "../../controller/index";
|
||||
|
||||
export default function NirvanaHeader() {
|
||||
const { data: userDetailsRes, isLoading } = useGetUserDetails();
|
||||
|
||||
const userVideo = useRef<HTMLVideoElement>();
|
||||
const [userVideoStream, setUserVideoStream] =
|
||||
useState<MediaStream>(undefined);
|
||||
|
||||
// todo: show user local video stream
|
||||
useEffect(() => {
|
||||
navigator.mediaDevices
|
||||
.getUserMedia({ video: true, audio: true })
|
||||
.then((stream: MediaStream) => {
|
||||
if (userVideo) userVideo.current.srcObject = stream;
|
||||
setUserVideoStream(stream);
|
||||
});
|
||||
}, []);
|
||||
|
||||
if (isLoading) return <>loading</>;
|
||||
|
||||
const userRepresentation = useMemo(() => {
|
||||
if (userVideoStream) return;
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className="flex flex-row items-center h-12 bg-gray-100">
|
||||
<Logo type="small" className="scale-[0.2]" />
|
||||
|
||||
{userDetailsRes?.user?.picture && <></>}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user