- Awaiting confirmation of the deposit address for your { typeSymbol } funds exchange
+
);
}
+
return (
- ShapeShift.io is awaiting a { typeSymbol } deposit. Send the funds from your { typeSymbol } network client to -
+ ShapeShift.io,
+ typeSymbol
+ } } />
{ depositAddress }
- ( minimum, maximum)
+ ,
+ minimum:
+ } } />
diff --git a/js/src/modals/Shapeshift/AwaitingDepositStep/awaitingDepositStep.spec.js b/js/src/modals/Shapeshift/AwaitingDepositStep/awaitingDepositStep.spec.js
new file mode 100644
index 000000000..65fdefb07
--- /dev/null
+++ b/js/src/modals/Shapeshift/AwaitingDepositStep/awaitingDepositStep.spec.js
@@ -0,0 +1,50 @@
+// Copyright 2015, 2016 Parity Technologies (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 .
+
+import { shallow } from 'enzyme';
+import React from 'react';
+
+import AwaitingDepositStep from './';
+
+let component;
+
+function render () {
+ component = shallow(
+
+ );
+
+ return component;
+}
+
+describe('modals/Shapeshift/AwaitingDepositStep', () => {
+ it('renders defaults', () => {
+ expect(render()).to.be.ok;
+ });
+
+ it('displays waiting for address with empty depositAddress', () => {
+ render();
+ expect(component.find('FormattedMessage').props().id).to.match(/awaitingConfirmation/);
+ });
+
+ it('displays waiting for deposit with non-empty depositAddress', () => {
+ render({ depositAddress: 'xyz' });
+ expect(component.find('FormattedMessage').first().props().id).to.match(/awaitingDeposit/);
+ });
+});
diff --git a/js/src/modals/Shapeshift/AwaitingExchangeStep/awaitingExchangeStep.js b/js/src/modals/Shapeshift/AwaitingExchangeStep/awaitingExchangeStep.js
index d3e0ce93c..d3760355f 100644
--- a/js/src/modals/Shapeshift/AwaitingExchangeStep/awaitingExchangeStep.js
+++ b/js/src/modals/Shapeshift/AwaitingExchangeStep/awaitingExchangeStep.js
@@ -15,32 +15,39 @@
// along with Parity. If not, see .
import React, { Component, PropTypes } from 'react';
-import Value from '../Value';
+import { FormattedMessage } from 'react-intl';
+import { observer } from 'mobx-react';
+import Value from '../Value';
import styles from '../shapeshift.css';
+@observer
export default class AwaitingExchangeStep extends Component {
static propTypes = {
- depositInfo: PropTypes.shape({
- incomingCoin: PropTypes.number.isRequired,
- incomingType: PropTypes.string.isRequired
- }).isRequired
+ store: PropTypes.object.isRequired
}
render () {
- const { depositInfo } = this.props;
+ const { depositInfo } = this.props.store;
const { incomingCoin, incomingType } = depositInfo;
return (
- ShapeShift.io has received a deposit of -
+ ShapeShift.io
+ } } />
- Awaiting the completion of the funds exchange and transfer of funds to your Parity account.
+
);
diff --git a/js/src/modals/Shapeshift/AwaitingExchangeStep/awaitingExchangeStep.spec.js b/js/src/modals/Shapeshift/AwaitingExchangeStep/awaitingExchangeStep.spec.js
new file mode 100644
index 000000000..a9ed6e5f2
--- /dev/null
+++ b/js/src/modals/Shapeshift/AwaitingExchangeStep/awaitingExchangeStep.spec.js
@@ -0,0 +1,39 @@
+// Copyright 2015, 2016 Parity Technologies (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 .
+
+import { shallow } from 'enzyme';
+import React from 'react';
+
+import AwaitingExchangeStep from './';
+
+let component;
+
+function render () {
+ component = shallow(
+
+ );
+
+ return component;
+}
+
+describe('modals/Shapeshift/AwaitingExchangeStep', () => {
+ it('renders defaults', () => {
+ expect(render()).to.be.ok;
+ });
+});
diff --git a/js/src/modals/Shapeshift/CompletedStep/completedStep.js b/js/src/modals/Shapeshift/CompletedStep/completedStep.js
index 2b5a6b162..681e26c55 100644
--- a/js/src/modals/Shapeshift/CompletedStep/completedStep.js
+++ b/js/src/modals/Shapeshift/CompletedStep/completedStep.js
@@ -14,39 +14,41 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see .
+import { observer } from 'mobx-react';
import React, { Component, PropTypes } from 'react';
+import { FormattedMessage } from 'react-intl';
import Value from '../Value';
-
import styles from '../shapeshift.css';
+@observer
export default class CompletedStep extends Component {
static propTypes = {
- depositInfo: PropTypes.shape({
- incomingCoin: PropTypes.number.isRequired,
- incomingType: PropTypes.string.isRequired
- }).isRequired,
- exchangeInfo: PropTypes.shape({
- outgoingCoin: PropTypes.string.isRequired,
- outgoingType: PropTypes.string.isRequired
- }).isRequired
+ store: PropTypes.object.isRequired
}
render () {
- const { depositInfo, exchangeInfo } = this.props;
+ const { depositInfo, exchangeInfo } = this.props.store;
const { incomingCoin, incomingType } = depositInfo;
const { outgoingCoin, outgoingType } = exchangeInfo;
return (
- ShapeShift.io has completed the funds exchange.
+ ShapeShift.io
+ } } />
=>
- The change in funds will be reflected in your Parity account shortly.
+
);
diff --git a/js/src/modals/Shapeshift/CompletedStep/completedStep.spec.js b/js/src/modals/Shapeshift/CompletedStep/completedStep.spec.js
new file mode 100644
index 000000000..c14da892a
--- /dev/null
+++ b/js/src/modals/Shapeshift/CompletedStep/completedStep.spec.js
@@ -0,0 +1,40 @@
+// Copyright 2015, 2016 Parity Technologies (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 .
+
+import { shallow } from 'enzyme';
+import React from 'react';
+
+import CompletedStep from './';
+
+let component;
+
+function render () {
+ component = shallow(
+
+ );
+
+ return component;
+}
+
+describe('modals/Shapeshift/CompletedStep', () => {
+ it('renders defaults', () => {
+ expect(render()).to.be.ok;
+ });
+});
diff --git a/js/src/modals/Shapeshift/ErrorStep/errorStep.js b/js/src/modals/Shapeshift/ErrorStep/errorStep.js
index 092494399..441904f22 100644
--- a/js/src/modals/Shapeshift/ErrorStep/errorStep.js
+++ b/js/src/modals/Shapeshift/ErrorStep/errorStep.js
@@ -14,25 +14,30 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see .
+import { observer } from 'mobx-react';
import React, { Component, PropTypes } from 'react';
+import { FormattedMessage } from 'react-intl';
import styles from '../shapeshift.css';
+@observer
export default class ErrorStep extends Component {
static propTypes = {
- error: PropTypes.shape({
- fatal: PropTypes.bool,
- message: PropTypes.string.isRequired
- }).isRequired
+ store: PropTypes.object.isRequired
}
render () {
- const { error } = this.props;
+ const { error } = this.props.store;
return (
- The funds shifting via ShapeShift.io failed with a fatal error on the exchange. The error message received from the exchange is as follow:
+ ShapeShift.io
+ } } />
{ error.message }
diff --git a/js/src/modals/Shapeshift/ErrorStep/errorStep.spec.js b/js/src/modals/Shapeshift/ErrorStep/errorStep.spec.js
new file mode 100644
index 000000000..7cb148334
--- /dev/null
+++ b/js/src/modals/Shapeshift/ErrorStep/errorStep.spec.js
@@ -0,0 +1,39 @@
+// Copyright 2015, 2016 Parity Technologies (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 .
+
+import { shallow } from 'enzyme';
+import React from 'react';
+
+import ErrorStep from './';
+
+let component;
+
+function render () {
+ component = shallow(
+
+ );
+
+ return component;
+}
+
+describe('modals/Shapeshift/ErrorStep', () => {
+ it('renders defaults', () => {
+ expect(render()).to.be.ok;
+ });
+});
diff --git a/js/src/modals/Shapeshift/OptionsStep/optionsStep.js b/js/src/modals/Shapeshift/OptionsStep/optionsStep.js
index 4314d2b5c..5a7afdf7e 100644
--- a/js/src/modals/Shapeshift/OptionsStep/optionsStep.js
+++ b/js/src/modals/Shapeshift/OptionsStep/optionsStep.js
@@ -14,64 +14,93 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see .
-import React, { Component, PropTypes } from 'react';
import { Checkbox, MenuItem } from 'material-ui';
+import { observer } from 'mobx-react';
+import React, { Component, PropTypes } from 'react';
+import { FormattedMessage } from 'react-intl';
-import { Form, Input, Select } from '~/ui';
+import { Form, Input, Select, Warning } from '~/ui';
import Price from '../Price';
-
+import { WARNING_NO_PRICE } from '../store';
import styles from './optionsStep.css';
+const WARNING_LABELS = {
+ [WARNING_NO_PRICE]: (
+
+ )
+};
+
+@observer
export default class OptionsStep extends Component {
static propTypes = {
- refundAddress: PropTypes.string.isRequired,
- coinSymbol: PropTypes.string.isRequired,
- coins: PropTypes.array.isRequired,
- price: PropTypes.object,
- hasAccepted: PropTypes.bool.isRequired,
- onChangeSymbol: PropTypes.func.isRequired,
- onChangeRefund: PropTypes.func.isRequired,
- onToggleAccept: PropTypes.func.isRequired
+ store: PropTypes.object.isRequired
};
render () {
- const { coinSymbol, coins, refundAddress, hasAccepted, onToggleAccept } = this.props;
- const label = `(optional) ${coinSymbol} return address`;
+ const { coinSymbol, coins, hasAcceptedTerms, price, refundAddress, warning } = this.props.store;
if (!coins.length) {
return (
- There are currently no exchange pairs/coins available to fund with.
+