function CurrencyInput (props) {
  Component.call(this)

  this.state = {
    value: sanitizeValue(props.value),
  }
}
function DepositEtherModal () {
  Component.call(this)

  this.state = {
    buyingWithShapeshift: false,
  }
}
function WalletView () {
  Component.call(this)
  this.state = {
    hasCopied: false,
    copyToClipboardPressed: false,
  }
}
function PendingTx () {
  Component.call(this)
  this.state = {
    valid: true,
    txData: null,
    submitting: false,
  }
}
function TokenList () {
  this.state = {
    tokens: [],
    isLoading: true,
    network: null,
  }
  Component.call(this)
}
function AboutPage(){
    React.Component.call(this);
    this.state = {
        abouts: [],
    };
    this.fetchAbouts()
        .then(this.setState.bind(this));
}
Example #7
0
export function observer(arg1, arg2) {
    if (typeof arg1 === "string") {
        throw new Error("Store names should be provided as array")
    }
    if (Array.isArray(arg1)) {
        // component needs stores
        if (!warnedAboutObserverInjectDeprecation) {
            warnedAboutObserverInjectDeprecation = true
            console.warn(
                'Mobx observer: Using observer to inject stores is deprecated since 4.0. Use `@inject("store1", "store2") @observer ComponentClass` or `inject("store1", "store2")(observer(componentClass))` instead of `@observer(["store1", "store2"]) ComponentClass`'
            )
        }
        if (!arg2) {
            // invoked as decorator
            return componentClass => observer(arg1, componentClass)
        } else {
            return inject.apply(null, arg1)(observer(arg2))
        }
    }
    const componentClass = arg1

    if (componentClass.isMobxInjector === true) {
        console.warn(
            "Mobx observer: You are trying to use 'observer' on a component that already has 'inject'. Please apply 'observer' before applying 'inject'"
        )
    }

    // Stateless function component:
    // If it is function but doesn't seem to be a react class constructor,
    // wrap it to a react class automatically
    if (
        typeof componentClass === "function" &&
        (!componentClass.prototype || !componentClass.prototype.render) &&
        !componentClass.isReactClass &&
        !Component.isPrototypeOf(componentClass)
    ) {
        return observer(
            class extends Component {
                static displayName = componentClass.displayName || componentClass.name
                static contextTypes = componentClass.contextTypes
                static propTypes = componentClass.propTypes
                static defaultProps = componentClass.defaultProps
                render() {
                    return componentClass.call(this, this.props, this.context)
                }
            }
        )
    }

    if (!componentClass) {
        throw new Error("Please pass a valid component to 'observer'")
    }

    const target = componentClass.prototype || componentClass
    mixinLifecycleEvents(target)
    componentClass.isMobXReactObserver = true
    return componentClass
}
Example #8
0
};function observer(arg1, arg2) {
    if (typeof arg1 === "string") {
        throw new Error("Store names should be provided as array");
    }
    if (Array.isArray(arg1)) {
        // component needs stores
        if (!warnedAboutObserverInjectDeprecation) {
            warnedAboutObserverInjectDeprecation = true;
            console.warn('Mobx observer: Using observer to inject stores is deprecated since 4.0. Use `@inject("store1", "store2") @observer ComponentClass` or `inject("store1", "store2")(observer(componentClass))` instead of `@observer(["store1", "store2"]) ComponentClass`');
        }
        if (!arg2) {
            // invoked as decorator
            return function (componentClass) {
                return observer(arg1, componentClass);
            };
        } else {
            return inject.apply(null, arg1)(observer(arg2));
        }
    }
    var componentClass = arg1;

    if (componentClass.isMobxInjector === true) {
        console.warn("Mobx observer: You are trying to use 'observer' on a component that already has 'inject'. Please apply 'observer' before applying 'inject'");
    }

    // Stateless function component:
    // If it is function but doesn't seem to be a react class constructor,
    // wrap it to a react class automatically
    if (typeof componentClass === "function" && (!componentClass.prototype || !componentClass.prototype.render) && !componentClass.isReactClass && !Component.isPrototypeOf(componentClass)) {
        var _class, _temp;

        return observer((_temp = _class = function (_Component) {
            inherits(_class, _Component);

            function _class() {
                classCallCheck(this, _class);
                return possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).apply(this, arguments));
            }

            createClass(_class, [{
                key: "render",
                value: function render() {
                    return componentClass.call(this, this.props, this.context);
                }
            }]);
            return _class;
        }(Component), _class.displayName = componentClass.displayName || componentClass.name, _class.contextTypes = componentClass.contextTypes, _class.propTypes = componentClass.propTypes, _class.defaultProps = componentClass.defaultProps, _temp));
    }

    if (!componentClass) {
        throw new Error("Please pass a valid component to 'observer'");
    }

    var target = componentClass.prototype || componentClass;
    mixinLifecycleEvents(target);
    componentClass.isMobXReactObserver = true;
    return componentClass;
}
Example #9
0
function AddTokenScreen () {
  this.state = {
    warning: null,
    address: null,
    symbol: 'TOKEN',
    decimals: 18,
  }
  Component.call(this)
}
Example #10
0
  componentDidMount() {
    const { feature } = this.props;

    // Class components must call this.props.onReady when they're ready for the test.
    // We will assume functional components are ready immediately after mounting.
    if (!Component.isPrototypeOf(feature)) {
      this.handleReady();
    }
  }
