mirror of
https://github.com/trezor/trezor-wallet
synced 2025-01-08 07:01:04 +00:00
Merge pull request #393 from trezor/fix/sidebar-hide-animation
Fix/Hide anim firing on page load
This commit is contained in:
commit
8cfde250b4
@ -114,7 +114,7 @@ const A = styled.a`
|
||||
|
||||
type Props = {
|
||||
sidebarEnabled?: boolean,
|
||||
sidebarOpened?: boolean,
|
||||
sidebarOpened?: ?boolean,
|
||||
toggleSidebar?: toggleSidebarType,
|
||||
|
||||
};
|
||||
|
@ -15,7 +15,7 @@ type State = {
|
||||
online: boolean;
|
||||
dropdownOpened: boolean;
|
||||
showBetaDisclaimer: boolean;
|
||||
showSidebar: boolean;
|
||||
showSidebar: ?boolean;
|
||||
initialParams: ?RouterLocationState;
|
||||
initialPathname: ?string;
|
||||
firstLocationChange: boolean;
|
||||
@ -29,7 +29,7 @@ const initialState: State = {
|
||||
dropdownOpened: false,
|
||||
firstLocationChange: true,
|
||||
showBetaDisclaimer: false,
|
||||
showSidebar: false,
|
||||
showSidebar: null,
|
||||
initialParams: null,
|
||||
initialPathname: null,
|
||||
disconnectRequest: null,
|
||||
|
@ -9,7 +9,7 @@ import { SLIDE_RIGHT, SLIDE_LEFT } from 'config/animations';
|
||||
|
||||
type Props = {
|
||||
children?: React.Node,
|
||||
isOpen: boolean,
|
||||
isOpen: ?boolean,
|
||||
}
|
||||
|
||||
type State = {
|
||||
@ -32,6 +32,9 @@ const AbsoluteWrapper = styled.aside`
|
||||
height: calc(100vh - 52px);
|
||||
z-index: 200;
|
||||
top: 52px;
|
||||
/* Prevents firing SLIDE_LEFT anim on page load. */
|
||||
/* isOpen is null until user clicks on menu toggler */
|
||||
display: ${props => (props.isOpen === null ? 'none' : 'block')};
|
||||
animation: ${props => (props.isOpen ? SLIDE_RIGHT : SLIDE_LEFT)} 0.25s cubic-bezier(0.17, 0.04, 0.03, 0.94) forwards;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user