File tree Expand file tree Collapse file tree 6 files changed +44
-33
lines changed Expand file tree Collapse file tree 6 files changed +44
-33
lines changed Original file line number Diff line number Diff line change 55
55
width : 60% ;
56
56
margin-top : 20px ;
57
57
}
58
-
59
- .canvas-container {
60
- display : flex;
61
- justify-content : center;
62
- align-items : center;
63
- height : 100% ;
64
- width : 100% ;
65
- }
66
-
67
- .canvas {
68
- height : 100% ;
69
- width : 86vw ;
70
- background-color : rgb (212 , 212 , 13 );
71
- }
72
58
73
59
74
60
Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ import Header from "./components/Header";
8
8
import Toolbar from "./components/Toolbar" ;
9
9
import Socials from "./components/Socials" ;
10
10
import LoginAndLogout from "./components/LoginAndLogout" ;
11
+ import Sidebar from "./components/Sidebar" ;
12
+ import Canvas from "./components/Canvas" ;
11
13
12
14
function App ( ) {
13
15
const canvasRef = useRef ( null ) ;
@@ -117,23 +119,13 @@ function App() {
117
119
}
118
120
119
121
return (
120
- < div id = "container" style = { { display : "flex" } } >
121
- < div
122
- id = "sidebar"
123
- className = "flex flex-col w-64 bg-zinc-800 relative"
122
+ < div id = "container" >
123
+ < Sidebar
124
+ clearOnClick = { clearOnClick }
124
125
ref = { sidebarRef }
125
- >
126
- < Header > </ Header >
127
- < Toolbar > </ Toolbar >
128
- < Socials > </ Socials >
129
- < button id = "clear" onClick = { clearOnClick } >
130
- Clear
131
- </ button >
132
- < LoginAndLogout > </ LoginAndLogout >
133
- </ div >
134
- < div className = "canvas-container" >
135
- < canvas className = "canvas" ref = { canvasRef } > </ canvas >
136
- </ div >
126
+ id = "clear"
127
+ > </ Sidebar >
128
+ < Canvas canvasRef = { canvasRef } > </ Canvas >
137
129
</ div >
138
130
) ;
139
131
}
Original file line number Diff line number Diff line change
1
+ /* eslint-disable react/prop-types */
2
+ function Canvas ( props ) {
3
+ return (
4
+ < div className = "flex justify-center items-center h-full w-80vw overflow-hidden" >
5
+ < canvas
6
+ className = "h-full w-86vw bg-yellow-600"
7
+ ref = { props . canvasRef }
8
+ > </ canvas >
9
+ </ div >
10
+ ) ;
11
+ }
12
+
13
+ export default Canvas ;
Original file line number Diff line number Diff line change 1
- function ClearBtn ( ) {
1
+ /* eslint-disable react/prop-types */
2
+ function ClearBtn ( props ) {
2
3
return (
3
4
< div className = "border block flex items-center justify-center mt-5" >
4
5
< button
5
6
type = "button"
6
7
className = "text-white bg-gradient-to-r from-red-400 via-red-500 to-red-600 hover:bg-gradient-to-br font-medium rounded-lg text-sm px-5 py-2.5 text-center"
8
+ onClick = { props . clearOnClick }
9
+ id = { props . id }
7
10
>
8
11
Clear
9
12
</ button >
Original file line number Diff line number Diff line change
1
+ /* eslint-disable react/prop-types */
2
+ import Header from "./Header" ;
3
+ import Toolbar from "./Toolbar" ;
4
+ import LoginAndLogout from "./LoginAndLogout" ;
5
+
6
+ function Sidebar ( props ) {
7
+ return (
8
+ < div className = "flex flex-col w-64 bg-zinc-800 relative" ref = { props . ref } >
9
+ < Header > </ Header >
10
+ < Toolbar clearOnClick = { props . clearOnClick } id = { props . id } > </ Toolbar >
11
+ < LoginAndLogout > </ LoginAndLogout >
12
+ </ div >
13
+ ) ;
14
+ }
15
+
16
+ export default Sidebar ;
Original file line number Diff line number Diff line change
1
+ /* eslint-disable react/prop-types */
1
2
import ColorPicker from "./ColorPicker" ;
2
3
import StrokeWidthPicker from "./StrokeWidthPicker" ;
3
4
import ClearBtn from "./ClearBtn" ;
4
5
5
- function Toolbar ( ) {
6
+ function Toolbar ( props ) {
6
7
return (
7
8
< div className = "block w-full mt-20 border align-center" >
8
9
< ColorPicker name = "Colors :" defaultColor = "#000000" > </ ColorPicker >
9
10
< ColorPicker name = "Canvas :" defaultColor = "#FFFFFF" > </ ColorPicker >
10
11
< StrokeWidthPicker > </ StrokeWidthPicker >
11
- < ClearBtn > </ ClearBtn >
12
+ < ClearBtn clearOnClick = { props . clearOnClick } id = { props . id } > </ ClearBtn >
12
13
</ div >
13
14
) ;
14
15
}
You can’t perform that action at this time.
0 commit comments