From 01a40500591539c75aaa5070354725efee5e0809 Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Tue, 22 Sep 2015 18:25:09 -0700 Subject: [PATCH] Add higlight, company name --- common/app/routes/Jobs/components/NewJob.jsx | 86 ++++++++++++++++---- 1 file changed, 72 insertions(+), 14 deletions(-) diff --git a/common/app/routes/Jobs/components/NewJob.jsx b/common/app/routes/Jobs/components/NewJob.jsx index fd5e2aafa9..f76113959c 100644 --- a/common/app/routes/Jobs/components/NewJob.jsx +++ b/common/app/routes/Jobs/components/NewJob.jsx @@ -18,24 +18,26 @@ const defaults = { value: '', valid: false, pristine: true + }, + bool: { + value: false } }; -function defaultValue(type) { - return defaults[type]; -} - export default contain({ actions: 'jobActions', store: 'jobsStore', map({ form = {} }) { const { - position = defaultValue('string'), - locale = defaultValue('string'), - description = defaultValue('string'), - email = defaultValue('string'), - phone = defaultValue('string'), - url = defaultValue('string') + position = defaults['string'], + locale = defaults['string'], + description = defaults['string'], + email = defaults['string'], + phone = defaults['string'], + url = defaults['string'], + logo = defaults['string'], + name = defaults['string'], + highlight = defaults['bool'] } = form; return { position, @@ -43,7 +45,10 @@ export default contain({ description, email, phone, - url + url, + logo, + name, + highlight }; } }, @@ -57,7 +62,10 @@ export default contain({ description: PropTypes.object, email: PropTypes.object, phone: PropTypes.object, - url: PropTypes.object + url: PropTypes.object, + logo: PropTypes.object, + name: PropTypes.object, + highlight: PropTypes.object }, handleChange(name, validator, { target: { value } }) { @@ -72,7 +80,10 @@ export default contain({ description, email, phone, - url + url, + logo, + name, + highlight } = this.props; const labelClass = 'col-sm-offset-1 col-sm-2'; const inputClass = 'col-sm-6'; @@ -134,9 +145,25 @@ export default contain({ type='textarea' value={ description.value } wrapperClassName={ inputClass } /> +

Company Information

+ { + this.handleChange( + 'name', + isAscii, + e, + ); + }} + placeholder='Foo, INC' + type='text' + value={ name.value } + wrapperClassName={ inputClass } /> { this.handleChange( @@ -182,6 +209,37 @@ export default contain({ type='url' value={ url.value } wrapperClassName={ inputClass } /> + { + this.handleChange( + 'logo', + (data) => isURL(data, { 'require_protocol': true }), + e + ); + }} + placeholder='http://freecatphotoapp.com/logo.png' + type='url' + value={ logo.value } + wrapperClassName={ inputClass } /> + +
+

Make it stand out

+
+ { + this.handleChange( + 'highlight', + () => { return true; }, + e + ); + }} + type='checkbox' + value={ highlight.value } />