function PendingTx () {
  Component.call(this)
  this.state = {
    isFetching: true,
    transactionType: '',
    tokenAddress: '',
    tokenSymbol: '',
    tokenDecimals: '',
  }
}
Example #12
0
function ReactSWFCompat(props) {
  React.Component.call(this, props);

  var that = this;
  this._containerRefCallback = function(c) {
    that._container = c;
  };
  this._swfRefCallback = function(c) {
    that._swf = c;
  };
}
function ShapeshiftForm () {
  Component.call(this)

  this.state = {
    depositCoin: 'btc',
    refundAddress: '',
    showQrCode: false,
    depositAddress: '',
    errorMessage: '',
    isLoading: false,
    bought: false,
  }
}
Example #14
0
export function observer(arg1, arg2) {
  if (typeof arg1 === "string") {
    throw new Error("Store names should be provided as array");
  }
  if (Array.isArray(arg1)) {
    // component needs stores
    if (!arg2) {
      // invoked as decorator
      return componentClass => observer(arg1, componentClass);
    } else {
      // TODO: deprecate this invocation style
      return inject.apply(null, arg1)(observer(arg2));
    }
  }
  const componentClass = arg1;

  // Stateless function component:
  // If it is function but doesn't seem to be a react class constructor,
  // wrap it to a react class automatically
  if (
    typeof componentClass === "function" &&
    (!componentClass.prototype || !componentClass.prototype.render) && !componentClass.isReactClass && !React.Component.isPrototypeOf(componentClass)
  ) {
    return observer(React.createClass({
      displayName: componentClass.displayName || componentClass.name,
      propTypes: componentClass.propTypes,
      contextTypes: componentClass.contextTypes,
      getDefaultProps: function() { return componentClass.defaultProps; },
      render: function() { return componentClass.call(this, this.props, this.context); }
    }));
  }

  if (!componentClass) {
    throw new Error("Please pass a valid component to 'observer'");
  }
  const target = componentClass.prototype || componentClass;
  [
    "componentWillMount",
    "componentWillUnmount",
    "componentDidMount",
    "componentDidUpdate"
  ].forEach(function(funcName) {
    patch(target, funcName)
  });
  if (!target.shouldComponentUpdate) {
    target.shouldComponentUpdate = reactiveMixin.shouldComponentUpdate;
  }
  componentClass.isMobXReactObserver = true;
  return componentClass;
}
Example #15
0
        render() {
            const observableProps = subscriptions.reduce((props, { propertyName }) => {
                props[propertyName] = this.state[propertyName];
                return props;
            }, {});

            const props = Object.assign({}, this.props, observableProps);

            if (Component.isPrototypeOf(WrappedComponent)) {
                return createElement(WrappedComponent, props);
            } else {
                return WrappedComponent(props);
            }
        }
Example #16
0
/** @constructor */
function ReactSWF(props) {
  React.Component.call(this, props);

  var that = this;
  this._refCallback = function(c) {
    that._node = c;
  };

  // The only way to change Flash parameters or reload the movie is to update
  // the key of the ReactSWF element. This unmounts the previous instance and
  // reloads the movie. Store initial values to keep the DOM consistent.

  var params = {};

  for (var key in supportedFPParamNames) {
    if (supportedFPParamNames.hasOwnProperty(key) &&
        props.hasOwnProperty(key)) {
      var value = props[key];

      if (value != null) {
        var name = supportedFPParamNames[key];

        if (name === 'flashvars' && typeof value === 'object') {
          value = encodeFlashVarsObject(value);
        } else if (booleanFPParams.hasOwnProperty(key)) {
          // Force boolean parameter arguments to be boolean.
          value = !!value;
        }

        params[name] = '' + value;
      }
    }
  }

  var ie = navigator.appName === 'Microsoft Internet Explorer';
  if(ie) {
    params['movie'] = props.src;
  }

  this._node = null;
  this.state = {
    src: props.src,
    params: params
  };
}
Example #17
0
  it('should be a stateful class component', function() {
   expect(React.Component.isPrototypeOf(Login)).to.be.true;
 });
Example #18
0
 it('should be a stateful class component', function() {
   expect(React.Component.isPrototypeOf(Search_Beneficiary)).to.be.true;
 });
Example #19
0
 it('should be a stateful class component', function() {
   expect(React.Component.isPrototypeOf(Beneficiaries_Profile)).to.be.true;
 });
Example #20
0
 function HistoryHandler(props, context) {
     React.Component.apply(this, arguments);
 }
Example #21
0
  it('should be a stateful class component', function() {
   expect(React.Component.isPrototypeOf(Home)).to.be.false;
 });
function PrivateKeyImportView () {
  Component.call(this)
}
Example #23
0
function Component(props) {
  React.Component.call(this, props);
  LifecycleMixin.getInitialState.call(this);
  PropsMixin.getInitialState.call(this);
}
Example #24
0
function ConfigScreen () {
  Component.call(this)
}
function CreateVaultCompleteScreen () {
  Component.call(this)
}
function AccountDetailScreen () {
  Component.call(this)
}
Example #27
0
const mountSafeCallback = (context: Component, callback: ?Function) => () => {
  if (!callback || (context.isMounted && !context.isMounted())) {
    return
  }
  return callback.apply(context, arguments)
}
function ShiftListItem () {
  Component.call(this)
}
function TransactionListItem () {
  Component.call(this)
}
Example #30
0
function AccountPanel () {
  Component.call(this)
}