File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ export default class Dropdown extends Component {
24
24
"aria-haspopup" : "true" ,
25
25
"aria-expanded" : "false" ,
26
26
} }
27
- > Hello, TBrayner < i className = "dropdown-icon zmdi zmdi-caret-down" /> </ Button >
27
+ > { this . props . children } </ Button >
28
28
29
29
< div className = { `dropdown-menu ${ styles [ 'dropdown-menu' ] } ${ styles . menu } ` } aria-labelledby = "dropdownMenuButton" >
30
30
< i className = { `${ styles [ 'icon-caret' ] } zmdi zmdi-caret-up` } > </ i >
Original file line number Diff line number Diff line change @@ -11,6 +11,13 @@ import styles from 'components/back4App/Header/Header.scss';
11
11
import navData from 'components/back4App/Header/headerNavData' ;
12
12
13
13
export default class Header extends React . Component {
14
+ constructor ( props ) {
15
+ super ( props ) ;
16
+
17
+ this . state = {
18
+ username : null
19
+ } ;
20
+ }
14
21
componentWillMount ( ) {
15
22
/*
16
23
- Thi-s resource should be implemented following parse-dashboard community standards (using flux).
@@ -21,8 +28,14 @@ export default class Header extends React.Component {
21
28
method : 'GET' ,
22
29
credentials : 'include'
23
30
} )
31
+ . then ( response => response . json ( ) )
24
32
. then ( response => {
25
- console . log ( response . json ( ) ) ;
33
+ this . setState ( {
34
+ username : response . username . split ( '@' ) [ 0 ]
35
+ } ) ;
36
+ } )
37
+ . catch ( error => {
38
+ console . log ( "Error" , error ) ;
26
39
} ) ;
27
40
}
28
41
render ( ) {
@@ -54,7 +67,7 @@ export default class Header extends React.Component {
54
67
55
68
< Media query = "(min-width: 1100px)" >
56
69
< div className = "ml-auto" >
57
- < Dropdown items = { navData . dropdownItems } > Hello, TBrayner! < i className = "dropdown-icon zmdi zmdi-caret-down" > </ i > </ Dropdown >
70
+ < Dropdown items = { navData . dropdownItems } > { this . state . username && ` Hello, ${ this . state . username } ` } < i className = "dropdown-icon zmdi zmdi-caret-down" > </ i > </ Dropdown >
58
71
< Button color = "green" weight = "700" url = "https://dashboard.back4app.com/apps/#!/apps/new" > NEW APP</ Button >
59
72
</ div >
60
73
</ Media >
You can’t perform that action at this time.
0 commit comments