Skip to content

Commit b0551ad

Browse files
authored
Merge pull request #18 from apsinghdev/Feat/options-component
Feat/options component
2 parents e1ec0d5 + ff3fc15 commit b0551ad

File tree

8 files changed

+31
-63
lines changed

8 files changed

+31
-63
lines changed

client/src/App.css

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -3,59 +3,12 @@
33
width: 100vw;
44
}
55

6-
/* #sidebar * {
7-
margin-bottom: 6px;
8-
} */
9-
10-
/* #sidebar h1 {
11-
margin-top: '20px';
12-
background: #7F7FD5;
13-
background: -webkit-linear-gradient(to right, #91EAE4, #86A8E7, #7F7FD5);
14-
background: linear-gradient(to right, #91EAE4, #86A8E7, #7F7FD5);
15-
background-clip: text;
16-
-webkit-background-clip: text;
17-
-webkit-text-fill-color: transparent;
18-
} */
19-
20-
#linewidth{
21-
margin-top: 10px !important;
22-
}
23-
246
#container{
257
height: 100%;
268
display: flex;
279
width: 100%;
2810
}
2911

30-
/* #sidebar{
31-
display: flex;
32-
flex-direction: column;
33-
padding: 5px;
34-
width: 250px;
35-
background-color: #202020;
36-
padding-left: 15px;
37-
} */
38-
.input-container {
39-
display: block;
40-
margin-top: 40px;
41-
}
42-
43-
.input-container label {
44-
display: block;
45-
color: white;
46-
}
47-
48-
.input-container input {
49-
display: block;
50-
width: 60%;
51-
}
52-
53-
#clear {
54-
display: block;
55-
width: 60%;
56-
margin-top: 20px;
57-
}
58-
5912

6013

6114

client/src/App.jsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
1-
import { useEffect, useRef } from "react";
1+
import { useEffect, useRef, useState } from "react";
22
import "./App.css";
33
import { io } from "socket.io-client";
44

55
const socket = io("http://localhost:8000");
66

7-
import Header from "./components/Header";
8-
import Toolbar from "./components/Toolbar";
9-
import Socials from "./components/Socials";
10-
import LoginAndLogout from "./components/LoginAndLogout";
117
import Sidebar from "./components/Sidebar";
128
import Canvas from "./components/Canvas";
9+
import Menu from "./components/Menu";
1310

1411
function App() {
12+
13+
const [showMenu, setShowMenu ] = useState(false);
14+
15+
function toggleMenu(){
16+
setShowMenu(!showMenu);
17+
}
18+
1519
const canvasRef = useRef(null);
1620
const sidebarRef = useRef(null);
1721
let color = '#000000'
@@ -124,8 +128,10 @@ function App() {
124128
clearOnClick={clearOnClick}
125129
ref={sidebarRef}
126130
id="clear"
131+
toggleMenu={toggleMenu}
127132
></Sidebar>
128133
<Canvas canvasRef={canvasRef}></Canvas>
134+
{ showMenu && <Menu></Menu>}
129135
</div>
130136
);
131137
}

client/src/components/Canvas.jsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
/* eslint-disable react/prop-types */
2+
import Menu from "./Menu";
3+
24
function Canvas(props){
35
return (
46
<div className="flex justify-center items-center h-full w-80vw overflow-hidden">
57
<canvas
68
className="h-full w-86vw bg-yellow-600"
79
ref={props.canvasRef}
810
></canvas>
11+
{props.showMenu && <Menu></Menu>}
912
</div>
1013
);
1114
}

client/src/components/Header.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1+
/* eslint-disable react/prop-types */
12
import { FaBars } from "react-icons/fa";
23

3-
function Header() {
4+
function Header(props) {
45
return (
56
<div className="flex py-5 justify-around bg-gradient-to-r from-indigo-500 from-10% via-sky-500 via-30% to-emerald-500 to-90% w-full items-center">
67
<h1 className="font-sans text-2xl antialiased font-extrabold text-white">
78
drawRTC
89
</h1>
910
<div className="" id="options">
10-
<FaBars size={25} />
11+
<FaBars size={25} onClick={props.toggleMenu}/>
1112
</div>
1213
</div>
1314
);

client/src/components/Menu.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Socials from "./Socials";
33

44
function Menu(){
55
return (
6-
<div className="w-20 h-auto bg-white z-100">
6+
<div className="w-52 h-56 rounded-xl bg-gradient-to-r from-slate-900 to-slate-700 absolute left-52 top-8 rounded-lg shadow-xl">
77
<MenuItem feat="Start Collaboration"></MenuItem>
88
<MenuItem feat="Start Chat"></MenuItem>
99
<MenuItem feat="Save as pdf"></MenuItem>

client/src/components/MenuItem.jsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
/* eslint-disable react/prop-types */
22
function MenuItem(props){
3-
return(
4-
<div>
5-
<h1>{props.feat}</h1>
6-
</div>
7-
)
3+
return (
4+
<div className="h-11 w-15 border-b border-dotted cursor-pointer content-center">
5+
<h1 className="font-sans text-white justify-center flex">
6+
{props.feat}
7+
</h1>
8+
</div>
9+
);
810
}
911

1012
export default MenuItem;

client/src/components/Sidebar.jsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ import LoginAndLogout from "./LoginAndLogout";
55

66
function Sidebar(props){
77
return (
8-
<div className="flex flex-col w-64 bg-zinc-800 relative" ref={props.ref}>
9-
<Header></Header>
8+
<div
9+
className="flex flex-col w-64 bg-gradient-to-r from-slate-900 to-slate-700 relative"
10+
ref={props.ref}
11+
>
12+
<Header toggleMenu={props.toggleMenu}></Header>
1013
<Toolbar clearOnClick={props.clearOnClick} id={props.id}></Toolbar>
1114
<LoginAndLogout></LoginAndLogout>
1215
</div>

client/src/components/Socials.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function Socials(){
1515
</h1>
1616
<img
1717
src={Xlogo}
18-
className="h-6 w-6 rounded cursor-pointer"
18+
className="h-5 w-5 rounded cursor-pointer"
1919
onClick={clickHandler}
2020
></img>
2121
</div>

0 commit comments

Comments
 (0)