mirror of
https://github.com/trezor/trezor-wallet
synced 2024-12-02 13:18:19 +00:00
Merge pull request #483 from trezor/fix/initial-arrow-animation
Fix/selecting send form tab activates arrow animation
This commit is contained in:
commit
d6970c8f62
@ -1,6 +1,6 @@
|
|||||||
/* @flow */
|
/* @flow */
|
||||||
|
|
||||||
import React from 'react';
|
import React, { useState } from 'react';
|
||||||
import BigNumber from 'bignumber.js';
|
import BigNumber from 'bignumber.js';
|
||||||
import styled, { css } from 'styled-components';
|
import styled, { css } from 'styled-components';
|
||||||
import { Select, Button, Input, Link, Icon, P, colors, icons as ICONS } from 'trezor-ui-components';
|
import { Select, Button, Input, Link, Icon, P, colors, icons as ICONS } from 'trezor-ui-components';
|
||||||
@ -285,6 +285,8 @@ const AccountSend = (props: Props) => {
|
|||||||
onClear,
|
onClear,
|
||||||
} = props.sendFormActions;
|
} = props.sendFormActions;
|
||||||
|
|
||||||
|
const [touched, setTouched] = useState(false);
|
||||||
|
|
||||||
if (!device || !account || !discovery || !network || !shouldRender) {
|
if (!device || !account || !discovery || !network || !shouldRender) {
|
||||||
const { loader, exceptionPage } = props.selectedAccount;
|
const { loader, exceptionPage } = props.selectedAccount;
|
||||||
return <Content loader={loader} exceptionPage={exceptionPage} isLoading />;
|
return <Content loader={loader} exceptionPage={exceptionPage} isLoading />;
|
||||||
@ -472,14 +474,20 @@ const AccountSend = (props: Props) => {
|
|||||||
</InputRow>
|
</InputRow>
|
||||||
|
|
||||||
<ToggleAdvancedSettingsWrapper isAdvancedSettingsHidden={isAdvancedSettingsHidden}>
|
<ToggleAdvancedSettingsWrapper isAdvancedSettingsHidden={isAdvancedSettingsHidden}>
|
||||||
<ToggleAdvancedSettingsButton isTransparent onClick={toggleAdvanced}>
|
<ToggleAdvancedSettingsButton
|
||||||
|
isTransparent
|
||||||
|
onClick={() => {
|
||||||
|
toggleAdvanced();
|
||||||
|
setTouched(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
<FormattedMessage {...l10nSendMessages.TR_ADVANCED_SETTINGS} />
|
<FormattedMessage {...l10nSendMessages.TR_ADVANCED_SETTINGS} />
|
||||||
<AdvancedSettingsIcon
|
<AdvancedSettingsIcon
|
||||||
icon={ICONS.ARROW_DOWN}
|
icon={ICONS.ARROW_DOWN}
|
||||||
color={colors.TEXT_SECONDARY}
|
color={colors.TEXT_SECONDARY}
|
||||||
size={12}
|
size={12}
|
||||||
isActive={advanced}
|
isActive={advanced}
|
||||||
canAnimate
|
canAnimate={touched || advanced}
|
||||||
/>
|
/>
|
||||||
</ToggleAdvancedSettingsButton>
|
</ToggleAdvancedSettingsButton>
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* @flow */
|
/* @flow */
|
||||||
|
|
||||||
import React from 'react';
|
import React, { useState } from 'react';
|
||||||
import styled, { css } from 'styled-components';
|
import styled, { css } from 'styled-components';
|
||||||
import { FormattedMessage } from 'react-intl';
|
import { FormattedMessage } from 'react-intl';
|
||||||
|
|
||||||
@ -267,6 +267,8 @@ const AccountSend = (props: Props) => {
|
|||||||
onClear,
|
onClear,
|
||||||
} = props.sendFormActions;
|
} = props.sendFormActions;
|
||||||
|
|
||||||
|
const [touched, setTouched] = useState(false);
|
||||||
|
|
||||||
if (!device || !account || !discovery || !network || !shouldRender) {
|
if (!device || !account || !discovery || !network || !shouldRender) {
|
||||||
const { loader, exceptionPage } = props.selectedAccount;
|
const { loader, exceptionPage } = props.selectedAccount;
|
||||||
return <Content loader={loader} exceptionPage={exceptionPage} isLoading />;
|
return <Content loader={loader} exceptionPage={exceptionPage} isLoading />;
|
||||||
@ -437,14 +439,20 @@ const AccountSend = (props: Props) => {
|
|||||||
</InputRow>
|
</InputRow>
|
||||||
|
|
||||||
<ToggleAdvancedSettingsWrapper isAdvancedSettingsHidden={isAdvancedSettingsHidden}>
|
<ToggleAdvancedSettingsWrapper isAdvancedSettingsHidden={isAdvancedSettingsHidden}>
|
||||||
<ToggleAdvancedSettingsButton isTransparent onClick={toggleAdvanced}>
|
<ToggleAdvancedSettingsButton
|
||||||
|
isTransparent
|
||||||
|
onClick={() => {
|
||||||
|
toggleAdvanced();
|
||||||
|
setTouched(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
<FormattedMessage {...l10nSendMessages.TR_ADVANCED_SETTINGS} />
|
<FormattedMessage {...l10nSendMessages.TR_ADVANCED_SETTINGS} />
|
||||||
<AdvancedSettingsIcon
|
<AdvancedSettingsIcon
|
||||||
icon={ICONS.ARROW_DOWN}
|
icon={ICONS.ARROW_DOWN}
|
||||||
color={colors.TEXT_SECONDARY}
|
color={colors.TEXT_SECONDARY}
|
||||||
size={12}
|
size={12}
|
||||||
isActive={advanced}
|
isActive={advanced}
|
||||||
canAnimate
|
canAnimate={touched || advanced}
|
||||||
/>
|
/>
|
||||||
</ToggleAdvancedSettingsButton>
|
</ToggleAdvancedSettingsButton>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user