@@ -74,7 +74,7 @@ class ProfileScreen extends Component {
7474 backgroundSpeed = { 10 }
7575 renderBackground = { ( ) => (
7676 < View key = "background" >
77- < Image source = { { uri : this . props . data . avatarUrl || 'https://pbs.twimg.com/profile_images/2694242404/5b0619220a92d391534b0cd89bf5adc1_400x400.jpeg' } } style = { style . tableHeaderBackgroundImage } />
77+ < Image source = { { uri : this . data . avatarUrl || 'https://pbs.twimg.com/profile_images/2694242404/5b0619220a92d391534b0cd89bf5adc1_400x400.jpeg' } } style = { style . tableHeaderBackgroundImage } />
7878 < View style = { style . tableHeaderBackgroundOverlay } />
7979 </ View >
8080 ) }
@@ -83,10 +83,10 @@ class ProfileScreen extends Component {
8383 < View key = "parallax-header" style = { style . parallaxHeader } >
8484 < Image style = { style . avatar } source = { { uri : 'https://pbs.twimg.com/profile_images/2694242404/5b0619220a92d391534b0cd89bf5adc1_400x400.jpeg' } } />
8585 < Text style = { style . sectionSpeakerText } >
86- { this . props . data . department . name }
86+ { this . data . department . name || '' }
8787 </ Text >
8888 < Text style = { style . sectionTitleText } >
89- { this . props . data . department . name }
89+ { this . data . department . name || '' }
9090 </ Text >
9191 </ View >
9292 ) }
@@ -99,7 +99,7 @@ class ProfileScreen extends Component {
9999 switch ( index ) {
100100 case PHONE_NUMBER : return this . _renderPhoneCell ( ) ;
101101 case ADDRESS : return this . _renderTextCell ( 'Address' , '' ) ;
102- case EMAIL : return this . _renderTextCell ( 'Email' , this . props . data . username ) ;
102+ case EMAIL : return this . _renderTextCell ( 'Email' , this . data . username || '' ) ;
103103 case DEPARTMENT : return this . _renderTextCell ( 'Department' , '' ) ;
104104 case DOB : return this . _renderTextCell ( 'Dob' , '' ) ;
105105 case SKYPE : return this . _renderTextCell ( 'Skype ID' , '' ) ;
@@ -111,7 +111,7 @@ class ProfileScreen extends Component {
111111 return (
112112 < View style = { style . phoneCell } >
113113 < View style = { style . nameTextContainer } >
114- < Text style = { style . titleText } > { this . props . data . firstName } { this . props . data . lastName } </ Text >
114+ < Text style = { style . titleText } > { this . data . firstName || '' } { this . data . lastName || '' } </ Text >
115115 </ View >
116116 < View style = { style . phoneMessageContainer } >
117117 < TouchableOpacity style = { style . phoneButton } onPress = { ( ) => Communications . phonecall ( '0123456789' , true ) } >
@@ -216,7 +216,8 @@ class ProfileScreen extends Component {
216216 }
217217
218218 render ( ) {
219- if ( this . props . me ) {
219+ this . data = this . props . data . fromProfileTab ? this . props . me : this . props . data . profile
220+ if ( this . data ) {
220221 return this . _renderProfileScreen ( )
221222 } else {
222223 return this . _renderActivityIndicator ( )
0 commit comments