mirror of
https://github.com/trezor/trezor-wallet
synced 2025-01-12 09:00:58 +00:00
prepare empty bitcoin send page, refactor
This commit is contained in:
parent
50767c77c3
commit
c47ca11f8b
@ -1,5 +1,12 @@
|
||||
{
|
||||
"networks": [
|
||||
{
|
||||
"order": 1,
|
||||
"type": "bitcoin",
|
||||
"name": "Bitcoin",
|
||||
"symbol": "BTC",
|
||||
"shortcut": "btc"
|
||||
},
|
||||
{
|
||||
"order": 2,
|
||||
"type": "ethereum",
|
||||
|
@ -138,6 +138,7 @@ export const onNotification = (
|
||||
},
|
||||
coin: account.network,
|
||||
});
|
||||
|
||||
if (!updatedAccount.success) return;
|
||||
|
||||
dispatch(
|
||||
|
@ -14,6 +14,7 @@ type NetworkFeeLevel = {
|
||||
|
||||
export type Network = {
|
||||
order: number,
|
||||
isHidden: ?boolean,
|
||||
type: string,
|
||||
name: string,
|
||||
testnet?: boolean,
|
||||
|
@ -80,6 +80,7 @@ class CoinMenu extends PureComponent<Props> {
|
||||
return (
|
||||
<Wrapper data-test="Main__page__coin__menu">
|
||||
{config.networks
|
||||
.filter(item => !item.isHidden)
|
||||
.sort((a, b) => a.order - b.order)
|
||||
.map(item => (
|
||||
<NavLink
|
||||
|
@ -0,0 +1,53 @@
|
||||
/* @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 { MapStateToProps, MapDispatchToProps } from 'react-redux';
|
||||
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: MapStateToProps<State, OwnProps, StateProps> = (
|
||||
state: State
|
||||
): StateProps => ({
|
||||
selectedAccount: state.selectedAccount,
|
||||
sendForm: state.sendFormRipple,
|
||||
wallet: state.wallet,
|
||||
fiat: state.fiat,
|
||||
localStorage: state.localStorage,
|
||||
});
|
||||
|
||||
const mapDispatchToProps: MapDispatchToProps<Dispatch, OwnProps, DispatchProps> = (
|
||||
dispatch: Dispatch
|
||||
): DispatchProps => ({
|
||||
sendFormActions: bindActionCreators(SendFormActions, 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 AccountSend = () => {
|
||||
return (
|
||||
<Content>
|
||||
<Title>bitcoin</Title>
|
||||
</Content>
|
||||
);
|
||||
};
|
||||
|
||||
export default AccountSend;
|
@ -5,7 +5,7 @@ import { colors, H5 } from 'trezor-ui-components';
|
||||
import Transaction from 'components/Transaction';
|
||||
|
||||
import type { Network } from 'reducers/LocalStorageReducer';
|
||||
import type { BaseProps } from '../../index';
|
||||
import type { BaseProps } from '../../../index';
|
||||
// import testData from './test.data';
|
||||
|
||||
type Props = {
|
@ -16,7 +16,7 @@ import AdvancedForm from './components/AdvancedForm';
|
||||
import PendingTransactions from '../components/PendingTransactions';
|
||||
|
||||
import l10nMessages from './index.messages';
|
||||
import l10nSendMessages from '../../common.messages';
|
||||
import l10nSendMessages from '../../../common.messages';
|
||||
import type { Props } from './Container';
|
||||
|
||||
const AmountInputLabelWrapper = styled.div`
|
@ -14,7 +14,7 @@ import PendingTransactions from '../components/PendingTransactions';
|
||||
import AdvancedForm from './components/AdvancedForm';
|
||||
|
||||
import l10nMessages from './index.messages';
|
||||
import l10nSendMessages from '../../common.messages';
|
||||
import l10nSendMessages from '../../../common.messages';
|
||||
|
||||
import type { Props } from './Container';
|
||||
|
@ -3,8 +3,9 @@ import React from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import type { State } from 'flowtype';
|
||||
import EthereumTypeSendForm from './ethereum/Container';
|
||||
import RippleTypeSendForm from './ripple/Container';
|
||||
import EthereumTypeSendForm from './components/ethereum/Container';
|
||||
import RippleTypeSendForm from './components/ripple/Container';
|
||||
import BitcoinTypeSendForm from './components/bitcoin/Container';
|
||||
|
||||
export type BaseProps = {
|
||||
selectedAccount: $ElementType<State, 'selectedAccount'>,
|
||||
@ -25,6 +26,8 @@ export default connect(
|
||||
return <EthereumTypeSendForm />;
|
||||
case 'ripple':
|
||||
return <RippleTypeSendForm />;
|
||||
case 'bitcoin':
|
||||
return <BitcoinTypeSendForm />;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
@ -74,16 +74,18 @@ const Dashboard = (props: Props) => (
|
||||
<FormattedMessage {...l10nMessages.TR_YOU_WILL_GAIN_ACCESS} />
|
||||
</StyledP>
|
||||
<Coins>
|
||||
{props.localStorage.config.networks.map(network => (
|
||||
<StyledNavLink
|
||||
key={network.shortcut}
|
||||
to={`${getBaseUrl(props.wallet.selectedDevice)}/network/${
|
||||
network.shortcut
|
||||
}/account/0`}
|
||||
>
|
||||
<StyledCoinLogo network={network.shortcut} height={32} />
|
||||
</StyledNavLink>
|
||||
))}
|
||||
{props.localStorage.config.networks
|
||||
.filter(item => !item.isHidden)
|
||||
.map(network => (
|
||||
<StyledNavLink
|
||||
key={network.shortcut}
|
||||
to={`${getBaseUrl(props.wallet.selectedDevice)}/network/${
|
||||
network.shortcut
|
||||
}/account/0`}
|
||||
>
|
||||
<StyledCoinLogo network={network.shortcut} height={32} />
|
||||
</StyledNavLink>
|
||||
))}
|
||||
</Coins>
|
||||
</Row>
|
||||
</Wrapper>
|
||||
|
Loading…
Reference in New Issue
Block a user