1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-24 09:18:09 +00:00

add tooltip and texts to wallettype modal

This commit is contained in:
Szymon Lesisz 2018-10-09 10:12:10 +02:00
parent c1a1e89ff3
commit 5291ce32b1
3 changed files with 52 additions and 12 deletions

View File

@ -5,6 +5,7 @@ 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 Button from 'components/Button'; import Button from 'components/Button';
import Tooltip from 'components/Tooltip';
import Icon from 'components/Icon'; import Icon from 'components/Icon';
import Link from 'components/Link'; import Link from 'components/Link';
import colors from 'config/colors'; import colors from 'config/colors';
@ -28,12 +29,39 @@ const StyledButton = styled(Button)`
margin: 0 0 10px 0; margin: 0 0 10px 0;
`; `;
const StyledTooltip = styled(Tooltip)`
position: absolute;
right: 0px;
top: 1px;
`;
const StyledIcon = styled(Icon)`
position: relative;
top: -1px;
&:hover {
cursor: pointer;
}
`;
const Row = styled.div` const Row = styled.div`
display: flex; display: flex;
flex-direction: column; flex-direction: column;
padding: 10px 0; padding: 10px 0;
`; `;
const Span = styled.div`
position: relative;
display: flex;
align-items: center;
flex-direction: row;
justify-content: center;
`;
const Divider = styled.div`
margin: 20px 0;
border-top: 1px solid ${colors.DIVIDER};
`;
class WalletType extends Component<Props> { class WalletType extends Component<Props> {
constructor(props: Props) { constructor(props: Props) {
super(props); super(props);
@ -77,17 +105,29 @@ class WalletType extends Component<Props> {
)} )}
<H3>RequestWalletType for { device.instanceLabel }?</H3> <H3>RequestWalletType for { device.instanceLabel }?</H3>
<Row> <Row>
<span> <Span>
<WalletTypeIcon type="standard" size={24} color={colors.TEXT_SECONDARY} /> <WalletTypeIcon type="standard" size={24} color={colors.TEXT_SECONDARY} />
Standard Wallet Standard Wallet
</span> </Span>
<P isSmaller>Continue to access your standard wallet.</P> <P isSmaller>Continue to access your standard wallet.</P>
<StyledButton onClick={() => this.changeType(false)}>Go to your standard wallet</StyledButton> <StyledButton onClick={() => this.changeType(false)}>Go to your standard wallet</StyledButton>
<Icon size={20} color={colors.TEXT_SECONDARY} icon={icons.HELP} /> <Divider />
<span> <Span>
<WalletTypeIcon type="hidden" size={24} color={colors.TEXT_SECONDARY} /> <WalletTypeIcon type="hidden" size={24} color={colors.TEXT_SECONDARY} />
Hidden Wallet Hidden Wallet
</span> <StyledTooltip
maxWidth={285}
placement="top"
content="Passphrase is an optional feature of the Trezor device that is recommended for advanced users only. It is a word or a sentence of your choice. Its main purpose is to access a hidden wallet."
readMoreLink="https://wiki.trezor.io/Passphrase"
>
<StyledIcon
icon={icons.HELP}
color={colors.TEXT_SECONDARY}
size={24}
/>
</StyledTooltip>
</Span>
<P isSmaller>You will be asked to enter your passphrase to unlock your hidden wallet.</P> <P isSmaller>You will be asked to enter your passphrase to unlock your hidden wallet.</P>
<StyledButton isWhite onClick={() => this.changeType(true)}>Go to your hidden wallet</StyledButton> <StyledButton isWhite onClick={() => this.changeType(true)}>Go to your hidden wallet</StyledButton>
</Row> </Row>

View File

@ -1,5 +1,5 @@
/* @flow */ /* @flow */
import React, { Component } from 'react'; import * as React from 'react';
import { bindActionCreators } from 'redux'; import { bindActionCreators } from 'redux';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom'; import { withRouter } from 'react-router-dom';
@ -29,7 +29,7 @@ import ConfirmUnverifiedAddress from 'components/modals/confirm/UnverifiedAddres
import ForgetDevice from 'components/modals/device/Forget'; import ForgetDevice from 'components/modals/device/Forget';
import RememberDevice from 'components/modals/device/Remember'; import RememberDevice from 'components/modals/device/Remember';
import DuplicateDevice from 'components/modals/device/Duplicate'; import DuplicateDevice from 'components/modals/device/Duplicate';
import RequestWalletType from 'components/modals/device/Type'; import WalletType from 'components/modals/device/WalletType';
type OwnProps = { } type OwnProps = { }
@ -52,13 +52,13 @@ type DispatchProps = {
export type Props = StateProps & DispatchProps; export type Props = StateProps & DispatchProps;
const Fade = ({ children, ...props }) => ( const Fade = (props: { children: React.Node}) => (
<CSSTransition <CSSTransition
{...props} {...props}
timeout={1000} timeout={1000}
classNames="fade" classNames="fade"
> >
{ children } { props.children }
</CSSTransition> </CSSTransition>
); );
@ -85,7 +85,7 @@ const ModalWindow = styled.div`
text-align: center; text-align: center;
`; `;
class Modal extends Component<Props> { class Modal extends React.Component<Props> {
render() { render() {
if (!this.props.modal.opened) return null; if (!this.props.modal.opened) return null;
@ -125,7 +125,7 @@ class Modal extends Component<Props> {
break; break;
case CONNECT.REQUEST_WALLET_TYPE: case CONNECT.REQUEST_WALLET_TYPE:
component = (<RequestWalletType {...this.props} />); component = (<WalletType {...this.props} />);
break; break;
default: default:

View File

@ -4,7 +4,7 @@ import colors from 'config/colors';
const tooltipStyles = css` const tooltipStyles = css`
.rc-tooltip { .rc-tooltip {
position: absolute; position: absolute;
z-index: 1070; z-index: 10070;
visibility: visible; visibility: visible;
border: none; border: none;
border-radius: 3px; border-radius: 3px;