-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: 모바일 자동입력 시 노랑 배경 제거 * refactor: 햄버거 메뉴에서 스크롤 방지 * refactor: esc키로 메뉴 닫기 * refactor: 스와이프 문제 수정 및 키워드 Menu로 변경
- Loading branch information
1 parent
cd38683
commit bb03e36
Showing
6 changed files
with
91 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { useEffect } from 'react'; | ||
|
||
import useBooleanState from 'hooks/useBooleanState'; | ||
|
||
const useMobileMenu = (pathname: string, isMobile: boolean) => { | ||
const [isExpanded, , openMenu, closeMenu] = useBooleanState(false); | ||
|
||
useEffect(() => { | ||
if (!isMobile) { | ||
closeMenu(); | ||
} | ||
}, [closeMenu, isMobile]); | ||
|
||
useEffect(() => { | ||
closeMenu(); | ||
}, [closeMenu, pathname]); | ||
|
||
return { | ||
isMenuOpen: isExpanded, | ||
openMenu, | ||
closeMenu, | ||
}; | ||
}; | ||
|
||
export default useMobileMenu; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters