diff --git a/.eslintrc.json b/.eslintrc.json index bb482f3f2..19f686074 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -40,6 +40,8 @@ "react/require-default-props": 0, "react/jsx-closing-tag-location": 0, "jsx-a11y/no-noninteractive-element-to-interactive-role": 0, - "class-methods-use-this": 0 + "class-methods-use-this": 0, + "jsx-a11y/interactive-supports-focus": 0, + "jsx-a11y/click-events-have-key-events": 0 } } diff --git a/CHANGELOG.md b/CHANGELOG.md index cb3f570ac..7bbc66758 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,14 +6,20 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/). ## [Unreleased] ### Added -* Allow typing of encryption password without clicking entry box ([#1977](https://github.com/lbryio/lbry-desktop/pull/1977)) - + * 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)) + * 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)) + * Update to https ([#2016](https://github.com/lbryio/lbry-desktop/pull/2016)) + * Simplify FileCard and FileTile component styling ([#2011](https://github.com/lbryio/lbry-desktop/pull/2011)) ### Fixed -* Invite table cutoff with large number of invites ([#1985](https://github.com/lbryio/lbry-desktop/pull/1985)) -* Fixed Transactions filter menu collides with transaction table ([#2005](https://github.com/lbryio/lbry-desktop/pull/2005)) + * Fixed Transactions filter menu collides with transaction table ([#2005](https://github.com/lbryio/lbry-desktop/pull/2005)) + * Invite table cutoff with large number of invites ([#1985](https://github.com/lbryio/lbry-desktop/pull/1985)) + * History styling on large screens and link issue with claims ([#1999](https://github.com/lbryio/lbry-desktop/pull/1999)) + * Satisfy console warnings in publishForm and validation messaging ([#2010](https://github.com/lbryio/lbry-desktop/pull/2010)) + ## [0.25.1] - 2018-09-18 diff --git a/package.json b/package.json index 502a8cd51..b10cec32d 100644 --- a/package.json +++ b/package.json @@ -23,12 +23,10 @@ "extract-langs": "node build/extractLocals.js", "compile": "electron-webpack && yarn extract-langs", "build": "yarn compile && electron-builder build", - "build:dir": "yarn build -- --dir -c.compression=store -c.mac.identity=null", "dev": "electron-webpack dev", "lint": "eslint 'src/**/*.{js,jsx}' --fix && flow", "format": "prettier 'src/**/*.{js,jsx,scss,json}' --write", "flow-defs": "flow-typed install", - "release": "yarn compile && electron-builder build", "precommit": "lint-staged", "preinstall": "yarn cache clean lbry-redux && yarn cache clean lbryinc", "postinstall": "electron-builder install-app-deps && node build/downloadDaemon.js" @@ -50,7 +48,7 @@ "formik": "^0.10.4", "hast-util-sanitize": "^1.1.2", "keytar": "^4.2.1", - "lbry-redux": "lbryio/lbry-redux#c079b108c3bc4ba2b4fb85fb112b52cfc040c301", + "lbry-redux": "lbryio/lbry-redux#4ee6c376e5f2c3e3e96d199a56970e2621a84af1", "lbryinc": "lbryio/lbryinc#de7ff055605b02a24821f0f9bab1d206eb7f235d", "localforage": "^1.7.1", "mammoth": "^1.4.6", 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/channelTile/view.jsx b/src/renderer/component/channelTile/view.jsx index 304bdd663..7095f41e6 100644 --- a/src/renderer/component/channelTile/view.jsx +++ b/src/renderer/component/channelTile/view.jsx @@ -60,32 +60,13 @@ class ChannelTile extends React.PureComponent { >
- {isResolvingUri && ( -
- {__('Loading...')} -
- )} + {isResolvingUri &&
{__('Loading...')}
} {!isResolvingUri && ( -
+
-
+
{totalItems > 0 && ( {totalItems} {totalItems === 1 ? 'file' : 'files'} diff --git a/src/renderer/component/common/icon.jsx b/src/renderer/component/common/icon.jsx index 01db48c41..b92bf3d58 100644 --- a/src/renderer/component/common/icon.jsx +++ b/src/renderer/component/common/icon.jsx @@ -14,6 +14,7 @@ type Props = { icon: string, tooltip?: string, // tooltip direction iconColor?: string, + size?: number, }; class IconComponent extends React.PureComponent { @@ -42,7 +43,7 @@ class IconComponent extends React.PureComponent { }; render() { - const { icon, tooltip, iconColor } = this.props; + const { icon, tooltip, iconColor, size } = this.props; const Icon = FeatherIcons[icon]; if (!Icon) { @@ -54,16 +55,17 @@ class IconComponent extends React.PureComponent { color = this.getIconColor(iconColor); } - let size = 14; + let iconSize = size || 14; + // Arrow icons are quite a bit smaller than the other icons we use if (icon === icons.ARROW_LEFT || icon === icons.ARROW_RIGHT) { - size = 20; + iconSize = 20; } let tooltipText; if (tooltip) { tooltipText = this.getTooltip(icon); } - const inner = ; + const inner = ; return tooltipText ? ( diff --git a/src/renderer/component/copyableText/index.js b/src/renderer/component/copyableText/index.js new file mode 100644 index 000000000..f759811aa --- /dev/null +++ b/src/renderer/component/copyableText/index.js @@ -0,0 +1,10 @@ +import { connect } from 'react-redux'; +import { doNotify } from 'lbry-redux'; +import CopyableText from './view'; + +export default connect( + null, + { + doNotify, + } +)(CopyableText); diff --git a/src/renderer/component/copyableText/view.jsx b/src/renderer/component/copyableText/view.jsx new file mode 100644 index 000000000..e47a37506 --- /dev/null +++ b/src/renderer/component/copyableText/view.jsx @@ -0,0 +1,63 @@ +// @flow +import * as React from 'react'; +import { clipboard } from 'electron'; +import { FormRow } from 'component/common/form'; +import Button from 'component/button'; +import * as icons from 'constants/icons'; +/* +noSnackbar added due to issue 1945 +https://github.com/lbryio/lbry-desktop/issues/1945 +"Snackbars and modals can't be displayed at the same time" +*/ +type Props = { + copyable: string, + noSnackbar: boolean, + doNotify: ({ message: string, displayType: Array }) => void, +}; + +export default class CopyableText extends React.PureComponent { + constructor() { + super(); + + this.input = null; + } + + input: ?HTMLInputElement; + + render() { + const { copyable, doNotify, noSnackbar } = this.props; + + return ( + + { + this.input = input; + }} + onFocus={() => { + if (this.input) { + this.input.select(); + } + }} + /> + +