Merge pull request #796 from lbryio/react@16

React@16
This commit is contained in:
Liam Cardenas 2017-11-29 01:04:55 -08:00 committed by GitHub
commit b8725e5d2b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 85 additions and 80 deletions

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -27,8 +27,8 @@
"localforage": "^1.5.0",
"node-sass": "^4.5.3",
"rc-progress": "^2.0.6",
"react": "^15.4.0",
"react-dom": "^15.4.0",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-markdown": "^2.5.0",
"react-modal": "^1.5.2",
"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"
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"
resolved "https://registry.yarnpkg.com/create-react-class/-/create-react-class-15.6.2.tgz#cf1ed15f12aad7f14ef5f2dfe05e6c42f91ef02a"
dependencies:
@ -4873,7 +4873,7 @@ promise@^7.0.3, promise@^7.1.1:
dependencies:
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"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.0.tgz#ceaf083022fc46b4a35f69e13ef75aed0d639856"
dependencies:
@ -5028,14 +5028,14 @@ react-dom-factories@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/react-dom-factories/-/react-dom-factories-1.0.2.tgz#eb7705c4db36fb501b3aa38ff759616aa0ff96e0"
react-dom@^15.4.0:
version "15.6.2"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-15.6.2.tgz#41cfadf693b757faf2708443a1d1fd5a02bef730"
react-dom@^16.2.0:
version "16.2.0"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.2.0.tgz#69003178601c0ca19b709b33a83369fe6124c044"
dependencies:
fbjs "^0.8.9"
fbjs "^0.8.16"
loose-envify "^1.1.0"
object-assign "^4.1.0"
prop-types "^15.5.10"
object-assign "^4.1.1"
prop-types "^15.6.0"
react-markdown@^2.5.0:
version "2.5.1"
@ -5089,15 +5089,14 @@ react@^0.14.2:
envify "^3.0.0"
fbjs "^0.6.1"
react@^15.4.0:
version "15.6.2"
resolved "https://registry.yarnpkg.com/react/-/react-15.6.2.tgz#dba0434ab439cfe82f108f0f511663908179aa72"
react@^16.2.0:
version "16.2.0"
resolved "https://registry.yarnpkg.com/react/-/react-16.2.0.tgz#a31bd2dab89bff65d42134fa187f24d054c273ba"
dependencies:
create-react-class "^15.6.0"
fbjs "^0.8.9"
fbjs "^0.8.16"
loose-envify "^1.1.0"
object-assign "^4.1.0"
prop-types "^15.5.10"
object-assign "^4.1.1"
prop-types "^15.6.0"
read-pkg-up@^1.0.1:
version "1.0.1"