1
0
mirror of https://github.com/trezor/trezor-wallet synced 2025-01-27 08:21:27 +00:00

Added button

This commit is contained in:
Vladimir Volek 2018-11-15 13:15:23 +01:00 committed by Szymon Lesisz
parent b151c9715b
commit 4b55bde476

View File

@ -9,6 +9,7 @@ import Textarea from 'components/Textarea';
import Tooltip from 'components/Tooltip'; import Tooltip from 'components/Tooltip';
import Icon from 'components/Icon'; import Icon from 'components/Icon';
import ICONS from 'config/icons'; import ICONS from 'config/icons';
import { FONT_SIZE } from 'config/variables';
import type { Props as BaseProps } from '../../Container'; import type { Props as BaseProps } from '../../Container';
@ -28,6 +29,7 @@ const InputRow = styled.div`
const InputLabelWrapper = styled.div` const InputLabelWrapper = styled.div`
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between;
`; `;
const GreenSpan = styled.span` const GreenSpan = styled.span`
@ -110,6 +112,18 @@ const getDataTextareaState = (dataError: string, dataWarning: string): string =>
return state; return state;
}; };
const Left = styled.div`
display: flex;
align-items: center;
`;
const Right = styled.div`
display: flex;
flex-direction: row;
font-size: ${FONT_SIZE.SMALLER};
cursor: pointer;
`;
// stateless component // stateless component
const AdvancedForm = (props: Props) => { const AdvancedForm = (props: Props) => {
const { const {
@ -155,25 +169,30 @@ const AdvancedForm = (props: Props) => {
spellCheck="false" spellCheck="false"
topLabel={( topLabel={(
<InputLabelWrapper> <InputLabelWrapper>
<Left>
Gas limit Gas limit
<Tooltip <Tooltip
content={( content={(
<React.Fragment> <React.Fragment>
Gas limit refers to the maximum amount of gas user is willing to spendon a particular transaction.{' '} Gas limit refers to the maximum amount of gas user is willing to spendon a particular transaction.{' '}
<GreenSpan>Transaction fee = gas limit * gas price</GreenSpan>.{' '}Increasing the gas limit will not get the transaction confirmed sooner. <GreenSpan>Transaction fee = gas limit * gas price</GreenSpan>.{' '}Increasing the gas limit will not get the transaction confirmed sooner.
Default value for sending {gasLimitTooltipCurrency} is <GreenSpan>{gasLimitTooltipValue}</GreenSpan>. Default value for sending {gasLimitTooltipCurrency} is <GreenSpan>{gasLimitTooltipValue}</GreenSpan>.
</React.Fragment> </React.Fragment>
)} )}
maxWidth={410} maxWidth={410}
readMoreLink="https://wiki.trezor.io/Ethereum_Wallet#Gas_limit" readMoreLink="https://wiki.trezor.io/Ethereum_Wallet#Gas_limit"
placement="top" placement="top"
> >
<Icon <Icon
icon={ICONS.HELP} icon={ICONS.HELP}
color={colors.TEXT_SECONDARY} color={colors.TEXT_SECONDARY}
size={24} size={24}
/> />
</Tooltip> </Tooltip>
</Left>
<Right>
Set default
</Right>
</InputLabelWrapper> </InputLabelWrapper>
)} )}
bottomText={errors.gasLimit || warnings.gasLimit || infos.gasLimit || (calculatingGasLimit ? 'Calculating...' : '')} bottomText={errors.gasLimit || warnings.gasLimit || infos.gasLimit || (calculatingGasLimit ? 'Calculating...' : '')}