diff --git a/CHANGELOG.md b/CHANGELOG.md index d84cb9630..c0f8334b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/). ### Added * Allow typing of encryption password without clicking entry box ([#1977](https://github.com/lbryio/lbry-desktop/pull/1977)) - + * Focus on search bar with {cmd,ctrl} + "l" ([#2003](https://github.com/lbryio/lbry-desktop/pull/2003)) ### Changed * Make tooltip smarter ([#1979](https://github.com/lbryio/lbry-desktop/pull/1979)) * Change channel pages to have 48 items instead of 10 ([#2002](https://github.com/lbryio/lbry-desktop/pull/2002)) diff --git a/src/renderer/component/cardVerify/view.jsx b/src/renderer/component/cardVerify/view.jsx index 7d8382c4c..c9dc76184 100644 --- a/src/renderer/component/cardVerify/view.jsx +++ b/src/renderer/component/cardVerify/view.jsx @@ -1,5 +1,5 @@ +// @flow import React from 'react'; -import PropTypes from 'prop-types'; import Button from 'component/button'; import * as icons from 'constants/icons'; @@ -7,30 +7,29 @@ let scriptLoading = false; let scriptLoaded = false; let scriptDidError = false; +type Props = { + disabled: boolean, + label: ?string, + + // ===================================================== + // Required by stripe + // see Stripe docs for more info: + // https://stripe.com/docs/checkout#integration-custom + // ===================================================== + + // Your publishable key (test or live). + // can't use "key" as a prop in react, so have to change the keyname + stripeKey: string, + + // The callback to invoke when the Checkout process is complete. + // function(token) + // token is the token object created. + // token.id can be used to create a charge or customer. + // token.email contains the email address entered by the user. + token: string, +}; + class CardVerify extends React.Component { - static propTypes = { - disabled: PropTypes.bool, - - label: PropTypes.string, - - // ===================================================== - // Required by stripe - // see Stripe docs for more info: - // https://stripe.com/docs/checkout#integration-custom - // ===================================================== - - // Your publishable key (test or live). - // can't use "key" as a prop in react, so have to change the keyname - stripeKey: PropTypes.string.isRequired, - - // The callback to invoke when the Checkout process is complete. - // function(token) - // token is the token object created. - // token.id can be used to create a charge or customer. - // token.email contains the email address entered by the user. - token: PropTypes.func.isRequired, - }; - constructor(props) { super(props); this.state = { diff --git a/src/renderer/component/formField/index.js b/src/renderer/component/formField/index.js deleted file mode 100644 index 5977b6b2c..000000000 --- a/src/renderer/component/formField/index.js +++ /dev/null @@ -1,5 +0,0 @@ -import React from 'react'; -import { connect } from 'react-redux'; -import FormField from './view'; - -export default connect(null, null, null, { withRef: true })(FormField); diff --git a/src/renderer/component/formField/view.jsx b/src/renderer/component/formField/view.jsx deleted file mode 100644 index 9d8dca9ec..000000000 --- a/src/renderer/component/formField/view.jsx +++ /dev/null @@ -1,200 +0,0 @@ -// This file is going to die -/* eslint-disable */ -import React from 'react'; -import PropTypes from 'prop-types'; -import FileSelector from 'component/common/file-selector'; -import SimpleMDE from 'react-simplemde-editor'; -import { formFieldNestedLabelTypes, formFieldId } from 'component/common/form'; -import style from 'react-simplemde-editor/dist/simplemde.min.css'; - -const formFieldFileSelectorTypes = ['file', 'directory']; - -class FormField extends React.PureComponent { - static propTypes = { - type: PropTypes.string.isRequired, - prefix: PropTypes.string, - postfix: PropTypes.string, - hasError: PropTypes.bool, - trim: PropTypes.bool, - regexp: PropTypes.oneOfType([PropTypes.instanceOf(RegExp), PropTypes.string]), - }; - - static defaultProps = { - trim: false, - }; - - constructor(props) { - super(props); - - this._fieldRequiredText = __('This field is required'); - this._type = null; - this._element = null; - this._extraElementProps = {}; - - this.state = { - isError: null, - errorMessage: null, - }; - } - - componentWillMount() { - if (['text', 'number', 'radio', 'checkbox'].includes(this.props.type)) { - this._element = 'input'; - this._type = this.props.type; - } else if (this.props.type == 'text-number') { - this._element = 'input'; - this._type = 'text'; - } else if (this.props.type == 'SimpleMDE') { - this._element = SimpleMDE; - this._type = 'textarea'; - this._extraElementProps.options = { - placeholder: this.props.placeholder, - hideIcons: ['heading', 'image', 'fullscreen', 'side-by-side'], - }; - } else if (formFieldFileSelectorTypes.includes(this.props.type)) { - this._element = 'input'; - this._type = 'hidden'; - } else { - // Non field, e.g.