diff options
author | Tayane Fernandes <tayane.rmf@gmail.com> | 2017-03-13 14:04:59 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-13 14:04:59 -0300 |
commit | ed15fdb62afb97af406fe35cc17da5d3790b7bd4 (patch) | |
tree | 34dad5108dce0b96d940792a98cb572646e5db35 /web-ui/src/common | |
parent | 67d7d84fea07d64800a2b04a379aaa2a103b4a39 (diff) | |
parent | 471b58e945613956db951b3a7b87c9c528b152a4 (diff) |
Merge pull request #1006 from pixelated/validate-email
Email validation on the backup account page
Diffstat (limited to 'web-ui/src/common')
4 files changed, 37 insertions, 11 deletions
diff --git a/web-ui/src/common/input_field/input_field.js b/web-ui/src/common/input_field/input_field.js index 438241e1..f50fc2b1 100644 --- a/web-ui/src/common/input_field/input_field.js +++ b/web-ui/src/common/input_field/input_field.js @@ -28,6 +28,7 @@ const InputField = ({ label, name, type = 'text', ...other }) => ( name={name} type={type} fullWidth + floatingLabelFocusStyle={{ color: '#178ca6' }} {...other} /> </div> diff --git a/web-ui/src/common/submit_button/submit_button.js b/web-ui/src/common/submit_button/submit_button.js index 4754e042..1224c7bd 100644 --- a/web-ui/src/common/submit_button/submit_button.js +++ b/web-ui/src/common/submit_button/submit_button.js @@ -16,15 +16,42 @@ */ import React from 'react'; +import RaisedButton from 'material-ui/RaisedButton'; import './submit_button.scss'; -const SubmitButton = ({ buttonText }) => ( - <input type='submit' className='submit-button' value={buttonText} /> +const labelStyle = { + textTransform: 'none', + fontSize: '1em', + lineHeight: '48px' +}; + +const buttonStyle = { + height: '48px' +}; + +const SubmitButton = ({ buttonText, disabled = false }) => ( + <div className='submit-button'> + <RaisedButton + type='submit' + label={buttonText} + disabled={disabled} + labelStyle={labelStyle} + buttonStyle={buttonStyle} + overlayStyle={buttonStyle} + fullWidth + primary + /> + </div> ); SubmitButton.propTypes = { - buttonText: React.PropTypes.string.isRequired + buttonText: React.PropTypes.string.isRequired, + disabled: React.PropTypes.bool +}; + +SubmitButton.defaultProps = { + disabled: false }; export default SubmitButton; diff --git a/web-ui/src/common/submit_button/submit_button.scss b/web-ui/src/common/submit_button/submit_button.scss index 13cb7607..851899f7 100644 --- a/web-ui/src/common/submit_button/submit_button.scss +++ b/web-ui/src/common/submit_button/submit_button.scss @@ -18,15 +18,9 @@ @import "~scss/base/colors"; .submit-button { - background: $dark_blue; - padding: 0.8em; - color: $white; - text-align: center; - border: none; - border-radius: 2px; - font-weight: 300; width: 100%; margin-bottom: 1em; + font-size: 1em; } @media only screen and (min-width : 500px) { diff --git a/web-ui/src/common/submit_button/submit_button.spec.js b/web-ui/src/common/submit_button/submit_button.spec.js index 8279547c..0ba8137c 100644 --- a/web-ui/src/common/submit_button/submit_button.spec.js +++ b/web-ui/src/common/submit_button/submit_button.spec.js @@ -11,6 +11,10 @@ describe('SubmitButton', () => { }); it('renders an input of type submit for add email', () => { - expect(submitButton.find('input[type="submit"]').props().value).toEqual('Add Email'); + expect(submitButton.find('RaisedButton').props().label).toEqual('Add Email'); + }); + + it('renders button in enabled state', () => { + expect(submitButton.find('RaisedButton').props().disabled).toEqual(false); }); }); |