File tree 3 files changed +10
-9
lines changed
firstapp/src/Components/Cockpit
3 files changed +10
-9
lines changed Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
import styles from './Cockpit.module.css' ;
3
+ import Aux from '../../hoc/Aux' ;
3
4
const cockpit = ( props ) => {
4
5
5
6
const assignedClasses = [ ] ;
6
- let btnClass = '' ;
7
+ let btnClass = styles . Button ;
7
8
if ( props . showPersons ) {
8
9
9
- btnClass = styles . Button ;
10
+
10
11
console . log ( 'btnclass' , btnClass ) ;
11
12
if ( props . showPersons ) {
12
13
@@ -25,14 +26,14 @@ const cockpit = (props) => {
25
26
}
26
27
27
28
return (
28
- < div >
29
+ < Aux >
29
30
< h1 > tekstiä</ h1 >
30
31
< p className = { assignedClasses . join ( ' ' ) } > lisää tekstiä</ p >
31
32
32
33
< button
33
34
className = { btnClass }
34
- onClick = { props . clicked } > Toggle Persons</ button >
35
- </ div >
35
+ onClick = { props . clicked } > Toggle Persons </ button >
36
+ </ Aux >
36
37
)
37
38
} ;
38
39
export default cockpit ;
Original file line number Diff line number Diff line change 7
7
font-weight : bold;
8
8
}
9
9
10
- .Button button {
10
+ .Button {
11
11
border : 1px solid blue;
12
12
padding : 16px ;
13
13
background-color : green;
16
16
cursor : pointer;
17
17
}
18
18
19
- .Button button : hover {
19
+ .Button : hover {
20
20
background-color : lightgreen;
21
21
color : black;
22
22
}
23
23
24
- .Button button .Red {
24
+ .Button .Red {
25
25
background-color : red;
26
26
}
27
27
28
- .Button button .Red : hover {
28
+ .Button .Red : hover {
29
29
background-color : salmon;
30
30
color : black;
31
31
}
You can’t perform that action at this time.
0 commit comments