1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-12-11 17:48:09 +00:00

Added progress action for verify

This commit is contained in:
Vladimir Volek 2018-11-05 17:10:09 +01:00
parent bc0238403b
commit 68a8307b49
5 changed files with 32 additions and 8 deletions

View File

@ -1,5 +1,5 @@
/* @flow */ /* @flow */
export const SIGN_SUCCESS: 'sign__verify__sign__success' = 'sign__verify__sign__success'; export const SIGN_SUCCESS: 'sign__verify__sign__success' = 'sign__verify__sign__success';
export const SIGN_PROGRESS: 'sign__verify__sign_progress' = 'sign__verify__sign_progress'; export const SIGN_PROGRESS: 'sign__verify__sign_progress' = 'sign__verify__sign_progress';
export const VERIFY_PROGRESS: 'sign__verify__verify_progress' = 'sign__verify__verify_progress';
export const CLEAR: 'sign__verify__sign__clear' = 'sign__verify__sign__clear'; export const CLEAR: 'sign__verify__sign__clear' = 'sign__verify__sign__clear';

View File

@ -117,6 +117,7 @@ const getColor = (inputState) => {
}; };
const TrezorAction = styled.div` const TrezorAction = styled.div`
display: ${props => (props.action ? 'flex' : 'none')};
align-items: center; align-items: center;
margin: 0px 10px; margin: 0px 10px;
padding: 0 14px 0 5px; padding: 0 14px 0 5px;
@ -126,7 +127,7 @@ const TrezorAction = styled.div`
color: ${colors.WHITE}; color: ${colors.WHITE};
border-radius: 5px; border-radius: 5px;
line-height: 37px; line-height: 37px;
z-index: 10001; z-index: 10002;
transform: translate(-1px, -1px); transform: translate(-1px, -1px);
`; `;
@ -164,6 +165,9 @@ const TextArea = ({
<TopLabel>{topLabel}</TopLabel> <TopLabel>{topLabel}</TopLabel>
)} )}
<StyledTextarea <StyledTextarea
spellCheck="false"
autoCorrect="off"
autoCapitalize="off"
maxRows={maxRows} maxRows={maxRows}
rows={rows} rows={rows}
className={className} className={className}
@ -178,11 +182,9 @@ const TextArea = ({
borderColor={getColor(state)} borderColor={getColor(state)}
trezorAction={trezorAction} trezorAction={trezorAction}
/> />
{trezorAction && ( <TrezorAction action={trezorAction}>
<TrezorAction>
<ArrowUp />{trezorAction} <ArrowUp />{trezorAction}
</TrezorAction> </TrezorAction>
)}
{bottomText && ( {bottomText && (
<BottomText <BottomText
color={getColor(state)} color={getColor(state)}

View File

@ -112,7 +112,7 @@ const TrezorAction = styled.div`
color: ${colors.WHITE}; color: ${colors.WHITE};
border-radius: 5px; border-radius: 5px;
line-height: 37px; line-height: 37px;
z-index: 10001; z-index: 10002;
transform: translate(-1px, -1px); transform: translate(-1px, -1px);
`; `;

View File

@ -10,6 +10,7 @@ export type State = {
export const initialState: State = { export const initialState: State = {
signature: '', signature: '',
isSignProgress: false, isSignProgress: false,
isVerifyProgress: false,
}; };
export default (state: State = initialState, action: Action): State => { export default (state: State = initialState, action: Action): State => {
@ -27,6 +28,7 @@ export default (state: State = initialState, action: Action): State => {
}; };
case SIGN_VERIFY.VERIFY_PROGRESS: case SIGN_VERIFY.VERIFY_PROGRESS:
console.log('action', action);
return { return {
...state, ...state,
isVerifyProgress: action.isVerifyProgress, isVerifyProgress: action.isVerifyProgress,

View File

@ -116,7 +116,9 @@ class SignVerify extends Component<Props, State> {
const { const {
signVerifyActions, signVerifyActions,
signature, signature,
modal,
} = this.props; } = this.props;
console.log('modal', modal);
return ( return (
<Content> <Content>
<Title>Sign & Verify</Title> <Title>Sign & Verify</Title>
@ -187,6 +189,15 @@ class SignVerify extends Component<Props, State> {
state={(this.state.verifyAddress && validateAddress(this.state.verifyAddress)) ? 'error' : null} state={(this.state.verifyAddress && validateAddress(this.state.verifyAddress)) ? 'error' : null}
bottomText={this.state.verifyAddress !== '' ? validateAddress(this.state.verifyAddress) : null} bottomText={this.state.verifyAddress !== '' ? validateAddress(this.state.verifyAddress) : null}
isSmallText isSmallText
trezorAction={this.props.isVerifyProgress ? (
<ActionWrapper>
<StyledIcon
icon={ICONS.T1}
color={colors.WHITE}
/>
Check address on your Trezor
</ActionWrapper>
) : null}
/> />
</Row> </Row>
<Row> <Row>
@ -198,6 +209,15 @@ class SignVerify extends Component<Props, State> {
rows={4} rows={4}
maxRows={4} maxRows={4}
maxLength="255" maxLength="255"
trezorAction={this.props.isVerifyProgress ? (
<ActionWrapper>
<StyledIcon
icon={ICONS.T1}
color={colors.WHITE}
/>
Check address on your Trezor
</ActionWrapper>
) : null}
/> />
</Row> </Row>
<Row> <Row>