1
0
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:
Vasek Mlejnsky 2018-09-03 15:29:34 +02:00
parent 34bf0ee17c
commit b6195e98d8

View File

@ -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}