From 984e5a1e26dfb25c81677640ec52cb9387a0f6bf Mon Sep 17 00:00:00 2001 From: ricky Date: Tue, 7 Jan 2020 17:20:29 -0500 Subject: [PATCH] Properly handle keystroke (#7747) * Properly handle keystroke, closes #7737 * no-unused-vars --- .../components/ui/button/button.component.js | 60 ++++++++++--------- .../import-with-seed-phrase.component.js | 2 +- 2 files changed, 32 insertions(+), 30 deletions(-) diff --git a/ui/app/components/ui/button/button.component.js b/ui/app/components/ui/button/button.component.js index 39e81317c..a43c140a2 100644 --- a/ui/app/components/ui/button/button.component.js +++ b/ui/app/components/ui/button/button.component.js @@ -1,4 +1,4 @@ -import React, { Component } from 'react' +import React from 'react' import PropTypes from 'prop-types' import classnames from 'classnames' @@ -24,33 +24,35 @@ const typeHash = { 'first-time': CLASSNAME_FIRST_TIME, } -export default class Button extends Component { - static propTypes = { - type: PropTypes.string, - large: PropTypes.bool, - className: PropTypes.string, - children: PropTypes.oneOfType([ - PropTypes.string, - PropTypes.array, - PropTypes.element, - ]), - } +const Button = ({ type, submit, large, children, className, ...buttonProps }) => ( + +) - render () { - const { type, large, className, ...buttonProps } = this.props - - return ( - - ) - } +Button.propTypes = { + type: PropTypes.string, + submit: PropTypes.bool, + large: PropTypes.bool, + className: PropTypes.string, + children: PropTypes.oneOfType([ + PropTypes.string, + PropTypes.array, + PropTypes.element, + ]), } + +Button.defaultProps = { + submit: false, +} + +export default Button diff --git a/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.component.js b/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.component.js index e09327f32..12eb4900f 100644 --- a/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.component.js +++ b/ui/app/pages/first-time-flow/create-password/import-with-seed-phrase/import-with-seed-phrase.component.js @@ -297,9 +297,9 @@ export default class ImportWithSeedPhrase extends PureComponent {