File tree Expand file tree Collapse file tree 5 files changed +43
-22
lines changed Expand file tree Collapse file tree 5 files changed +43
-22
lines changed Original file line number Diff line number Diff line change @@ -125,14 +125,15 @@ function App() {
125
125
return (
126
126
< div id = "container" >
127
127
< Sidebar
128
+ addStroke = { addStroke }
128
129
addLineWidth = { addLineWidth }
129
130
clearOnClick = { clearOnClick }
130
131
ref = { sidebarRef }
131
132
id = "clear"
132
133
toggleMenu = { toggleMenu }
133
134
> </ Sidebar >
134
135
< Canvas canvasRef = { canvasRef } > </ Canvas >
135
- { showMenu && < Menu > </ Menu > }
136
+ { showMenu && < Menu > </ Menu > }
136
137
</ div >
137
138
) ;
138
139
}
Original file line number Diff line number Diff line change
1
+ /* eslint-disable react/prop-types */
2
+ function CanvasColor ( props ) {
3
+ return (
4
+ < div className = "flex p-1 items-center justify-around mt-3" >
5
+ < h1 className = "font-sans text-lg antialiased font-semibold text-white" >
6
+ { props . name }
7
+ </ h1 >
8
+ < input
9
+ type = "color"
10
+ value = { props . defaultColor }
11
+ className = "p-1 h-10 w-10 block bg-white border border-gray-800 cursor-pointer rounded-lg disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700"
12
+ > </ input >
13
+ </ div >
14
+ ) ;
15
+ }
16
+
17
+ export default CanvasColor ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ /* eslint-disable react/prop-types */
2
+ function PenColor ( props ) {
3
+ return (
4
+ < div className = "flex p-1 items-center justify-around mt-3" >
5
+ < h1 className = "font-sans text-lg antialiased font-semibold text-white" >
6
+ { props . name }
7
+ </ h1 >
8
+ < input
9
+ type = "color"
10
+ value = { props . defaultColor }
11
+ className = "p-1 h-10 w-10 block bg-white border border-gray-800 cursor-pointer rounded-lg disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700"
12
+ > </ input >
13
+ </ div >
14
+ ) ;
15
+ }
16
+
17
+ export default PenColor ;
Original file line number Diff line number Diff line change 1
1
/* eslint-disable react/prop-types */
2
- import ColorPicker from "./ColorPicker" ;
3
2
import StrokeWidthPicker from "./StrokeWidthPicker" ;
4
3
import ClearBtn from "./ClearBtn" ;
5
4
import Eraser from "./Eraser" ;
5
+ import CanvasColor from "./CanvasColor" ;
6
+ import PenColor from "./PenColor" ;
6
7
7
8
function Toolbar ( props ) {
8
9
return (
9
10
< div className = "block w-full mt-20 align-center" >
10
- < ColorPicker name = "Colors :" defaultColor = "#000000" > </ ColorPicker >
11
- < ColorPicker name = "Canvas :" defaultColor = "#FFFFFF" > </ ColorPicker >
11
+ < PenColor addStroke = { props . addStroke } name = "Color :" > </ PenColor >
12
+ < CanvasColor name = "Canvas :" > </ CanvasColor >
12
13
< Eraser > </ Eraser >
13
- < StrokeWidthPicker addLineWidth = { props . addLineWidth } > </ StrokeWidthPicker >
14
+ < StrokeWidthPicker
15
+ addLineWidth = { props . addLineWidth }
16
+ > </ StrokeWidthPicker >
14
17
< ClearBtn clearOnClick = { props . clearOnClick } id = { props . id } > </ ClearBtn >
15
18
</ div >
16
19
) ;
You can’t perform that action at this time.
0 commit comments