diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..fea1746 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "cSpell.words": [ + "dropup" + ] +} \ No newline at end of file diff --git a/src/App.jsx b/src/App.jsx index 2d05634..5d746e5 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -31,7 +31,9 @@ function App() { const [isWebcamVisible, setIsWebcamVisible] = useState(false); const [isVideoVisible, setIsVideoVisible] = useState(true); - const viewRef = useRef(null); + const [paneWidth, setPaneWidth] = useState(0); + + const elementRef = useRef(null); const layoutCSS = { height: "100%", @@ -40,6 +42,12 @@ function App() { justifyContent: "space-between", }; + useEffect(() => { + setPaneWidth(elementRef.current.offsetWidth); + }, [sizes]); + console.log(`this is the pane width: ${paneWidth}`) + + useEffect(() => { setSizes([sidebarToggle, "auto"]); }, [sidebarToggle]); @@ -47,7 +55,7 @@ function App() { const handleSidebarToggle = (e) => { e.preventDefault(); const elName = e.currentTarget.getAttribute("data-name"); - console.log(elName); + // console.log(elName); if (elName === "chat") { setSidebarContent("chat"); } else if (elName === "participants") { @@ -71,6 +79,7 @@ function App() { const handleVideoViewRemove = (e) => { e.preventDefault(); + setIsVideoVisible(false); setToggleVideoView(false); }; @@ -123,7 +132,7 @@ function App() { className="split-pane-section" > -
+
@@ -176,6 +185,7 @@ function App() { toggleWebcamVisible={toggleWebcamVisible} toggleWebcamHide={toggleWebcamHide} isWebcamVisible={isWebcamVisible} + paneWidth={paneWidth} />
@@ -206,6 +216,7 @@ function App() { handleClearVideoNameInput={handleClearVideoNameInput} setVideoNameValue={setVideoNameValue} videoNameValue={videoNameValue} + toggleVideoView={toggleVideoView} /> )}
diff --git a/src/index.css b/src/index.css index 3374367..9d78609 100644 --- a/src/index.css +++ b/src/index.css @@ -7,6 +7,10 @@ body { /* background-color: #111111; */ } +input:focus-visible { + outline-offset: 0; +} + .split-pane-section { background-color: #111111; } @@ -139,7 +143,7 @@ body { .name-change-form svg { height: 30px; width: 30px; - margin: 0 5px; + margin-left: 8px; color: white; padding: 4px; } @@ -317,3 +321,13 @@ body { .leave-button:hover { background-color: red; } + +/* more button */ + +.dropup-content { + position: absolute !important; + bottom: 55px; + right: 0; + flex-direction: column; +} + diff --git a/src/sections/Chat.jsx b/src/sections/Chat.jsx index 5546d0a..22a2301 100644 --- a/src/sections/Chat.jsx +++ b/src/sections/Chat.jsx @@ -36,7 +36,7 @@ function Chat({ videoId }) { fetchAndSetComments(); }, [videoId]); - console.log(comments) + // console.log(comments) if (comments.length === 0) { return

Video has no comments.

; } else { diff --git a/src/sections/Footer.jsx b/src/sections/Footer.jsx index 51ab667..aac9031 100644 --- a/src/sections/Footer.jsx +++ b/src/sections/Footer.jsx @@ -1,4 +1,4 @@ -import React, { useState } from "react"; +import React, { useState, useEffect } from "react"; import MicOnIcon from "../assets/icons/micOn.svg"; import MicOffIcon from "../assets/icons/micOff.svg"; import VideoOffIcon from "../assets/icons/videoOff.svg"; @@ -14,7 +14,35 @@ import WhiteboardsIcon from "../assets/icons/whiteboards.svg"; import CarretIcon from "../assets/icons/carret.svg"; import CarretGreenIcon from "../assets/icons/carretGreen.svg"; -function Footer({ handleSidebarToggle, toggleWebcamHide, toggleWebcamVisible, isWebcamVisible }) { +function CollapsibleItem({ icon, text, onClick }) { + return ( +
+
+ Icon +
+

{text}

+
+ ); +} + +function Footer({ + handleSidebarToggle, + toggleWebcamHide, + toggleWebcamVisible, + isWebcamVisible, + paneWidth, +}) { + + const [isOpen, setIsOpen] = useState(false); + + const toggleMenu = () => { + setIsOpen(!isOpen); + }; + + const closeMenu = () => { + setIsOpen(false); + }; + return (