mirror of
https://github.com/trezor/trezor-wallet
synced 2024-11-15 12:59:09 +00:00
Fix bug causing icon rotation on first visit
This commit is contained in:
parent
34bf0ee17c
commit
b6195e98d8
@ -18,6 +18,7 @@ type Props = {
|
||||
|
||||
type State = {
|
||||
isHidden: boolean,
|
||||
canAnimateHideBalanceIcon: boolean,
|
||||
};
|
||||
|
||||
const Wrapper = styled.div`
|
||||
@ -76,11 +77,15 @@ class AccountBalance extends Component<Props, State> {
|
||||
super(props);
|
||||
this.state = {
|
||||
isHidden: false,
|
||||
canAnimateHideBalanceIcon: false,
|
||||
};
|
||||
}
|
||||
|
||||
handleHideBallanceIconClick() {
|
||||
this.setState(previousState => ({ isHidden: !previousState.isHidden }));
|
||||
this.setState(previousState => ({
|
||||
isHidden: !previousState.isHidden,
|
||||
canAnimateHideBalanceIcon: true,
|
||||
}));
|
||||
}
|
||||
|
||||
render() {
|
||||
@ -103,7 +108,7 @@ class AccountBalance extends Component<Props, State> {
|
||||
onClick={() => this.handleHideBallanceIconClick()}
|
||||
>
|
||||
<Icon
|
||||
canAnimate
|
||||
canAnimate={this.state.canAnimateHideBalanceIcon}
|
||||
isActive={this.state.isHidden}
|
||||
icon={ICONS.ARROW_UP}
|
||||
color={colors.TEXT_SECONDARY}
|
||||
|
Loading…
Reference in New Issue
Block a user