move nullable PropType helper

This commit is contained in:
Jannis R 2016-11-17 14:29:32 +01:00
parent 179078d31a
commit 4ae58f7d33
No known key found for this signature in database
GPG Key ID: 0FE83946296A88A5
6 changed files with 26 additions and 12 deletions

View File

@ -15,6 +15,7 @@
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import React, { Component, PropTypes } from 'react';
import nullable from '../../../util/nullable-proptype';
import BigNumber from 'bignumber.js';
import { Checkbox } from 'material-ui';
import InfoIcon from 'material-ui/svg-icons/action/info-outline';
@ -27,8 +28,6 @@ import { Form, Input } from '../../../ui';
import terms from '../terms-of-service';
import styles from './gatherData.css';
const nullable = (type) => PropTypes.oneOfType([ PropTypes.oneOf([ null ]), type ]);
export default class GatherData extends Component {
static propTypes = {
fee: React.PropTypes.instanceOf(BigNumber),

View File

@ -15,6 +15,7 @@
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import React, { Component, PropTypes } from 'react';
import nullable from '../../../util/nullable-proptype';
import TxHash from '../../../ui/TxHash';
import {
@ -23,9 +24,6 @@ import {
import styles from './sendConfirmation.css';
// TODO: move this to a better place
const nullable = (type) => PropTypes.oneOfType([ PropTypes.oneOf([ null ]), type ]);
export default class SendConfirmation extends Component {
static propTypes = {
step: PropTypes.any.isRequired,

View File

@ -15,6 +15,7 @@
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import React, { Component, PropTypes } from 'react';
import nullable from '../../../util/nullable-proptype';
import TxHash from '../../../ui/TxHash';
import {
@ -23,9 +24,6 @@ import {
import styles from './sendRequest.css';
// TODO: move this to a better place
const nullable = (type) => PropTypes.oneOfType([ PropTypes.oneOf([ null ]), type ]);
export default class SendRequest extends Component {
static propTypes = {
step: PropTypes.any.isRequired,

View File

@ -0,0 +1,21 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import { PropTypes } from 'react';
export default function (type) {
return PropTypes.oneOfType([ PropTypes.oneOf([ null ]), type ]);
}

View File

@ -15,6 +15,7 @@
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import React, { Component, PropTypes } from 'react';
import nullable from '../../../../util/nullable-proptype';
import Account from '../Account';
import TransactionPendingForm from '../TransactionPendingForm';
@ -22,8 +23,6 @@ import TxHashLink from '../TxHashLink';
import styles from './SignRequest.css';
const nullable = (type) => React.PropTypes.oneOfType([ React.PropTypes.oneOf([ null ]), type ]);
export default class SignRequest extends Component {
static contextTypes = {
api: PropTypes.object

View File

@ -15,6 +15,7 @@
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import React, { Component, PropTypes } from 'react';
import nullable from '../../../../util/nullable-proptype';
import CircularProgress from 'material-ui/CircularProgress';
@ -29,8 +30,6 @@ import styles from './TransactionFinished.css';
import * as tUtil from '../util/transaction';
import { capitalize } from '../util/util';
const nullable = (type) => React.PropTypes.oneOfType([ React.PropTypes.oneOf([ null ]), type ]);
export default class TransactionFinished extends Component {
static contextTypes = {
api: PropTypes.object.isRequired