File tree Expand file tree Collapse file tree 3 files changed +5
-1
lines changed Expand file tree Collapse file tree 3 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ function App() {
107
107
}
108
108
109
109
function addStroke ( e ) {
110
- if ( e . target . id === "stroke " ) {
110
+ if ( e . target . id === "penColor " ) {
111
111
const newColor = e . target . value ;
112
112
color = newColor ;
113
113
ctx . strokeStyle = newColor ;
@@ -126,6 +126,7 @@ function App() {
126
126
< div id = "container" >
127
127
< Sidebar
128
128
addStroke = { addStroke }
129
+
129
130
addLineWidth = { addLineWidth }
130
131
clearOnClick = { clearOnClick }
131
132
ref = { sidebarRef }
Original file line number Diff line number Diff line change @@ -6,7 +6,9 @@ function PenColor(props) {
6
6
{ props . name }
7
7
</ h1 >
8
8
< input
9
+ id = "penColor"
9
10
type = "color"
11
+ onChange = { props . addStroke }
10
12
value = { props . defaultColor }
11
13
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
14
> </ input >
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ function Sidebar(props){
14
14
clearOnClick = { props . clearOnClick }
15
15
id = { props . id }
16
16
addLineWidth = { props . addLineWidth }
17
+ addStroke = { props . addStroke }
17
18
> </ Toolbar >
18
19
< LoginAndLogout > </ LoginAndLogout >
19
20
</ div >
You can’t perform that action at this time.
0 commit comments