mirror of
https://github.com/trezor/trezor-wallet
synced 2025-01-02 20:30:54 +00:00
Textarea added trezor action prop, use textarea higligh while confirm
This commit is contained in:
parent
a31301a9f5
commit
d1ef608c0e
@ -17,6 +17,8 @@ export const sign = (
|
|||||||
state: selected.state,
|
state: selected.state,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
dispatch({ type: SIGN_VERIFY.SIGN_PROGRESS, isSignProgress: true });
|
||||||
|
|
||||||
const response = await TrezorConnect.ethereumSignMessage({
|
const response = await TrezorConnect.ethereumSignMessage({
|
||||||
device,
|
device,
|
||||||
path,
|
path,
|
||||||
@ -25,6 +27,8 @@ export const sign = (
|
|||||||
useEmptyPassphrase: selected.useEmptyPassphrase,
|
useEmptyPassphrase: selected.useEmptyPassphrase,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
dispatch({ type: SIGN_VERIFY.SIGN_PROGRESS, isSignProgress: false });
|
||||||
|
|
||||||
if (response && response.success) {
|
if (response && response.success) {
|
||||||
dispatch({
|
dispatch({
|
||||||
type: SIGN_VERIFY.SIGN_SUCCESS,
|
type: SIGN_VERIFY.SIGN_SUCCESS,
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
/* @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 VERIFY_SUCCESS: 'sign__verify__verify__success' = 'sign__verify__verify__success';
|
export const VERIFY_SUCCESS: 'sign__verify__verify__success' = 'sign__verify__verify__success';
|
||||||
export const CLEAR: 'sign__verify__sign__clear' = 'sign__verify__sign__clear';
|
export const CLEAR: 'sign__verify__sign__clear' = 'sign__verify__sign__clear';
|
@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import Textarea from 'react-textarea-autosize';
|
import Textarea from 'react-textarea-autosize';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import styled from 'styled-components';
|
import styled, { css } from 'styled-components';
|
||||||
import colors from 'config/colors';
|
import colors from 'config/colors';
|
||||||
import { FONT_SIZE, FONT_WEIGHT, FONT_FAMILY } from 'config/variables';
|
import { FONT_SIZE, FONT_WEIGHT, FONT_FAMILY } from 'config/variables';
|
||||||
|
|
||||||
@ -82,6 +82,14 @@ const StyledTextarea = styled(Textarea)`
|
|||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
${props => props.isInTrezorAction && css`
|
||||||
|
z-index: 10001; /* bigger than modal container */
|
||||||
|
border-color: ${colors.WHITE};
|
||||||
|
border-width: 2px;
|
||||||
|
transform: translate(-1px, -1px);
|
||||||
|
background: ${colors.DIVIDER};
|
||||||
|
`}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const TopLabel = styled.span`
|
const TopLabel = styled.span`
|
||||||
@ -119,6 +127,7 @@ const TextArea = ({
|
|||||||
topLabel,
|
topLabel,
|
||||||
state = '',
|
state = '',
|
||||||
bottomText = '',
|
bottomText = '',
|
||||||
|
isInTrezorAction = false,
|
||||||
}) => (
|
}) => (
|
||||||
<Wrapper
|
<Wrapper
|
||||||
className={className}
|
className={className}
|
||||||
@ -137,6 +146,7 @@ const TextArea = ({
|
|||||||
placeholder={placeholder}
|
placeholder={placeholder}
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
borderColor={getColor(state)}
|
borderColor={getColor(state)}
|
||||||
|
isInTrezorAction={isInTrezorAction}
|
||||||
/>
|
/>
|
||||||
{bottomText && (
|
{bottomText && (
|
||||||
<BottomText
|
<BottomText
|
||||||
@ -161,6 +171,7 @@ TextArea.propTypes = {
|
|||||||
topLabel: PropTypes.node,
|
topLabel: PropTypes.node,
|
||||||
state: PropTypes.string,
|
state: PropTypes.string,
|
||||||
bottomText: PropTypes.string,
|
bottomText: PropTypes.string,
|
||||||
|
isInTrezorAction: PropTypes.bool,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default TextArea;
|
export default TextArea;
|
||||||
|
@ -17,6 +17,7 @@ import InvalidPin from 'components/modals/pin/Invalid';
|
|||||||
import Passphrase from 'components/modals/passphrase/Passphrase';
|
import Passphrase from 'components/modals/passphrase/Passphrase';
|
||||||
import PassphraseType from 'components/modals/passphrase/Type';
|
import PassphraseType from 'components/modals/passphrase/Type';
|
||||||
import ConfirmSignTx from 'components/modals/confirm/SignTx';
|
import ConfirmSignTx from 'components/modals/confirm/SignTx';
|
||||||
|
import ConfirmSignMessage from 'components/modals/confirm/SignMessage';
|
||||||
import ConfirmUnverifiedAddress from 'components/modals/confirm/UnverifiedAddress';
|
import ConfirmUnverifiedAddress from 'components/modals/confirm/UnverifiedAddress';
|
||||||
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';
|
||||||
@ -90,6 +91,9 @@ const getDeviceContextModal = (props: Props) => {
|
|||||||
case 'ButtonRequest_SignTx':
|
case 'ButtonRequest_SignTx':
|
||||||
return <ConfirmSignTx device={modal.device} sendForm={props.sendForm} />;
|
return <ConfirmSignTx device={modal.device} sendForm={props.sendForm} />;
|
||||||
|
|
||||||
|
case 'ButtonRequest_SignMessage':
|
||||||
|
return <ConfirmSignMessage device={modal.device} />;
|
||||||
|
|
||||||
case RECEIVE.REQUEST_UNVERIFIED:
|
case RECEIVE.REQUEST_UNVERIFIED:
|
||||||
return (
|
return (
|
||||||
<ConfirmUnverifiedAddress
|
<ConfirmUnverifiedAddress
|
||||||
|
@ -12,10 +12,17 @@ export type State = {
|
|||||||
|
|
||||||
export const initialState: State = {
|
export const initialState: State = {
|
||||||
signature: '',
|
signature: '',
|
||||||
|
isSignProgress: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default (state: State = initialState, action: Action): State => {
|
export default (state: State = initialState, action: Action): State => {
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
|
case SIGN_VERIFY.SIGN_PROGRESS:
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
isSignProgress: action.isSignProgress,
|
||||||
|
};
|
||||||
|
|
||||||
case SIGN_VERIFY.SIGN_SUCCESS:
|
case SIGN_VERIFY.SIGN_SUCCESS:
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
|
@ -19,6 +19,7 @@ export type Props = StateProps & DispatchProps;
|
|||||||
const mapStateToProps: MapStateToProps<State, OwnProps, StateProps> = (state: State): StateProps => ({
|
const mapStateToProps: MapStateToProps<State, OwnProps, StateProps> = (state: State): StateProps => ({
|
||||||
selectedAccount: state.selectedAccount,
|
selectedAccount: state.selectedAccount,
|
||||||
signature: state.signVerifyReducer.signature,
|
signature: state.signVerifyReducer.signature,
|
||||||
|
isSignProgress: state.signVerifyReducer.isSignProgress,
|
||||||
isVerifySuccess: state.signVerifyReducer.isVerifySuccess,
|
isVerifySuccess: state.signVerifyReducer.isVerifySuccess,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -121,6 +121,7 @@ class SignVerify extends Component {
|
|||||||
onChange={this.handleInputChange}
|
onChange={this.handleInputChange}
|
||||||
rows="2"
|
rows="2"
|
||||||
maxLength="255"
|
maxLength="255"
|
||||||
|
isInTrezorAction={this.props.isSignProgress}
|
||||||
/>
|
/>
|
||||||
</Row>
|
</Row>
|
||||||
<Row>
|
<Row>
|
||||||
|
Loading…
Reference in New Issue
Block a user