Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'upstream/development' into 491-give-bet…
Browse files Browse the repository at this point in the history
…ter-passphrase-error
  • Loading branch information
alepop committed Sep 11, 2017
2 parents 15c16cb + 6491058 commit 14b4172
Show file tree
Hide file tree
Showing 15 changed files with 29 additions and 75 deletions.
4 changes: 0 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
"bitcore-mnemonic": "=1.1.1",
"copy-to-clipboard": "=3.0.6",
"flexboxgrid": "=6.3.1",
"i18next": "^9.0.0",
"i18next-localstorage-cache": "^1.1.1",
"i18next-xhr-backend": "^1.4.2",
"lisk-js": "=0.4.5",
"moment": "=2.15.1",
"postcss": "=6.0.2",
Expand All @@ -45,7 +42,6 @@
"react-circular-progressbar": "=0.1.5",
"react-css-themr": "=2.1.2",
"react-dom": "=15.6.x",
"react-i18next": "^5.2.0",
"react-redux": "=5.0.5",
"react-router": "=4.1.2",
"react-router-dom": "=4.1.2",
Expand Down
3 changes: 2 additions & 1 deletion src/actions/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ export const sent = ({ activePeer, account, recipientId, amount, passphrase, sec
senderPublicKey: account.publicKey,
senderId: account.address,
recipientId,
amount,
amount: toRawLsk(amount),
fee: Fees.send,
type: 0,
}));
})
.catch((error) => {
Expand Down
4 changes: 3 additions & 1 deletion src/actions/account.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { errorAlertDialogDisplayed } from './dialog';
import * as accountApi from '../utils/api/account';
import * as delegateApi from '../utils/api/delegate';
import Fees from '../constants/fees';
import { toRawLsk } from '../utils/lsk';

describe('actions: account', () => {
describe('accountUpdated', () => {
Expand Down Expand Up @@ -188,8 +189,9 @@ describe('actions: account', () => {
senderPublicKey: 'test_public-key',
senderId: 'test_address',
recipientId: data.recipientId,
amount: data.amount,
amount: toRawLsk(data.amount),
fee: Fees.send,
type: 0,
};

actionFunction(dispatch);
Expand Down
4 changes: 0 additions & 4 deletions src/components/app/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import { MemoryRouter } from 'react-router';
import { Provider } from 'react-redux';
import { expect } from 'chai';
import configureStore from 'redux-mock-store';
import { I18nextProvider } from 'react-i18next';
import i18n from '../../i18n'; // initialized i18next instance
import App from './';
import Login from '../login';
import Transactions from '../transactions';
Expand All @@ -18,9 +16,7 @@ const addRouter = Component => (props, path) =>
mount(
<Provider {...props}>
<MemoryRouter initialEntries={path}>
<I18nextProvider i18n={ i18n }>
<Component />
</I18nextProvider>
</MemoryRouter>
</Provider>,
);
Expand Down
6 changes: 3 additions & 3 deletions src/components/header/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ const Header = props => (
})}
/>
</IconMenu>
<Button className={`${styles.button} logout-button`} raised onClick={props.logOut}>{props.t('logout')}</Button>
<Button className={`${styles.button} logout-button`} raised onClick={props.logOut}>logout</Button>
<Button className={`${styles.button} send-button ${offlineStyle.disableWhenOffline}`}
raised primary
onClick={() => props.setActiveDialog({
title: props.t('send'),
title: 'Send',
childComponent: Send,
})}>{props.t('send')}</Button>
})}>Send</Button>
</PrivateWrapper>
</header>
);
Expand Down
1 change: 0 additions & 1 deletion src/components/header/header.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ describe('Header', () => {
const mockInputProps = {
setActiveDialog: () => { },
account: {},
t: t => t,
};
propsMock = sinon.mock(mockInputProps);
wrapper = shallow(<Header {...mockInputProps} />);
Expand Down
4 changes: 2 additions & 2 deletions src/components/header/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { connect } from 'react-redux';
import { translate } from 'react-i18next';
import { dialogDisplayed } from '../../actions/dialog';
import { accountLoggedOut } from '../../actions/account';
import Header from './header';
Expand All @@ -12,7 +11,8 @@ const mapDispatchToProps = dispatch => ({
setActiveDialog: data => dispatch(dialogDisplayed(data)),
logOut: () => dispatch(accountLoggedOut()),
});

export default connect(
mapStateToProps,
mapDispatchToProps,
)(translate()(Header));
)(Header);
8 changes: 1 addition & 7 deletions src/components/header/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import { expect } from 'chai';
import { mount } from 'enzyme';
import { Provider } from 'react-redux';
import sinon from 'sinon';
import { I18nextProvider } from 'react-i18next';
import i18n from '../../i18n'; // initialized i18next instance
import * as accountActions from '../../actions/account';
import * as dialogActions from '../../actions/dialog';
import Header from './header';
Expand All @@ -16,11 +14,7 @@ describe('HeaderHOC', () => {
let wrapper;

beforeEach(() => {
wrapper = mount(<Provider store={store}>
<I18nextProvider i18n={ i18n }>
<HeaderHOC />
</I18nextProvider>
</Provider>);
wrapper = mount(<Provider store={store}><HeaderHOC /></Provider>);
});

it('should render Header', () => {
Expand Down
2 changes: 2 additions & 0 deletions src/components/login/networks.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ export default [
}, {
name: 'Testnet',
testnet: true,
ssl: true,
port: 443,
}, {
name: 'Custom Node',
custom: true,
Expand Down
1 change: 1 addition & 0 deletions src/components/tabs/tabs.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@
background: white;
color: #0288d1;
margin-bottom: -1px;
opacity: 1;
}
16 changes: 14 additions & 2 deletions src/components/tabs/tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,25 @@ const getIndex = history => (
tabs.map(t => t.toLowerCase())
.indexOf(history.location.pathname.replace('/main/', '')));

const isCurrent = (history, index) => history.location.pathname.replace('/main/', '') === tabs[index].toLowerCase();

const navigate = (history, index) => {
if (!isCurrent(history, index)) {
history.push(`${tabs[index].toLowerCase()}`);
}
};

const Tabs = props => (
<ToolboxTabs index={getIndex(props.history)}
theme={styles}
onChange={index => props.history.push(`${tabs[index].toLowerCase()}`)}
onChange={navigate.bind(this, props.history)}
className={`${styles.tabs} main-tabs`}>
{getTabs(props.isDelegate).map((tab, index) =>
<Tab key={index} label={tab} className={styles.tab} />)}
<Tab
key={index}
label={tab}
className={styles.tab}
disabled={isCurrent(props.history, index)} />)}
</ToolboxTabs>
);

Expand Down
37 changes: 0 additions & 37 deletions src/i18n.js

This file was deleted.

4 changes: 0 additions & 4 deletions src/locales/de/common.json

This file was deleted.

4 changes: 0 additions & 4 deletions src/locales/en/common.json

This file was deleted.

6 changes: 1 addition & 5 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,15 @@ import React from 'react';
import ReactDOM from 'react-dom';
import { HashRouter as Router } from 'react-router-dom';
import { Provider } from 'react-redux';
import { I18nextProvider } from 'react-i18next';
import App from './components/app';
import store from './store';
import i18n from './i18n'; // initialized i18next instance

const rootElement = document.getElementById('app');

const renderWithRouter = Component =>
<Provider store={store}>
<Router>
<I18nextProvider i18n={ i18n }>
<Component />
</I18nextProvider>
<Component />
</Router>
</Provider>;

Expand Down

0 comments on commit 14b4172

Please sign in to comment.