44 Text ,
55 Image ,
66 FlatList ,
7+ LayoutAnimation ,
78 TouchableOpacity ,
89 ActivityIndicator ,
910 } from 'react-native' ;
@@ -27,8 +28,8 @@ import style, { AVATAR_SIZE, STICKY_HEADER_HEIGHT, DOT_MARGIN, PARALLAX_HEADER_H
2728const PHONE_NUMBER = 0
2829const ADDRESS = 1
2930const EMAIL = 2
30- const DEPARTMENT = 3
31- const DOB = 4
31+ const DOB = 3
32+ const GITHUB = 4
3233const SKYPE = 5
3334
3435const CANCEL_INDEX = 0
@@ -40,6 +41,10 @@ class ProfileScreen extends Component {
4041 super ( props ) ;
4142 }
4243
44+ componentDidMount ( ) {
45+ LayoutAnimation . configureNext ( LayoutAnimation . Presets . spring ) ;
46+ }
47+
4348 _logout = ( ) => {
4449 // TODO: Clear all data
4550 this . props . logout ( ) ;
@@ -83,10 +88,10 @@ class ProfileScreen extends Component {
8388 < View key = "parallax-header" style = { style . parallaxHeader } >
8489 < Image style = { style . avatar } source = { { uri : 'https://pbs.twimg.com/profile_images/2694242404/5b0619220a92d391534b0cd89bf5adc1_400x400.jpeg' } } />
8590 < Text style = { style . sectionSpeakerText } >
86- { this . data . department . name || '' }
91+ { this . data . firstName } { this . data . lastName }
8792 </ Text >
8893 < Text style = { style . sectionTitleText } >
89- { this . data . department . name || '' }
94+ { this . data . department . name }
9095 </ Text >
9196 </ View >
9297 ) }
@@ -98,38 +103,41 @@ class ProfileScreen extends Component {
98103 _renderItems = ( item , index ) => {
99104 switch ( index ) {
100105 case PHONE_NUMBER : return this . _renderPhoneCell ( ) ;
101- case ADDRESS : return this . _renderTextCell ( 'Address' , ' ') ;
102- case EMAIL : return this . _renderTextCell ( 'Email ' , this . data . username || '' ) ;
103- case DEPARTMENT : return this . _renderTextCell ( 'Department ' , ' ') ;
104- case DOB : return this . _renderTextCell ( 'Dob ' , ' ') ;
105- case SKYPE : return this . _renderTextCell ( 'Skype ID' , ' ') ;
106+ case ADDRESS : return this . _renderTextCell ( 'Address' , this . data . address . temporaryAddress || '- ') ;
107+ case EMAIL : return this . _renderTextCell ( 'E-mail ' , this . data . username || '- ' ) ;
108+ case DOB : return this . _renderTextCell ( 'DOB ' , this . data . dateofBirth || '- ') ;
109+ case GITHUB : return this . _renderTextCell ( 'Github ID ' , this . data . contact . githubId || '- ') ;
110+ case SKYPE : return this . _renderTextCell ( 'Skype ID' , this . data . contact . skypeId || '- ') ;
106111 case LOGOUT : return this . _renderLougoutCell ( ) ;
107112 }
108113 }
109114
110115 _renderPhoneCell = ( ) => {
111116 return (
112- < View style = { style . phoneCell } >
113- < View style = { style . nameTextContainer } >
114- < Text style = { style . titleText } > { this . data . firstName || '' } { this . data . lastName || '' } </ Text >
115- </ View >
116- < View style = { style . phoneMessageContainer } >
117- < TouchableOpacity style = { style . phoneButton } onPress = { ( ) => Communications . phonecall ( '0123456789' , true ) } >
118- < Image source = { callImage } style = { style . phoneAndMessageButtonImage } />
119- </ TouchableOpacity >
120- < TouchableOpacity style = { style . messageButton } onPress = { ( ) => Communications . text ( '0123456789' ) } >
121- < Image source = { messageImage } style = { style . phoneAndMessageButtonImage } />
122- </ TouchableOpacity >
117+ < View style = { [ style . phoneCell , style . cell ] } >
118+ < View style = { style . numberTextContainer } >
119+ < Text style = { style . dataText } > { this . data . contact . mobilePhone } </ Text >
120+ < Text style = { style . titleText } > Phone Number</ Text >
123121 </ View >
122+ { ! this . props . data . fromProfileTab &&
123+ < View style = { style . phoneMessageContainer } >
124+ < TouchableOpacity style = { style . phoneButton } onPress = { ( ) => Communications . phonecall ( this . data . contact . mobilePhone , true ) } >
125+ < Image source = { callImage } style = { style . phoneAndMessageButtonImage } />
126+ </ TouchableOpacity >
127+ < TouchableOpacity style = { style . messageButton } onPress = { ( ) => Communications . text ( this . data . contact . mobilePhone ) } >
128+ < Image source = { messageImage } style = { style . phoneAndMessageButtonImage } />
129+ </ TouchableOpacity >
130+ </ View >
131+ }
124132 </ View >
125133 ) ;
126134 }
127135
128136 _renderTextCell = ( text , data ) => {
129137 return (
130- < View style = { style . simpleTextCell } >
131- < Text style = { style . titleText } > { text } </ Text >
138+ < View style = { [ style . simpleTextCell , style . cell ] } >
132139 < Text style = { style . dataText } > { data } </ Text >
140+ < Text style = { style . titleText } > { text } </ Text >
133141 </ View >
134142 ) ;
135143 }
0 commit comments