diff options
author | Tayane Fernandes <tayane.rmf@gmail.com> | 2017-03-10 14:29:27 -0300 |
---|---|---|
committer | Tayane Fernandes <tayane.rmf@gmail.com> | 2017-03-10 14:29:27 -0300 |
commit | 29a59d4ec216a895c8004fc0addbec1b329df200 (patch) | |
tree | 9e450d007fcec335d54be4a2c133e0a58549abc9 /web-ui/src/common | |
parent | aad05a38511a8bdd9bd13d2d38092ce6b35ac46b (diff) |
[#923] Fix submit button style of material-ui
with @FrailWords
Diffstat (limited to 'web-ui/src/common')
-rw-r--r-- | web-ui/src/common/submit_button/submit_button.js | 26 | ||||
-rw-r--r-- | web-ui/src/common/submit_button/submit_button.scss | 1 | ||||
-rw-r--r-- | web-ui/src/common/submit_button/submit_button.spec.js | 4 |
3 files changed, 27 insertions, 4 deletions
diff --git a/web-ui/src/common/submit_button/submit_button.js b/web-ui/src/common/submit_button/submit_button.js index 1e7da021..73f9b21c 100644 --- a/web-ui/src/common/submit_button/submit_button.js +++ b/web-ui/src/common/submit_button/submit_button.js @@ -20,19 +20,37 @@ import RaisedButton from 'material-ui/RaisedButton'; import './submit_button.scss'; -const SubmitButton = ({ buttonText, disabled }) => ( +const labelStyle = { + textTransform: 'none', + fontSize: '1em', + lineHeight: '48px' +}; + +const buttonStyle = { + height: '48px' +}; + +const SubmitButton = ({ buttonText, disabled=false }) => ( <div className='submit-button'> - <RaisedButton primary label={buttonText} disabled={disabled} fullWidth labelStyle={{ textTransform: 'none' }} /> + <RaisedButton type='submit' + label={buttonText} + disabled={disabled} + labelStyle={labelStyle} + buttonStyle={buttonStyle} + overlayStyle={buttonStyle} + fullWidth + primary + /> </div> ); SubmitButton.propTypes = { buttonText: React.PropTypes.string.isRequired, - disabled: React.PropTypes.boolean + disabled: React.PropTypes.bool }; SubmitButton.defaultProps = { - disabled: true + 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 ac1307a8..851899f7 100644 --- a/web-ui/src/common/submit_button/submit_button.scss +++ b/web-ui/src/common/submit_button/submit_button.scss @@ -20,6 +20,7 @@ .submit-button { 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 d4308e6d..0ba8137c 100644 --- a/web-ui/src/common/submit_button/submit_button.spec.js +++ b/web-ui/src/common/submit_button/submit_button.spec.js @@ -13,4 +13,8 @@ describe('SubmitButton', () => { it('renders an input of type submit for 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); + }); }); |