diff options
author | Alexander Tseung <alextsg@gmail.com> | 2018-04-11 06:28:52 +0800 |
---|---|---|
committer | Alexander Tseung <alextsg@gmail.com> | 2018-04-11 06:28:52 +0800 |
commit | f96c13d616e429447ac0a6a24c6aeee902162b88 (patch) | |
tree | e0b6873c5d30e09f8bdab951db4282f2d9630254 /ui/app/components/page-container/page-container-footer | |
parent | 284dd85a99f538b77fd477f4952117d1792f64a5 (diff) | |
download | tangerine-wallet-browser-f96c13d616e429447ac0a6a24c6aeee902162b88.tar tangerine-wallet-browser-f96c13d616e429447ac0a6a24c6aeee902162b88.tar.gz tangerine-wallet-browser-f96c13d616e429447ac0a6a24c6aeee902162b88.tar.bz2 tangerine-wallet-browser-f96c13d616e429447ac0a6a24c6aeee902162b88.tar.lz tangerine-wallet-browser-f96c13d616e429447ac0a6a24c6aeee902162b88.tar.xz tangerine-wallet-browser-f96c13d616e429447ac0a6a24c6aeee902162b88.tar.zst tangerine-wallet-browser-f96c13d616e429447ac0a6a24c6aeee902162b88.zip |
Refactor page-container component structure
Diffstat (limited to 'ui/app/components/page-container/page-container-footer')
3 files changed, 50 insertions, 0 deletions
diff --git a/ui/app/components/page-container/page-container-footer/index.js b/ui/app/components/page-container/page-container-footer/index.js new file mode 100644 index 000000000..7825c4520 --- /dev/null +++ b/ui/app/components/page-container/page-container-footer/index.js @@ -0,0 +1 @@ +export { default } from './page-container-footer.component' diff --git a/ui/app/components/page-container/page-container-footer/page-container-footer.component.js b/ui/app/components/page-container/page-container-footer/page-container-footer.component.js new file mode 100644 index 000000000..fafe1c19e --- /dev/null +++ b/ui/app/components/page-container/page-container-footer/page-container-footer.component.js @@ -0,0 +1,49 @@ +import React, { Component } from 'react' +import PropTypes from 'prop-types' + +export default class PageContainerFooter extends Component { + + static propTypes = { + onCancel: PropTypes.func, + cancelText: PropTypes.string, + onSubmit: PropTypes.func, + submitText: PropTypes.string, + disabled: PropTypes.bool, + } + + static contextTypes = { + t: PropTypes.func, + } + + render () { + const { + onCancel, + cancelText, + onSubmit, + submitText, + disabled, + } = this.props + + return ( + <div className="page-container__footer"> + + <button + className="btn-secondary--lg page-container__footer-button" + onClick={() => onCancel()} + > + { this.context.t('cancel') || cancelText } + </button> + + <button + className="btn-primary--lg page-container__footer-button" + disabled={disabled} + onClick={e => onSubmit(e)} + > + { this.context.t('next') || submitText } + </button> + + </div> + ) + } + +} diff --git a/ui/app/components/page-container/page-container-footer/tests/page-container-footer.component.test.js b/ui/app/components/page-container/page-container-footer/tests/page-container-footer.component.test.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/ui/app/components/page-container/page-container-footer/tests/page-container-footer.component.test.js |