@@ -5,6 +5,12 @@ var Link = ReactRouter.Link
55var ModalBase = require ( '../Components/ModalBase' )
66var LaunchModal = require ( '../Components/LaunchModal' )
77
8+ var currentUser = {
9+ name : 'testcat' ,
10+ email : 'testcat@example.com' ,
11+ profileName : 'Test Cat'
12+ }
13+
814var userPlanets = [
915 {
1016 id : 1 ,
@@ -25,34 +31,68 @@ var userPlanets = [
2531
2632var PlanetNavigator = React . createClass ( {
2733 propTypes : {
28- currentPlanet : React . PropTypes . object
34+ currentPlanet : React . PropTypes . object ,
35+ currentUser : React . PropTypes . object
2936 } ,
3037 render : function ( ) {
31- var planets = userPlanets . map ( function ( planet ) {
38+ var planets = userPlanets . map ( function ( planet , index ) {
3239 return (
33- < li key = { planet . id } className = { this . props . currentPlanet . name === planet . name ? 'active' : '' } > < a > { planet . profileName [ 0 ] } </ a > </ li >
40+ < li key = { planet . id } className = { this . props . currentPlanet . name === planet . name ? 'active' : '' } >
41+ < a > { planet . profileName [ 0 ] } </ a >
42+ < div className = 'shortCut' > ⌘{ index + 1 } </ div >
43+ </ li >
3444 )
3545 } . bind ( this ) )
3646
3747 return (
3848 < div className = 'PlanetNavigator' >
49+ < a className = 'userConfig' >
50+ < img width = '50' height = '50' src = '../vendor/dummy.jpg' />
51+ </ a >
3952 < ul >
4053 { planets }
4154 </ ul >
55+ < button className = 'newPlanet' > < i className = 'fa fa-plus' /> </ button >
56+ </ div >
57+ )
58+ }
59+ } )
60+
61+ var PlanetHeader = React . createClass ( {
62+ propTypes : {
63+ currentPlanet : React . PropTypes . object ,
64+ currentUser : React . PropTypes . object
65+ } ,
66+ render : function ( ) {
67+ var currentPlanetName = this . props . currentPlanet . name
68+
69+ return (
70+ < div className = 'PlanetHeader' >
71+ < span className = 'planetName' > { currentPlanetName } </ span >
72+ < button className = 'menuBtn' >
73+ < i className = 'fa fa-chevron-down' > </ i >
74+ </ button >
75+ < span className = 'searchInput' >
76+ < i className = 'fa fa-search' />
77+ < input type = 'text' className = 'inline-input circleInput' placeholder = 'Search...' />
78+ </ span >
79+ < a className = 'downloadBtn btn-primary' > Download Mac app</ a >
4280 </ div >
4381 )
4482 }
4583} )
4684
4785var PlanetMain = React . createClass ( {
4886 propTypes : {
49- currentPlanet : React . PropTypes . object
87+ currentPlanet : React . PropTypes . object ,
88+ currentUser : React . PropTypes . object
5089 } ,
5190 render : function ( ) {
5291 return (
5392 < div className = 'PlanetMain' >
54- < SideNavigator currentPlanet = { this . props . currentPlanet } />
55- < Screen currentPlanet = { this . props . currentPlanet } />
93+ < PlanetHeader currentPlanet = { this . props . currentPlanet } currentUser = { this . props . currentUser } />
94+ < SideNavigator currentPlanet = { this . props . currentPlanet } currentUser = { this . props . currentUser } />
95+ < PlanetBody currentPlanet = { this . props . currentPlanet } />
5696 </ div >
5797 )
5898 }
@@ -62,6 +102,9 @@ var SideNavigator = React.createClass({
62102 propTypes : {
63103 currentPlanet : React . PropTypes . shape ( {
64104 name : React . PropTypes . string
105+ } ) ,
106+ currentUser : React . PropTypes . shape ( {
107+ name : React . PropTypes . string
65108 } )
66109 } ,
67110 getInitialState : function ( ) {
@@ -82,29 +125,24 @@ var SideNavigator = React.createClass({
82125 } ,
83126 render : function ( ) {
84127 var currentPlanetName = this . props . currentPlanet . name
128+ var currentUserName = this . props . currentUser . name
85129
86130 return (
87131 < div className = 'SideNavigator' >
88- < div className = 'nav-header' >
89- < p className = 'planet-name' > { currentPlanetName } </ p >
90- < button className = 'menu-btn' >
91- < i className = 'fa fa-chevron-down' > </ i >
92- </ button >
93- </ div >
94132 < button onClick = { this . openLaunchModal } className = 'btn-primary btn-block' >
95133 < i className = 'fa fa-rocket fa-fw' /> Launch
96134 </ button >
97135 < ModalBase isOpen = { this . state . isLaunchModalOpen } close = { this . closeLaunchModal } >
98136 < LaunchModal submit = { this . submitLaunchModal } close = { this . closeLaunchModal } />
99137 </ ModalBase >
100138 < nav >
101- < Link to = 'dashboard' params = { { planetName : currentPlanetName } } >
139+ < Link to = 'dashboard' params = { { userName : currentUserName , planetName : currentPlanetName } } >
102140 < i className = 'fa fa-home fa-fw' /> Home
103141 </ Link >
104- < Link to = 'snippets' params = { { planetName : currentPlanetName } } >
142+ < Link to = 'snippets' params = { { userName : currentUserName , planetName : currentPlanetName } } >
105143 < i className = 'fa fa-code fa-fw' /> Snippets
106144 </ Link >
107- < Link to = 'blueprint' params = { { planetName : currentPlanetName } } >
145+ < Link to = 'blueprint' params = { { userName : currentUserName , planetName : currentPlanetName } } >
108146 < i className = 'fa fa-wrench fa-fw' /> Blueprints
109147 </ Link >
110148 </ nav >
@@ -113,10 +151,10 @@ var SideNavigator = React.createClass({
113151 }
114152} )
115153
116- var Screen = React . createClass ( {
154+ var PlanetBody = React . createClass ( {
117155 render : function ( ) {
118156 return (
119- < div className = 'Screen ' >
157+ < div className = 'PlanetBody ' >
120158 < RouteHandler />
121159 </ div >
122160 )
@@ -151,8 +189,8 @@ module.exports = React.createClass({
151189
152190 return (
153191 < div className = 'PlanetContainer' >
154- < PlanetNavigator currentPlanet = { currentPlanet } />
155- < PlanetMain currentPlanet = { currentPlanet } />
192+ < PlanetNavigator currentPlanet = { currentPlanet } currentUser = { currentUser } />
193+ < PlanetMain currentPlanet = { currentPlanet } currentUser = { currentUser } />
156194 </ div >
157195 )
158196 }
0 commit comments