mirror of https://github.com/trezor/trezor-wallet
commit
8b332b4763
@ -1,17 +1,7 @@
|
|||||||
/* @flow */
|
/* @flow */
|
||||||
|
|
||||||
|
|
||||||
export const ON_PASSPHRASE_CHANGE: 'action__on_passphrase_change' = 'action__on_passphrase_change';
|
|
||||||
export const ON_PASSPHRASE_SHOW: 'action__on_passphrase_show' = 'action__on_passphrase_show';
|
|
||||||
export const ON_PASSPHRASE_HIDE: 'action__on_passphrase_hide' = 'action__on_passphrase_hide';
|
|
||||||
export const ON_PASSPHRASE_SAVE: 'action__on_passphrase_save' = 'action__on_passphrase_save';
|
|
||||||
export const ON_PASSPHRASE_FORGET: 'action__on_passphrase_forget' = 'action__on_passphrase_forget';
|
|
||||||
export const ON_PASSPHRASE_FOCUS: 'action__on_passphrase_focus' = 'action__on_passphrase_focus';
|
|
||||||
export const ON_PASSPHRASE_BLUR: 'action__on_passphrase_blur' = 'action__on_passphrase_blur';
|
|
||||||
export const ON_PASSPHRASE_SUBMIT: 'action__on_passphrase_submit' = 'action__on_passphrase_submit';
|
|
||||||
|
|
||||||
export const FORGET: 'modal__forget' = 'modal__forget';
|
|
||||||
export const REMEMBER: 'modal__remember' = 'modal__remember';
|
|
||||||
export const ON_FORGET: 'modal__on_forget' = 'modal__on_forget';
|
|
||||||
export const ON_REMEMBER: 'modal__on_remember' = 'modal__on_remember';
|
|
||||||
export const CLOSE: 'modal__close' = 'modal__close';
|
export const CLOSE: 'modal__close' = 'modal__close';
|
||||||
|
export const OPEN_EXTERNAL_WALLET: 'modal__external_wallet' = 'modal__external_wallet';
|
||||||
|
export const CONTEXT_NONE: 'modal_ctx_none' = 'modal_ctx_none';
|
||||||
|
export const CONTEXT_DEVICE: 'modal_ctx_device' = 'modal_ctx_device';
|
||||||
|
export const CONTEXT_EXTERNAL_WALLET: 'modal_ctx_external-wallet' = 'modal_ctx_external-wallet';
|
||||||
|
@ -0,0 +1,55 @@
|
|||||||
|
/* @flow */
|
||||||
|
import { bindActionCreators } from 'redux';
|
||||||
|
import { connect } from 'react-redux';
|
||||||
|
import { withRouter } from 'react-router-dom';
|
||||||
|
|
||||||
|
import ModalActions from 'actions/ModalActions';
|
||||||
|
import ReceiveActions from 'actions/ReceiveActions';
|
||||||
|
|
||||||
|
import type { MapStateToProps, MapDispatchToProps } from 'react-redux';
|
||||||
|
import type { State, Dispatch } from 'flowtype';
|
||||||
|
|
||||||
|
import Modal from './index';
|
||||||
|
|
||||||
|
type OwnProps = { }
|
||||||
|
|
||||||
|
type StateProps = {
|
||||||
|
modal: $ElementType<State, 'modal'>,
|
||||||
|
accounts: $ElementType<State, 'accounts'>,
|
||||||
|
devices: $ElementType<State, 'devices'>,
|
||||||
|
connect: $ElementType<State, 'connect'>,
|
||||||
|
selectedAccount: $ElementType<State, 'selectedAccount'>,
|
||||||
|
sendForm: $ElementType<State, 'sendForm'>,
|
||||||
|
receive: $ElementType<State, 'receive'>,
|
||||||
|
localStorage: $ElementType<State, 'localStorage'>,
|
||||||
|
wallet: $ElementType<State, 'wallet'>,
|
||||||
|
}
|
||||||
|
|
||||||
|
type DispatchProps = {
|
||||||
|
modalActions: typeof ModalActions,
|
||||||
|
receiveActions: typeof ReceiveActions,
|
||||||
|
}
|
||||||
|
|
||||||
|
export type Props = StateProps & DispatchProps;
|
||||||
|
|
||||||
|
const mapStateToProps: MapStateToProps<State, OwnProps, StateProps> = (state: State): StateProps => ({
|
||||||
|
modal: state.modal,
|
||||||
|
accounts: state.accounts,
|
||||||
|
devices: state.devices,
|
||||||
|
connect: state.connect,
|
||||||
|
selectedAccount: state.selectedAccount,
|
||||||
|
sendForm: state.sendForm,
|
||||||
|
receive: state.receive,
|
||||||
|
localStorage: state.localStorage,
|
||||||
|
wallet: state.wallet,
|
||||||
|
});
|
||||||
|
|
||||||
|
const mapDispatchToProps: MapDispatchToProps<Dispatch, OwnProps, DispatchProps> = (dispatch: Dispatch): DispatchProps => ({
|
||||||
|
modalActions: bindActionCreators(ModalActions, dispatch),
|
||||||
|
receiveActions: bindActionCreators(ReceiveActions, dispatch),
|
||||||
|
});
|
||||||
|
|
||||||
|
// export default connect(mapStateToProps, mapDispatchToProps)(Modal);
|
||||||
|
export default withRouter(
|
||||||
|
connect(mapStateToProps, mapDispatchToProps)(Modal),
|
||||||
|
);
|
After Width: | Height: | Size: 83 KiB |
@ -0,0 +1,68 @@
|
|||||||
|
/* @flow */
|
||||||
|
|
||||||
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import styled from 'styled-components';
|
||||||
|
import colors from 'config/colors';
|
||||||
|
import icons from 'config/icons';
|
||||||
|
import Icon from 'components/Icon';
|
||||||
|
import Link from 'components/Link';
|
||||||
|
import Button from 'components/Button';
|
||||||
|
import { H3, H4 } from 'components/Heading';
|
||||||
|
import P from 'components/Paragraph';
|
||||||
|
import coins from 'constants/coins';
|
||||||
|
|
||||||
|
import NemImage from './images/nem-download.png';
|
||||||
|
import type { Props as BaseProps } from '../../Container';
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
onCancel: $ElementType<$ElementType<BaseProps, 'modalActions'>, 'onCancel'>;
|
||||||
|
}
|
||||||
|
|
||||||
|
const Wrapper = styled.div`
|
||||||
|
width: 100%;
|
||||||
|
max-width: 620px;
|
||||||
|
padding: 24px 48px;
|
||||||
|
`;
|
||||||
|
|
||||||
|
const StyledButton = styled(Button)`
|
||||||
|
margin: 0 0 10px 0;
|
||||||
|
width: 100%;
|
||||||
|
`;
|
||||||
|
|
||||||
|
const StyledLink = styled(Link)`
|
||||||
|
position: absolute;
|
||||||
|
right: 15px;
|
||||||
|
top: 10px;
|
||||||
|
`;
|
||||||
|
|
||||||
|
const Img = styled.img`
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
`;
|
||||||
|
|
||||||
|
const NemWallet = (props: Props) => (
|
||||||
|
<Wrapper>
|
||||||
|
<StyledLink onClick={props.onCancel}>
|
||||||
|
<Icon
|
||||||
|
size={20}
|
||||||
|
color={colors.TEXT_SECONDARY}
|
||||||
|
icon={icons.CLOSE}
|
||||||
|
/>
|
||||||
|
</StyledLink>
|
||||||
|
<H3>NEM Wallet</H3>
|
||||||
|
<P isSmaller>We have partnered up with the NEM Foundation to provide you with a full-fledged NEM Wallet.</P>
|
||||||
|
<H4>Make sure you download the Universal Client for TREZOR support.</H4>
|
||||||
|
<Img src={NemImage} />
|
||||||
|
<Link href={coins.find(i => i.id === 'xem').url}>
|
||||||
|
<StyledButton>Go to nem.io</StyledButton>
|
||||||
|
</Link>
|
||||||
|
</Wrapper>
|
||||||
|
);
|
||||||
|
|
||||||
|
NemWallet.propTypes = {
|
||||||
|
onCancel: PropTypes.func.isRequired,
|
||||||
|
};
|
||||||
|
|
||||||
|
export default NemWallet;
|
@ -1,26 +1,31 @@
|
|||||||
/* @flow */
|
/* @flow */
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
|
|
||||||
import { H3 } from 'components/Heading';
|
import { H3 } from 'components/Heading';
|
||||||
import P from 'components/Paragraph';
|
import P from 'components/Paragraph';
|
||||||
|
|
||||||
import type { Props } from '../../index';
|
import type { TrezorDevice } from 'flowtype';
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
device: TrezorDevice;
|
||||||
|
}
|
||||||
|
|
||||||
const Wrapper = styled.div`
|
const Wrapper = styled.div`
|
||||||
padding: 24px 48px;
|
padding: 24px 48px;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const InvalidPin = (props: Props) => {
|
const InvalidPin = (props: Props) => (
|
||||||
if (!props.modal.opened) return null;
|
<Wrapper>
|
||||||
|
<H3>Entered PIN for { props.device.label } is not correct</H3>
|
||||||
|
<P isSmaller>Retrying...</P>
|
||||||
|
</Wrapper>
|
||||||
|
);
|
||||||
|
|
||||||
const { device } = props.modal;
|
InvalidPin.propTypes = {
|
||||||
return (
|
device: PropTypes.object.isRequired,
|
||||||
<Wrapper>
|
|
||||||
<H3>Entered PIN for { device.label } is not correct</H3>
|
|
||||||
<P isSmaller>Retrying...</P>
|
|
||||||
</Wrapper>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default InvalidPin;
|
export default InvalidPin;
|
Loading…
Reference in new issue