add company URL
This commit is contained in:
@ -9,7 +9,8 @@ import {
|
|||||||
import {
|
import {
|
||||||
isAscii,
|
isAscii,
|
||||||
isEmail,
|
isEmail,
|
||||||
isMobilePhone
|
isMobilePhone,
|
||||||
|
isURL
|
||||||
} from 'validator';
|
} from 'validator';
|
||||||
|
|
||||||
const defaults = {
|
const defaults = {
|
||||||
@ -33,14 +34,16 @@ export default contain({
|
|||||||
locale = defaultValue('string'),
|
locale = defaultValue('string'),
|
||||||
description = defaultValue('string'),
|
description = defaultValue('string'),
|
||||||
email = defaultValue('string'),
|
email = defaultValue('string'),
|
||||||
phone = defaultValue('string')
|
phone = defaultValue('string'),
|
||||||
|
url = defaultValue('string')
|
||||||
} = form;
|
} = form;
|
||||||
return {
|
return {
|
||||||
position,
|
position,
|
||||||
locale,
|
locale,
|
||||||
description,
|
description,
|
||||||
email,
|
email,
|
||||||
phone
|
phone,
|
||||||
|
url
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -53,7 +56,8 @@ export default contain({
|
|||||||
locale: PropTypes.object,
|
locale: PropTypes.object,
|
||||||
description: PropTypes.object,
|
description: PropTypes.object,
|
||||||
email: PropTypes.object,
|
email: PropTypes.object,
|
||||||
phone: PropTypes.object
|
phone: PropTypes.object,
|
||||||
|
url: PropTypes.object
|
||||||
},
|
},
|
||||||
|
|
||||||
handleChange(name, validator, { target: { value } }) {
|
handleChange(name, validator, { target: { value } }) {
|
||||||
@ -67,7 +71,8 @@ export default contain({
|
|||||||
locale,
|
locale,
|
||||||
description,
|
description,
|
||||||
email,
|
email,
|
||||||
phone
|
phone,
|
||||||
|
url
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const labelClass = 'col-sm-offset-1 col-sm-2';
|
const labelClass = 'col-sm-offset-1 col-sm-2';
|
||||||
const inputClass = 'col-sm-6';
|
const inputClass = 'col-sm-6';
|
||||||
@ -162,6 +167,21 @@ export default contain({
|
|||||||
type='tel'
|
type='tel'
|
||||||
value={ phone.value }
|
value={ phone.value }
|
||||||
wrapperClassName={ inputClass } />
|
wrapperClassName={ inputClass } />
|
||||||
|
<Input
|
||||||
|
bsStyle={ url.bsStyle }
|
||||||
|
label='Phone'
|
||||||
|
labelClassName={ labelClass }
|
||||||
|
onChange={ (e) => {
|
||||||
|
this.handleChange(
|
||||||
|
'url',
|
||||||
|
(data) => isURL(data, { 'require_protocol': true }),
|
||||||
|
e
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
placeholder='http://freecatphotoapp.com'
|
||||||
|
type='url'
|
||||||
|
value={ url.value }
|
||||||
|
wrapperClassName={ inputClass } />
|
||||||
</Row>
|
</Row>
|
||||||
</form>
|
</form>
|
||||||
</Well>
|
</Well>
|
||||||
|
Reference in New Issue
Block a user