diff --git a/src/components/pages/profile.jsx b/src/components/pages/profile.jsx index b02d975..89a20ed 100644 --- a/src/components/pages/profile.jsx +++ b/src/components/pages/profile.jsx @@ -46,11 +46,22 @@ class Profile extends React.Component { //main panel let MainPanel; - if (this.state.username === this.props.username && this.state.username !== '') { - MainPanel = this.MyProfileMainPanel.bind(this); + if (this.props.id) { + //logged in + if (this.state.username === this.props.username) { + MainPanel = this.MyProfileMainPanel.bind(this); + } else { + //not logged in + if (this.state.username !== '') { + MainPanel = this.NotMyProfileMainPanel.bind(this); + } else { + MainPanel = this.ProfileNotFoundMainPanel.bind(this); + } + } } else { + //not logged in if (this.state.username !== '') { - MainPanel = this.NotMyProfileMainPanel.bind(this); + MainPanel = this.LoggedOutMainPanel.bind(this); } else { MainPanel = this.ProfileNotFoundMainPanel.bind(this); } @@ -242,10 +253,58 @@ class Profile extends React.Component { ); } + LoggedOutMainPanel() { + return ( +
Username:
+{this.state.username}
+ + +Gold:
+{this.state.gold}
+ + +Recruits:
+{this.state.recruits}
+ + +Soldiers:
+{this.state.soldiers}
+ + +Spies:
+{this.state.spies}
+ + +Scientists:
+{this.state.scientists}
+ + +No profile found!
+No profile found!