1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-15 21:08:57 +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 = { type State = {
isHidden: boolean, isHidden: boolean,
canAnimateHideBalanceIcon: boolean,
}; };
const Wrapper = styled.div` const Wrapper = styled.div`
@ -76,11 +77,15 @@ class AccountBalance extends Component<Props, State> {
super(props); super(props);
this.state = { this.state = {
isHidden: false, isHidden: false,
canAnimateHideBalanceIcon: false,
}; };
} }
handleHideBallanceIconClick() { handleHideBallanceIconClick() {
this.setState(previousState => ({ isHidden: !previousState.isHidden })); this.setState(previousState => ({
isHidden: !previousState.isHidden,
canAnimateHideBalanceIcon: true,
}));
} }
render() { render() {
@ -103,7 +108,7 @@ class AccountBalance extends Component<Props, State> {
onClick={() => this.handleHideBallanceIconClick()} onClick={() => this.handleHideBallanceIconClick()}
> >
<Icon <Icon
canAnimate canAnimate={this.state.canAnimateHideBalanceIcon}
isActive={this.state.isHidden} isActive={this.state.isHidden}
icon={ICONS.ARROW_UP} icon={ICONS.ARROW_UP}
color={colors.TEXT_SECONDARY} color={colors.TEXT_SECONDARY}