@@ -14,7 +14,8 @@ class EditProfile extends Component {
1414 location : '' ,
1515 github : '' ,
1616 fb : '' ,
17- linkedIn : '' ,
17+ linkedin : '' ,
18+ twitter : '' ,
1819 designation : '' ,
1920 website : '' ,
2021 longDesc : '' ,
@@ -29,7 +30,18 @@ class EditProfile extends Component {
2930
3031 onSave = ( e ) => {
3132 e . preventDefault ( ) ;
32- const { firstName, lastName, designation, location, website, shortDesc, longDesc } = this . state
33+ const {
34+ firstName,
35+ lastName,
36+ designation,
37+ location,
38+ website,
39+ shortDesc,
40+ longDesc,
41+ github,
42+ linkedin,
43+ twitter
44+ } = this . state
3345 const info = {
3446 name : {
3547 firstName,
@@ -43,6 +55,11 @@ class EditProfile extends Component {
4355 location,
4456 website
4557 }
58+ } ,
59+ socialMedia : {
60+ github,
61+ linkedin,
62+ twitter
4663 }
4764 }
4865 console . log ( 'Updating data!' , this . state )
@@ -54,6 +71,7 @@ class EditProfile extends Component {
5471 const { userProfile } = nextProps . user
5572 const permissions = nextProps ?. org ?. org ?. options ?. permissions
5673 const about = userProfile ?. info ?. about
74+ const { socialMedia } = userProfile
5775 this . setState ( {
5876 firstName : userProfile ?. name ?. firstName ,
5977 lastName : userProfile ?. name ?. lastName ,
@@ -63,7 +81,10 @@ class EditProfile extends Component {
6381 shortDesc : about ?. shortDescription ,
6482 location : about ?. location ,
6583 // canChangeEmail: permissions?.canChangeEmail,
66- canChangeName : permissions ?. canChangeName
84+ canChangeName : permissions ?. canChangeName ,
85+ github : socialMedia ?. github ,
86+ twitter : socialMedia ?. twitter ,
87+ linkedin : socialMedia ?. linkedin
6788 } , ( ) => {
6889 console . log ( 'updated state ' , this . state )
6990 } )
@@ -79,8 +100,10 @@ class EditProfile extends Component {
79100 designation,
80101 website,
81102 longDesc,
82- canChangeName
83- // canChangeEmail
103+ canChangeName,
104+ // canChangeEmail,
105+ github,
106+ linkedin,
84107 } = this . state
85108 return (
86109 < Modal onHide = { onHide } show = { show } className = "modal" >
@@ -191,7 +214,7 @@ class EditProfile extends Component {
191214 </ Form . Group >
192215 </ Form . Row >
193216 < div className = "modal__secondary-title" > PROFILE</ div >
194- { /* <Form.Row className="modal__row">
217+ < Form . Row className = "modal__row" >
195218 < Form . Group
196219 as = { Col }
197220 controlId = "formGridGithub"
@@ -216,12 +239,12 @@ class EditProfile extends Component {
216239 < Form . Control
217240 type = "text"
218241 placeholder = "LinkedIn URL"
219- defaultValue={linkedIn }
242+ defaultValue = { linkedin }
220243 name = "linkedIn"
221244 onChange = { this . onChange }
222245 />
223246 </ Form . Group >
224- </Form.Row> */ }
247+ </ Form . Row >
225248 < Form . Row className = "modal__row" >
226249 < Form . Group
227250 as = { Col }
0 commit comments