File tree Expand file tree Collapse file tree 8 files changed +44
-104
lines changed Expand file tree Collapse file tree 8 files changed +44
-104
lines changed Original file line number Diff line number Diff line change 1
- .App {
2
- text-align : center;
3
- }
4
-
5
- .App-logo {
6
- animation : App-logo-spin infinite 20s linear;
7
- height : 80px ;
8
- }
9
-
10
- .App-header {
11
- background-color : # 222 ;
12
- height : 150px ;
13
- padding : 20px ;
14
- color : white;
15
- }
16
-
17
- .App-title {
18
- font-size : 1.5em ;
19
- }
20
-
21
- .App-intro {
22
- font-size : large;
23
- }
24
-
25
- @keyframes App-logo-spin {
26
- from { transform : rotate (0deg ); }
27
- to { transform : rotate (360deg ); }
1
+ .top-toolbar {
2
+ padding : 4px 8px ;
3
+ background : # e8e8e8 ;
28
4
}
Original file line number Diff line number Diff line change @@ -5,15 +5,16 @@ class App extends Component {
5
5
return (
6
6
< div >
7
7
< div className = "top-toolbar" >
8
- < button onClick = { this . onAddUser } > Add User</ button >
8
+ < button onClick = { this . handleAddUser } > Add User</ button >
9
9
</ div >
10
10
</ div >
11
11
) ;
12
12
}
13
- onAddUser = ( ) => {
13
+ handleAddUser = ( ) => {
14
14
// handle button click
15
- alert ( 'add user' ) ;
15
+ console . log ( 'add user' ) ;
16
16
}
17
17
}
18
+
18
19
export default App ;
19
20
Original file line number Diff line number Diff line change 1
- .App {
2
- text-align : center;
3
- }
4
-
5
- .App-logo {
6
- animation : App-logo-spin infinite 20s linear;
7
- height : 80px ;
8
- }
9
-
10
- .App-header {
11
- background-color : # 222 ;
12
- height : 150px ;
13
- padding : 20px ;
14
- color : white;
15
- }
16
-
17
- .App-title {
18
- font-size : 1.5em ;
19
- }
20
-
21
- .App-intro {
22
- font-size : large;
23
- }
24
-
25
- @keyframes App-logo-spin {
26
- from { transform : rotate (0deg ); }
27
- to { transform : rotate (360deg ); }
28
- }
1
+ .top-toolbar {
2
+ padding : 4px 8px ;
3
+ background : # e8e8e8 ;
4
+ }
Original file line number Diff line number Diff line change 1
1
import React , { Component } from 'react' ;
2
- import FontAwesome from '@fortawesome/react-fontawesome'
3
- import { faUserPlus } from '@fortawesome/fontawesome-free-solid'
2
+ import FontAwesome from '@fortawesome/react-fontawesome' ;
3
+ import { faUserPlus } from '@fortawesome/fontawesome-free-solid' ;
4
+
4
5
class App extends Component {
5
6
render ( ) {
6
7
const style = {
7
8
marginRight : '12px' // inline style example
8
9
} ;
10
+
9
11
return (
10
12
< div >
11
13
< div className = "top-toolbar" >
12
- < button onClick = { this . onAddUser } >
14
+ < button onClick = { this . handleAddUser } >
13
15
< FontAwesome icon = { faUserPlus } style = { style } />
14
16
Add User
15
17
</ button >
16
18
</ div >
17
19
</ div >
18
20
) ;
19
21
}
20
- onAddUser = ( ) => {
22
+ handleAddUser = ( ) => {
21
23
// handle button click
22
- alert ( 'add user' ) ;
24
+ console . log ( 'add user' ) ;
23
25
}
24
26
}
27
+
25
28
export default App ;
26
29
Original file line number Diff line number Diff line change 20
20
Learn how to configure a non-root public URL by running `npm run build`.
21
21
-->
22
22
< title > React App</ title >
23
- < link rel ="stylesheet " type ="text/css " href ="//cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.12/semantic.min.css ">
24
- < link rel ="stylesheet " type ="text/css " href ="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css ">
25
-
26
23
</ head >
27
24
< body >
28
25
< noscript >
Original file line number Diff line number Diff line change 1
- .App {
2
- text-align : center;
3
- }
4
-
5
- .App-logo {
6
- animation : App-logo-spin infinite 20s linear;
7
- height : 80px ;
8
- }
9
-
10
- .App-header {
11
- background-color : # 222 ;
12
- height : 150px ;
13
- padding : 20px ;
14
- color : white;
15
- }
16
-
17
- .App-title {
18
- font-size : 1.5em ;
19
- }
20
-
21
- .App-intro {
22
- font-size : large;
23
- }
24
-
25
- @keyframes App-logo-spin {
26
- from { transform : rotate (0deg ); }
27
- to { transform : rotate (360deg ); }
1
+ .top-toolbar {
2
+ padding : 8px 12px ;
3
+ background : # 3d76b5 ;
28
4
}
Original file line number Diff line number Diff line change 1
1
import React , { Component } from 'react' ;
2
2
import { Dropdown } from 'semantic-ui-react' ;
3
+ import 'semantic-ui-css/semantic.min.css' ;
4
+
3
5
const { Divider, Item, Menu } = Dropdown ;
4
- class Main extends Component {
6
+
7
+ class App extends Component {
5
8
render ( ) {
6
9
return (
7
10
< div >
8
11
< div className = "top-toolbar" >
9
- < Dropdown text = "Add User" icon = "add user" floating labeled button className = "icon" >
12
+ < Dropdown
13
+ text = "User Controls"
14
+ icon = "add user"
15
+ className = "icon"
16
+ floating labeled button
17
+ >
10
18
< Menu >
11
- < Item onClick = { this . onFindUser } > Find User</ Item >
19
+ < Item onClick = { this . handleAddUser } > Add User</ Item >
12
20
< Divider />
13
- < Item onClick = { this . doSomething } > Do Something </ Item >
21
+ < Item onClick = { this . handleRemoveUser } > Remove User </ Item >
14
22
</ Menu >
15
23
</ Dropdown >
16
24
</ div >
17
25
</ div >
18
26
) ;
19
27
}
20
- onFindUser = ( ) => {
28
+
29
+ handleAddUser = ( ) => {
21
30
// handle menu item click
22
- alert ( 'find user') ;
31
+ console . log ( 'add user')
23
32
}
24
- doSomething = ( ) => {
33
+ handleRemoveUser = ( ) => {
25
34
// handle menu item click
26
- alert ( 'do something ') ;
35
+ console . log ( 'remove user ') ;
27
36
}
28
37
}
29
- export default Main ;
38
+
39
+ export default App ;
30
40
Original file line number Diff line number Diff line change 1
1
import React , { Component } from 'react'
2
2
3
- class SegmentedBtn extends Component {
3
+ class SegmentedButton extends Component {
4
4
static defaultProps = {
5
5
pressed : [ ] ,
6
6
allowDepress : false
@@ -63,4 +63,5 @@ class SegmentedBtn extends Component {
63
63
}
64
64
}
65
65
}
66
- export default SegmentedBtn ;
66
+
67
+ export default SegmentedButton ;
You can’t perform that action at this time.
0 commit comments