File tree Expand file tree Collapse file tree 4 files changed +25
-16
lines changed Expand file tree Collapse file tree 4 files changed +25
-16
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ 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" ;
11
12
12
13
function App ( ) {
13
14
const canvasRef = useRef ( null ) ;
@@ -118,19 +119,7 @@ function App() {
118
119
119
120
return (
120
121
< div id = "container" style = { { display : "flex" } } >
121
- < div
122
- id = "sidebar"
123
- className = "flex flex-col w-64 bg-zinc-800 relative"
124
- 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 >
122
+ < Sidebar clearOnClick = { clearOnClick } ref = { sidebarRef } id = "clear" > </ Sidebar >
134
123
< div className = "canvas-container" >
135
124
< canvas className = "canvas" ref = { canvasRef } > </ canvas >
136
125
</ div >
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