@@ -11,10 +11,12 @@ const TCFormFields = FormsyForm.Fields
1111const Formsy = FormsyForm . Formsy
1212import ProfileSettingsAvatar from './ProfileSettingsAvatar'
1313import FormsySelect from '../../../../../components/Select/FormsySelect'
14+ import FormsyBtnGroup from '../../../../../components/BtnGroup/FormsyBtnGroup'
1415import ISOCountries from '../../../../../helpers/ISOCountries'
1516import { formatPhone } from '../../../../../helpers/utils'
1617import { hasPermission } from '../../../../../helpers/permissions'
1718import PERMISSIONS from '../../../../../config/permissions'
19+ import { TOPCODER_CONNECT_TERMS_URL } from '../../../../../config/constants'
1820import './ProfileSettingsForm.scss'
1921
2022const countries = _ . orderBy ( ISOCountries , [ 'name' ] , [ 'asc' ] ) . map ( ( country ) => ( {
@@ -382,8 +384,36 @@ class ProfileSettingsForm extends Component {
382384 </ div >
383385 </ div >
384386 ) }
387+ { ! _ . isUndefined ( fieldsConfig . termsAccepted ) && (
388+ < div className = "field" >
389+ < div className = "label" >
390+ < a styleName = "fieldLabelText" href = { TOPCODER_CONNECT_TERMS_URL } target = "_blank" > Topcoder Terms</ a >
391+ { fieldsConfig . termsAccepted && < sup styleName = "requiredMarker" > *</ sup > }
392+ </ div >
393+ < div className = "input-field" >
394+ < div styleName = "terms-field" >
395+ { _ . isNil ( this . props . values . settings . termsAccepted ) ? (
396+ < FormsyBtnGroup
397+ name = "termsAccepted"
398+ items = { [
399+ { value : true , text : 'Accept' } ,
400+ { value : false , text : 'Reject' }
401+ ] }
402+ validations = { {
403+ isRequired : fieldsConfig . timeZone
404+ } }
405+ validationErrors = { {
406+ isRequired : 'Please accept or decline Topcoder Terms'
407+ } }
408+ />
409+ ) : (
410+ < span > { this . props . values . settings . termsAccepted ? 'Accepted' : 'Rejected' } </ span >
411+ ) }
412+ </ div >
413+ </ div >
414+ </ div >
415+ ) }
385416 < div className = "controls" >
386-
387417 { showBackButton && (
388418 < button
389419 className = { `tc-btn tc-btn-default btn-back ${ buttonExtraClassName } ` }
0 commit comments