Skip to content

Commit fdab9c2

Browse files
committed
implement header component
1 parent 29c498d commit fdab9c2

File tree

5 files changed

+34
-5
lines changed

5 files changed

+34
-5
lines changed

client/package-lock.json

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"dependencies": {
1313
"react": "^18.2.0",
1414
"react-dom": "^18.2.0",
15+
"react-icons": "^5.2.0",
1516
"socket.io-client": "^4.7.4"
1617
},
1718
"devDependencies": {

client/src/App.css

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

6-
#sidebar * {
6+
/* #sidebar * {
77
margin-bottom: 6px;
8-
}
8+
} */
99

10-
#sidebar h1 {
10+
/* #sidebar h1 {
1111
margin-top: '20px';
1212
background: #7F7FD5;
1313
background: -webkit-linear-gradient(to right, #91EAE4, #86A8E7, #7F7FD5);
1414
background: linear-gradient(to right, #91EAE4, #86A8E7, #7F7FD5);
1515
background-clip: text;
1616
-webkit-background-clip: text;
1717
-webkit-text-fill-color: transparent;
18-
}
18+
} */
1919

2020
#linewidth{
2121
margin-top: 10px !important;

client/src/App.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { io } from "socket.io-client";
44

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

7+
import Header from "./components/Header";
8+
79
function App() {
810
const canvasRef = useRef(null);
911
const sidebarRef = useRef(null);
@@ -115,9 +117,10 @@ function App() {
115117
<div id="container" style={{ display: "flex" }}>
116118
<div
117119
id="sidebar"
118-
className="flex flex-col p-1 w-64 bg-gray-900 pl-4"
120+
className="flex flex-col w-64 bg-gray-900"
119121
ref={sidebarRef}
120122
>
123+
<Header></Header>
121124
<h1 id="drawRTC">drawRTC</h1>
122125
<div className="input-container" id="colorpicker">
123126
<label htmlFor="stroke">Stroke</label>

client/src/components/Header.jsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { FaBars } from "react-icons/fa";
2+
3+
function Header() {
4+
return (
5+
<div className="flex border-b-2 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">
6+
<h1 className="font-sans text-2xl antialiased font-extrabold text-white">
7+
drawRTC
8+
</h1>
9+
<div className="" id="options">
10+
<FaBars size={25} />
11+
</div>
12+
</div>
13+
);
14+
}
15+
16+
export default Header;

0 commit comments

Comments
 (0)