update to react@16

This commit is contained in:
Sean Yesmunt 2017-11-29 00:03:53 -05:00
parent f0068bd069
commit 87ef004941
14 changed files with 85 additions and 80 deletions

View file

@ -1,13 +1,14 @@
import React from "react"; import React from "react";
import PropTypes from "prop-types";
import { formatCredits, formatFullPrice } from "util/formatCredits"; import { formatCredits, formatFullPrice } from "util/formatCredits";
import lbry from "../lbry.js"; import lbry from "../lbry.js";
//component/icon.js //component/icon.js
export class Icon extends React.PureComponent { export class Icon extends React.PureComponent {
static propTypes = { static propTypes = {
icon: React.PropTypes.string.isRequired, icon: PropTypes.string.isRequired,
className: React.PropTypes.string, className: PropTypes.string,
fixed: React.PropTypes.bool, fixed: PropTypes.bool,
}; };
render() { render() {
@ -24,7 +25,7 @@ export class Icon extends React.PureComponent {
export class TruncatedText extends React.PureComponent { export class TruncatedText extends React.PureComponent {
static propTypes = { static propTypes = {
lines: React.PropTypes.number, lines: PropTypes.number,
}; };
static defaultProps = { static defaultProps = {
@ -45,7 +46,7 @@ export class TruncatedText extends React.PureComponent {
export class BusyMessage extends React.PureComponent { export class BusyMessage extends React.PureComponent {
static propTypes = { static propTypes = {
message: React.PropTypes.string, message: PropTypes.string,
}; };
render() { render() {
@ -65,14 +66,14 @@ export class CurrencySymbol extends React.PureComponent {
export class CreditAmount extends React.PureComponent { export class CreditAmount extends React.PureComponent {
static propTypes = { static propTypes = {
amount: React.PropTypes.number.isRequired, amount: PropTypes.number.isRequired,
precision: React.PropTypes.number, precision: PropTypes.number,
isEstimate: React.PropTypes.bool, isEstimate: PropTypes.bool,
label: React.PropTypes.bool, label: PropTypes.bool,
showFree: React.PropTypes.bool, showFree: PropTypes.bool,
showFullPrice: React.PropTypes.bool, showFullPrice: PropTypes.bool,
showPlus: React.PropTypes.bool, showPlus: PropTypes.bool,
look: React.PropTypes.oneOf(["indicator", "plain", "fee"]), look: PropTypes.oneOf(["indicator", "plain", "fee"]),
}; };
static defaultProps = { static defaultProps = {
@ -142,7 +143,7 @@ let addressStyle = {
}; };
export class Address extends React.PureComponent { export class Address extends React.PureComponent {
static propTypes = { static propTypes = {
address: React.PropTypes.string, address: PropTypes.string,
}; };
constructor(props) { constructor(props) {
@ -174,7 +175,7 @@ export class Address extends React.PureComponent {
export class Thumbnail extends React.PureComponent { export class Thumbnail extends React.PureComponent {
static propTypes = { static propTypes = {
src: React.PropTypes.string, src: PropTypes.string,
}; };
handleError() { handleError() {

View file

@ -1,11 +1,12 @@
import React from "react"; import React from "react";
import PropTypes from "prop-types";
const { remote } = require("electron"); const { remote } = require("electron");
class FileSelector extends React.PureComponent { class FileSelector extends React.PureComponent {
static propTypes = { static propTypes = {
type: React.PropTypes.oneOf(["file", "directory"]), type: PropTypes.oneOf(["file", "directory"]),
initPath: React.PropTypes.string, initPath: PropTypes.string,
onFileChosen: React.PropTypes.func, onFileChosen: PropTypes.func,
}; };
static defaultProps = { static defaultProps = {

View file

@ -1,4 +1,5 @@
import React from "react"; import React from "react";
import PropTypes from "prop-types";
import FormField from "component/formField"; import FormField from "component/formField";
import { Icon } from "component/common.js"; import { Icon } from "component/common.js";
@ -12,7 +13,7 @@ export function formFieldId() {
export class Form extends React.PureComponent { export class Form extends React.PureComponent {
static propTypes = { static propTypes = {
onSubmit: React.PropTypes.func.isRequired, onSubmit: PropTypes.func.isRequired,
}; };
constructor(props) { constructor(props) {
@ -34,16 +35,10 @@ export class Form extends React.PureComponent {
} }
export class FormRow extends React.PureComponent { export class FormRow extends React.PureComponent {
static propTypes = { spropTypes = {
label: React.PropTypes.oneOfType([ label: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
React.PropTypes.string, errorMessage: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
React.PropTypes.element, // helper: PropTypes.html,
]),
errorMessage: React.PropTypes.oneOfType([
React.PropTypes.string,
React.PropTypes.object,
]),
// helper: React.PropTypes.html,
}; };
static defaultProps = { static defaultProps = {

View file

@ -1,4 +1,5 @@
import React from "react"; import React from "react";
import PropTypes from "prop-types";
import FileSelector from "component/file-selector.js"; import FileSelector from "component/file-selector.js";
import SimpleMDE from "react-simplemde-editor"; import SimpleMDE from "react-simplemde-editor";
import { formFieldNestedLabelTypes, formFieldId } from "../form"; import { formFieldNestedLabelTypes, formFieldId } from "../form";
@ -8,14 +9,14 @@ const formFieldFileSelectorTypes = ["file", "directory"];
class FormField extends React.PureComponent { class FormField extends React.PureComponent {
static propTypes = { static propTypes = {
type: React.PropTypes.string.isRequired, type: PropTypes.string.isRequired,
prefix: React.PropTypes.string, prefix: PropTypes.string,
postfix: React.PropTypes.string, postfix: PropTypes.string,
hasError: React.PropTypes.bool, hasError: PropTypes.bool,
trim: React.PropTypes.bool, trim: PropTypes.bool,
regexp: React.PropTypes.oneOfType([ regexp: PropTypes.oneOfType([
React.PropTypes.instanceOf(RegExp), PropTypes.instanceOf(RegExp),
React.PropTypes.string, PropTypes.string,
]), ]),
}; };

View file

@ -1,10 +1,11 @@
import React from "react"; import React from "react";
import PropTypes from "prop-types";
import * as icons from "constants/icons"; import * as icons from "constants/icons";
export default class Icon extends React.PureComponent { export default class Icon extends React.PureComponent {
static propTypes = { static propTypes = {
icon: React.PropTypes.string.isRequired, icon: PropTypes.string.isRequired,
fixed: React.PropTypes.bool, fixed: PropTypes.bool,
}; };
static defaultProps = { static defaultProps = {

View file

@ -1,13 +1,14 @@
import React from "react"; import React from "react";
import PropTypes from "prop-types";
import lbry from "../lbry.js"; import lbry from "../lbry.js";
import { BusyMessage, Icon } from "./common.js"; import { BusyMessage, Icon } from "./common.js";
import Link from "component/link"; import Link from "component/link";
class LoadScreen extends React.PureComponent { class LoadScreen extends React.PureComponent {
static propTypes = { static propTypes = {
message: React.PropTypes.string.isRequired, message: PropTypes.string.isRequired,
details: React.PropTypes.string, details: PropTypes.string,
isWarning: React.PropTypes.bool, isWarning: PropTypes.bool,
}; };
constructor(props) { constructor(props) {

View file

@ -1,13 +1,14 @@
import React from "react"; import React from "react";
import PropTypes from "prop-types";
import { Icon } from "./common.js"; import { Icon } from "./common.js";
import Link from "component/link"; import Link from "component/link";
export class DropDownMenuItem extends React.PureComponent { export class DropDownMenuItem extends React.PureComponent {
static propTypes = { static propTypes = {
href: React.PropTypes.string, href: PropTypes.string,
label: React.PropTypes.string, label: PropTypes.string,
icon: React.PropTypes.string, icon: PropTypes.string,
onClick: React.PropTypes.func, onClick: PropTypes.func,
}; };
static defaultProps = { static defaultProps = {

View file

@ -1,4 +1,5 @@
import React from "react"; import React from "react";
import PropTypes from "prop-types";
import lbry from "lbry.js"; import lbry from "lbry.js";
import LoadScreen from "../load_screen.js"; import LoadScreen from "../load_screen.js";
import ModalIncompatibleDaemon from "modal/modalIncompatibleDaemon"; import ModalIncompatibleDaemon from "modal/modalIncompatibleDaemon";
@ -8,8 +9,8 @@ import * as modals from "constants/modal_types";
export class SplashScreen extends React.PureComponent { export class SplashScreen extends React.PureComponent {
static propTypes = { static propTypes = {
message: React.PropTypes.string, message: PropTypes.string,
onLoadDone: React.PropTypes.func, onLoadDone: PropTypes.func,
}; };
constructor(props) { constructor(props) {

View file

@ -1,9 +1,10 @@
import React from "react"; import React from "react";
import PropTypes from "prop-types";
export class ToolTip extends React.PureComponent { export class ToolTip extends React.PureComponent {
static propTypes = { static propTypes = {
body: React.PropTypes.string.isRequired, body: PropTypes.string.isRequired,
label: React.PropTypes.string.isRequired, label: PropTypes.string.isRequired,
}; };
constructor(props) { constructor(props) {

View file

@ -1,10 +1,11 @@
import React from "react"; import React from "react";
import PropTypes from "prop-types";
import ReactMarkdown from "react-markdown"; import ReactMarkdown from "react-markdown";
import ReactDOMServer from "react-dom/server"; import ReactDOMServer from "react-dom/server";
class TruncatedMarkdown extends React.PureComponent { class TruncatedMarkdown extends React.PureComponent {
static propTypes = { static propTypes = {
lines: React.PropTypes.number, lines: PropTypes.number,
}; };
static defaultProps = { static defaultProps = {

View file

@ -1,4 +1,5 @@
import React from "react"; import React from "react";
import PropTypes from "prop-types";
import lbryuri from "lbryuri.js"; import lbryuri from "lbryuri.js";
import { Icon } from "component/common.js"; import { Icon } from "component/common.js";
import { parseQueryParams } from "util/query_params"; import { parseQueryParams } from "util/query_params";
@ -7,8 +8,8 @@ class WunderBar extends React.PureComponent {
static TYPING_TIMEOUT = 800; static TYPING_TIMEOUT = 800;
static propTypes = { static propTypes = {
onSearch: React.PropTypes.func.isRequired, onSearch: PropTypes.func.isRequired,
onSubmit: React.PropTypes.func.isRequired, onSubmit: PropTypes.func.isRequired,
}; };
constructor(props) { constructor(props) {

View file

@ -1,18 +1,19 @@
import React from "react"; import React from "react";
import PropTypes from "prop-types";
import ReactModal from "react-modal"; import ReactModal from "react-modal";
import Link from "component/link/index"; import Link from "component/link/index";
import app from "app.js"; import app from "app.js";
export class Modal extends React.PureComponent { export class Modal extends React.PureComponent {
static propTypes = { static propTypes = {
type: React.PropTypes.oneOf(["alert", "confirm", "custom"]), type: PropTypes.oneOf(["alert", "confirm", "custom"]),
overlay: React.PropTypes.bool, overlay: PropTypes.bool,
onConfirmed: React.PropTypes.func, onConfirmed: PropTypes.func,
onAborted: React.PropTypes.func, onAborted: PropTypes.func,
confirmButtonLabel: React.PropTypes.string, confirmButtonLabel: PropTypes.string,
abortButtonLabel: React.PropTypes.string, abortButtonLabel: PropTypes.string,
confirmButtonDisabled: React.PropTypes.bool, confirmButtonDisabled: PropTypes.bool,
abortButtonDisabled: React.PropTypes.bool, abortButtonDisabled: PropTypes.bool,
}; };
static defaultProps = { static defaultProps = {
@ -64,8 +65,8 @@ export class Modal extends React.PureComponent {
export class ExpandableModal extends React.PureComponent { export class ExpandableModal extends React.PureComponent {
static propTypes = { static propTypes = {
expandButtonLabel: React.PropTypes.string, expandButtonLabel: PropTypes.string,
extraContent: React.PropTypes.element, extraContent: PropTypes.element,
}; };
static defaultProps = { static defaultProps = {

View file

@ -27,8 +27,8 @@
"localforage": "^1.5.0", "localforage": "^1.5.0",
"node-sass": "^4.5.3", "node-sass": "^4.5.3",
"rc-progress": "^2.0.6", "rc-progress": "^2.0.6",
"react": "^15.4.0", "react": "^16.2.0",
"react-dom": "^15.4.0", "react-dom": "^16.2.0",
"react-markdown": "^2.5.0", "react-markdown": "^2.5.0",
"react-modal": "^1.5.2", "react-modal": "^1.5.2",
"react-paginate": "^4.4.3", "react-paginate": "^4.4.3",

View file

@ -1576,7 +1576,7 @@ create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4:
safe-buffer "^5.0.1" safe-buffer "^5.0.1"
sha.js "^2.4.8" sha.js "^2.4.8"
create-react-class@^15.5.2, create-react-class@^15.6.0: create-react-class@^15.5.2:
version "15.6.2" version "15.6.2"
resolved "https://registry.yarnpkg.com/create-react-class/-/create-react-class-15.6.2.tgz#cf1ed15f12aad7f14ef5f2dfe05e6c42f91ef02a" resolved "https://registry.yarnpkg.com/create-react-class/-/create-react-class-15.6.2.tgz#cf1ed15f12aad7f14ef5f2dfe05e6c42f91ef02a"
dependencies: dependencies:
@ -4873,7 +4873,7 @@ promise@^7.0.3, promise@^7.1.1:
dependencies: dependencies:
asap "~2.0.3" asap "~2.0.3"
prop-types@^15.5.1, prop-types@^15.5.10, prop-types@^15.5.7, prop-types@^15.5.8: prop-types@^15.5.1, prop-types@^15.5.10, prop-types@^15.5.7, prop-types@^15.5.8, prop-types@^15.6.0:
version "15.6.0" version "15.6.0"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.0.tgz#ceaf083022fc46b4a35f69e13ef75aed0d639856" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.0.tgz#ceaf083022fc46b4a35f69e13ef75aed0d639856"
dependencies: dependencies:
@ -5028,14 +5028,14 @@ react-dom-factories@^1.0.0:
version "1.0.2" version "1.0.2"
resolved "https://registry.yarnpkg.com/react-dom-factories/-/react-dom-factories-1.0.2.tgz#eb7705c4db36fb501b3aa38ff759616aa0ff96e0" resolved "https://registry.yarnpkg.com/react-dom-factories/-/react-dom-factories-1.0.2.tgz#eb7705c4db36fb501b3aa38ff759616aa0ff96e0"
react-dom@^15.4.0: react-dom@^16.2.0:
version "15.6.2" version "16.2.0"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-15.6.2.tgz#41cfadf693b757faf2708443a1d1fd5a02bef730" resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.2.0.tgz#69003178601c0ca19b709b33a83369fe6124c044"
dependencies: dependencies:
fbjs "^0.8.9" fbjs "^0.8.16"
loose-envify "^1.1.0" loose-envify "^1.1.0"
object-assign "^4.1.0" object-assign "^4.1.1"
prop-types "^15.5.10" prop-types "^15.6.0"
react-markdown@^2.5.0: react-markdown@^2.5.0:
version "2.5.1" version "2.5.1"
@ -5089,15 +5089,14 @@ react@^0.14.2:
envify "^3.0.0" envify "^3.0.0"
fbjs "^0.6.1" fbjs "^0.6.1"
react@^15.4.0: react@^16.2.0:
version "15.6.2" version "16.2.0"
resolved "https://registry.yarnpkg.com/react/-/react-15.6.2.tgz#dba0434ab439cfe82f108f0f511663908179aa72" resolved "https://registry.yarnpkg.com/react/-/react-16.2.0.tgz#a31bd2dab89bff65d42134fa187f24d054c273ba"
dependencies: dependencies:
create-react-class "^15.6.0" fbjs "^0.8.16"
fbjs "^0.8.9"
loose-envify "^1.1.0" loose-envify "^1.1.0"
object-assign "^4.1.0" object-assign "^4.1.1"
prop-types "^15.5.10" prop-types "^15.6.0"
read-pkg-up@^1.0.1: read-pkg-up@^1.0.1:
version "1.0.1" version "1.0.1"