1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-28 03:08:30 +00:00

Finished modal refactor

This commit is contained in:
Vladimir Volek 2018-08-31 22:35:21 +02:00
parent 4ec97ad003
commit 7430d61254
5 changed files with 11 additions and 9 deletions

View File

@ -2,6 +2,7 @@ import React from 'react';
import styled, { css } from 'styled-components'; import styled, { css } from 'styled-components';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import Paragraph from 'components/Paragraph'; import Paragraph from 'components/Paragraph';
import { FONT_SIZE } from 'config/variables';
import { DASH, GREEN_COLOR } from 'config/animations'; import { DASH, GREEN_COLOR } from 'config/animations';
import colors from 'config/colors'; import colors from 'config/colors';
@ -36,14 +37,15 @@ const CircleWrapper = styled.circle`
`; `;
const StyledParagraph = styled(Paragraph)` const StyledParagraph = styled(Paragraph)`
font-size: ${props => (props.isSmallText ? FONT_SIZE.SMALLER : FONT_SIZE.BASE)};
color: ${props => (props.isWhiteText ? colors.WHITE : colors.TEXT_PRIMARY)}; color: ${props => (props.isWhiteText ? colors.WHITE : colors.TEXT_PRIMARY)};
`; `;
const Loader = ({ const Loader = ({
className, text, isWhiteText = false, size = 100, className, text, isWhiteText = false, isSmallText, size = 100,
}) => ( }) => (
<Wrapper className={className} size={size}> <Wrapper className={className} size={size}>
<StyledParagraph isWhiteText={isWhiteText}>{text}</StyledParagraph> <StyledParagraph isSmallText={isSmallText} isWhiteText={isWhiteText}>{text}</StyledParagraph>
<SvgWrapper viewBox="25 25 50 50"> <SvgWrapper viewBox="25 25 50 50">
<CircleWrapper <CircleWrapper
cx="50" cx="50"
@ -70,6 +72,7 @@ const Loader = ({
Loader.propTypes = { Loader.propTypes = {
isWhiteText: PropTypes.bool, isWhiteText: PropTypes.bool,
isSmallText: PropTypes.bool,
className: PropTypes.string, className: PropTypes.string,
text: PropTypes.string, text: PropTypes.string,
size: PropTypes.number, size: PropTypes.number,

View File

@ -43,7 +43,7 @@ const ConfirmSignTx = (props) => {
<Header> <Header>
<Icon icon={icons.T1} size={60} color={colors.TEXT_SECONDARY} /> <Icon icon={icons.T1} size={60} color={colors.TEXT_SECONDARY} />
<H3>Confirm transaction on { device.label } device</H3> <H3>Confirm transaction on { device.label } device</H3>
<P>Details are shown on display</P> <P isSmaller>Details are shown on display</P>
</Header> </Header>
<Content> <Content>
<Label>Send</Label> <Label>Send</Label>

View File

@ -1,6 +1,6 @@
/* @flow */ /* @flow */
import React, { Component } from 'react'; import React, { Component } from 'react';
import { H3 } from 'components/Heading'; import { H2 } from 'components/Heading';
import P from 'components/Paragraph'; import P from 'components/Paragraph';
import styled from 'styled-components'; import styled from 'styled-components';
import Icon from 'components/Icon'; import Icon from 'components/Icon';
@ -102,8 +102,8 @@ class ConfirmUnverifiedAddress extends Component<Props> {
<StyledLink onClick={onCancel}> <StyledLink onClick={onCancel}>
<Icon size={20} color={colors.TEXT_SECONDARY} icon={icons.CLOSE} /> <Icon size={20} color={colors.TEXT_SECONDARY} icon={icons.CLOSE} />
</StyledLink> </StyledLink>
<H3>{ deviceStatus }</H3> <H2>{ deviceStatus }</H2>
<P>To prevent phishing attacks, you should verify the address on your TREZOR first. { claim } to continue with the verification process.</P> <StyledP isSmaller>To prevent phishing attacks, you should verify the address on your TREZOR first. { claim } to continue with the verification process.</StyledP>
<Row> <Row>
<StyledButton onClick={() => this.verifyAddress()}>Try again</StyledButton> <StyledButton onClick={() => this.verifyAddress()}>Try again</StyledButton>
<StyledButton isWhite onClick={() => this.showUnverifiedAddress()}>Show unverified address</StyledButton> <StyledButton isWhite onClick={() => this.showUnverifiedAddress()}>Show unverified address</StyledButton>

View File

@ -130,6 +130,7 @@ export default class RememberDevice extends Component<Props, State> {
<ButtonContent> <ButtonContent>
<Text>Forget</Text> <Text>Forget</Text>
<StyledLoader <StyledLoader
isSmallText
isWhiteText isWhiteText
size={28} size={28}
text={this.state.countdown.toString()} text={this.state.countdown.toString()}

View File

@ -90,9 +90,7 @@ class Modal extends Component<Props> {
render() { render() {
if (!this.props.modal.opened) return null; if (!this.props.modal.opened) return null;
const { opened } = this.props.modal; const { opened, windowType } = this.props.modal;
const windowType = UI.REQUEST_PIN;
let component = null; let component = null;
switch (windowType) { switch (windowType) {