diff options
author | Tayane Fernandes <tayane.rmf@gmail.com> | 2017-03-09 18:54:10 -0300 |
---|---|---|
committer | Tayane Fernandes <tayane.rmf@gmail.com> | 2017-03-10 13:36:08 -0300 |
commit | aad05a38511a8bdd9bd13d2d38092ce6b35ac46b (patch) | |
tree | 04a8ab8816aee83e5b9c4bc0a1c059caa99338f7 /web-ui/src/common | |
parent | dc982839a98e2b165832dc243ec17d7631dec769 (diff) |
[#923] Disable button when the email is invalid on the backup email page
with @FrailWords
Diffstat (limited to 'web-ui/src/common')
-rw-r--r-- | web-ui/src/common/submit_button/submit_button.js | 14 | ||||
-rw-r--r-- | web-ui/src/common/submit_button/submit_button.scss | 7 | ||||
-rw-r--r-- | web-ui/src/common/submit_button/submit_button.spec.js | 2 |
3 files changed, 12 insertions, 11 deletions
diff --git a/web-ui/src/common/submit_button/submit_button.js b/web-ui/src/common/submit_button/submit_button.js index 4754e042..1e7da021 100644 --- a/web-ui/src/common/submit_button/submit_button.js +++ b/web-ui/src/common/submit_button/submit_button.js @@ -16,15 +16,23 @@ */ 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 SubmitButton = ({ buttonText, disabled }) => ( + <div className='submit-button'> + <RaisedButton primary label={buttonText} disabled={disabled} fullWidth labelStyle={{ textTransform: 'none' }} /> + </div> ); SubmitButton.propTypes = { - buttonText: React.PropTypes.string.isRequired + buttonText: React.PropTypes.string.isRequired, + disabled: React.PropTypes.boolean +}; + +SubmitButton.defaultProps = { + disabled: true }; 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..ac1307a8 100644 --- a/web-ui/src/common/submit_button/submit_button.scss +++ b/web-ui/src/common/submit_button/submit_button.scss @@ -18,13 +18,6 @@ @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; } 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..d4308e6d 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,6 @@ 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'); }); }); |