mirror of https://github.com/trezor/trezor-wallet
Merge pull request #492 from trezor/feature/Bitcoin
Refactor & prepare pages for bitcoin like coinspull/501/head
commit
241e59dc98
@ -0,0 +1,43 @@
|
|||||||
|
/* @flow */
|
||||||
|
import { bindActionCreators } from 'redux';
|
||||||
|
import { connect } from 'react-redux';
|
||||||
|
import { injectIntl } from 'react-intl';
|
||||||
|
|
||||||
|
import { showAddress } from 'actions/ReceiveActions';
|
||||||
|
import type { State, Dispatch } from 'flowtype';
|
||||||
|
import Receive from './index';
|
||||||
|
|
||||||
|
type OwnProps = {|
|
||||||
|
intl: any,
|
||||||
|
|};
|
||||||
|
|
||||||
|
type StateProps = {|
|
||||||
|
selectedAccount: $ElementType<State, 'selectedAccount'>,
|
||||||
|
receive: $ElementType<State, 'receive'>,
|
||||||
|
modal: $ElementType<State, 'modal'>,
|
||||||
|
wallet: $ElementType<State, 'wallet'>,
|
||||||
|
|};
|
||||||
|
|
||||||
|
type DispatchProps = {|
|
||||||
|
showAddress: typeof showAddress,
|
||||||
|
|};
|
||||||
|
|
||||||
|
export type Props = {| ...OwnProps, ...StateProps, ...DispatchProps |};
|
||||||
|
|
||||||
|
const mapStateToProps = (state: State): StateProps => ({
|
||||||
|
selectedAccount: state.selectedAccount,
|
||||||
|
receive: state.receive,
|
||||||
|
modal: state.modal,
|
||||||
|
wallet: state.wallet,
|
||||||
|
});
|
||||||
|
|
||||||
|
const mapDispatchToProps = (dispatch: Dispatch): DispatchProps => ({
|
||||||
|
showAddress: bindActionCreators(showAddress, dispatch),
|
||||||
|
});
|
||||||
|
|
||||||
|
export default injectIntl(
|
||||||
|
connect(
|
||||||
|
mapStateToProps,
|
||||||
|
mapDispatchToProps
|
||||||
|
)(Receive)
|
||||||
|
);
|
@ -0,0 +1,13 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import Title from 'views/Wallet/components/Title';
|
||||||
|
import Content from 'views/Wallet/components/Content';
|
||||||
|
|
||||||
|
const BitcoinReceive = () => {
|
||||||
|
return (
|
||||||
|
<Content>
|
||||||
|
<Title>Receive bitcoin</Title>
|
||||||
|
</Content>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default BitcoinReceive;
|
@ -0,0 +1,49 @@
|
|||||||
|
/* @flow */
|
||||||
|
|
||||||
|
import { bindActionCreators } from 'redux';
|
||||||
|
import { connect } from 'react-redux';
|
||||||
|
import { injectIntl } from 'react-intl';
|
||||||
|
|
||||||
|
import SendFormActions from 'actions/ripple/SendFormActions';
|
||||||
|
import { openQrModal } from 'actions/ModalActions';
|
||||||
|
import type { State, Dispatch } from 'flowtype';
|
||||||
|
import AccountSend from './index';
|
||||||
|
|
||||||
|
type OwnProps = {|
|
||||||
|
intl: any,
|
||||||
|
|};
|
||||||
|
|
||||||
|
export type StateProps = {|
|
||||||
|
selectedAccount: $ElementType<State, 'selectedAccount'>,
|
||||||
|
sendForm: $ElementType<State, 'sendFormRipple'>,
|
||||||
|
wallet: $ElementType<State, 'wallet'>,
|
||||||
|
fiat: $ElementType<State, 'fiat'>,
|
||||||
|
localStorage: $ElementType<State, 'localStorage'>,
|
||||||
|
|};
|
||||||
|
|
||||||
|
export type DispatchProps = {|
|
||||||
|
sendFormActions: typeof SendFormActions,
|
||||||
|
openQrModal: typeof openQrModal,
|
||||||
|
|};
|
||||||
|
|
||||||
|
export type Props = OwnProps & StateProps & DispatchProps;
|
||||||
|
|
||||||
|
const mapStateToProps = (state: State): StateProps => ({
|
||||||
|
selectedAccount: state.selectedAccount,
|
||||||
|
sendForm: state.sendFormRipple,
|
||||||
|
wallet: state.wallet,
|
||||||
|
fiat: state.fiat,
|
||||||
|
localStorage: state.localStorage,
|
||||||
|
});
|
||||||
|
|
||||||
|
const mapDispatchToProps = (dispatch: Dispatch): DispatchProps => ({
|
||||||
|
sendFormActions: bindActionCreators(SendFormActions, dispatch),
|
||||||
|
openQrModal: bindActionCreators(openQrModal, dispatch),
|
||||||
|
});
|
||||||
|
|
||||||
|
export default injectIntl(
|
||||||
|
connect(
|
||||||
|
mapStateToProps,
|
||||||
|
mapDispatchToProps
|
||||||
|
)(AccountSend)
|
||||||
|
);
|
@ -0,0 +1,13 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import Content from 'views/Wallet/components/Content';
|
||||||
|
import Title from 'views/Wallet/components/Title';
|
||||||
|
|
||||||
|
const BitcoinSend = () => {
|
||||||
|
return (
|
||||||
|
<Content>
|
||||||
|
<Title>Send bitcoin</Title>
|
||||||
|
</Content>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default BitcoinSend;
|
@ -0,0 +1,50 @@
|
|||||||
|
/* @flow */
|
||||||
|
import { bindActionCreators } from 'redux';
|
||||||
|
import { connect } from 'react-redux';
|
||||||
|
import { injectIntl } from 'react-intl';
|
||||||
|
import * as TokenActions from 'actions/TokenActions';
|
||||||
|
import type { State, Dispatch } from 'flowtype';
|
||||||
|
import Summary from './index';
|
||||||
|
|
||||||
|
type OwnProps = {|
|
||||||
|
intl: any,
|
||||||
|
|};
|
||||||
|
|
||||||
|
type StateProps = {|
|
||||||
|
selectedAccount: $ElementType<State, 'selectedAccount'>,
|
||||||
|
summary: $ElementType<State, 'summary'>,
|
||||||
|
wallet: $ElementType<State, 'wallet'>,
|
||||||
|
tokens: $ElementType<State, 'tokens'>,
|
||||||
|
fiat: $ElementType<State, 'fiat'>,
|
||||||
|
localStorage: $ElementType<State, 'localStorage'>,
|
||||||
|
|};
|
||||||
|
|
||||||
|
type DispatchProps = {|
|
||||||
|
addToken: typeof TokenActions.add,
|
||||||
|
loadTokens: typeof TokenActions.load,
|
||||||
|
removeToken: typeof TokenActions.remove,
|
||||||
|
|};
|
||||||
|
|
||||||
|
export type Props = OwnProps & StateProps & DispatchProps;
|
||||||
|
|
||||||
|
const mapStateToProps = (state: State): StateProps => ({
|
||||||
|
selectedAccount: state.selectedAccount,
|
||||||
|
summary: state.summary,
|
||||||
|
wallet: state.wallet,
|
||||||
|
tokens: state.tokens,
|
||||||
|
fiat: state.fiat,
|
||||||
|
localStorage: state.localStorage,
|
||||||
|
});
|
||||||
|
|
||||||
|
const mapDispatchToProps = (dispatch: Dispatch): DispatchProps => ({
|
||||||
|
addToken: bindActionCreators(TokenActions.add, dispatch),
|
||||||
|
loadTokens: bindActionCreators(TokenActions.load, dispatch),
|
||||||
|
removeToken: bindActionCreators(TokenActions.remove, dispatch),
|
||||||
|
});
|
||||||
|
|
||||||
|
export default injectIntl(
|
||||||
|
connect(
|
||||||
|
mapStateToProps,
|
||||||
|
mapDispatchToProps
|
||||||
|
)(Summary)
|
||||||
|
);
|
@ -0,0 +1,14 @@
|
|||||||
|
/* @flow */
|
||||||
|
import React from 'react';
|
||||||
|
import Content from 'views/Wallet/components/Content';
|
||||||
|
import Title from 'views/Wallet/components/Title';
|
||||||
|
|
||||||
|
const BitcoinSummary = () => {
|
||||||
|
return (
|
||||||
|
<Content>
|
||||||
|
<Title>Summary Bitcoin</Title>
|
||||||
|
</Content>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default BitcoinSummary;
|
Loading…
Reference in new issue