-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: 768 이상의 해상도에서 랜딩페이지 좌우 패딩 오류 (#808)
* fix: mainPage 768px 이상 해상도에서 제대로 작동하지 않던 오류 해결 * style: lint 적용
- Loading branch information
1 parent
aa1b8bc
commit 1b9aba2
Showing
7 changed files
with
75 additions
and
53 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,16 @@ | ||
import {useNavigate} from 'react-router-dom'; | ||
|
||
import {ROUTER_URLS} from '@constants/routerUrls'; | ||
|
||
const useMainSection = (trackStartCreateEvent: () => void) => { | ||
const navigate = useNavigate(); | ||
|
||
const handleClick = () => { | ||
trackStartCreateEvent(); | ||
navigate(ROUTER_URLS.createEvent); | ||
}; | ||
|
||
return {handleClick}; | ||
}; | ||
|
||
export default useMainSection; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import {useEffect, useState} from 'react'; | ||
|
||
const usePageBackground = () => { | ||
const [isVisible, setIsVisible] = useState(true); | ||
|
||
useEffect(() => { | ||
const handleScroll = () => { | ||
setIsVisible(window.scrollY <= window.innerHeight); | ||
}; | ||
|
||
window.addEventListener('scroll', handleScroll); | ||
window.document.body.style.maxWidth = '100vw'; | ||
return () => { | ||
window.removeEventListener('scroll', handleScroll); | ||
window.document.body.style.maxWidth = '768px'; | ||
}; | ||
}, [window.scrollY, window.innerHeight]); | ||
|
||
return {isVisible}; | ||
}; | ||
|
||
export default usePageBackground; |
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
24 changes: 3 additions & 21 deletions
24
client/src/pages/MainPage/Section/MainSection/MainSection.tsx
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