File tree 1 file changed +11
-1
lines changed
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 1
- import React , { useState } from 'react'
1
+ import React , { useState , useEffect } from 'react'
2
2
import PropTypes from 'prop-types'
3
3
import styles from './styles.module.scss'
4
4
@@ -22,6 +22,16 @@ const LoginNav = ({
22
22
const [ openNotifications , setOpenNotifications ] = useState ( )
23
23
const [ openAccountMenu , setOpenAccountMenu ] = useState ( )
24
24
25
+ useEffect ( ( ) => {
26
+ // trigger when orientationChange in ipad
27
+ const onOrientationChange = ( ) => {
28
+ setOpenNotifications ( false )
29
+ setOpenAccountMenu ( false )
30
+ document . body . style . position = ''
31
+ }
32
+ window . addEventListener ( 'orientationchange' , onOrientationChange )
33
+ return ( ) => window . removeEventListener ( 'orientationchange' , onOrientationChange )
34
+ } , [ ] )
25
35
const handleClickNotifications = ( ) => setOpenNotifications ( x => ! x )
26
36
27
37
const handleClickUserInfo = ( ) => {
You can’t perform that action at this time.
0 commit comments