Fix dialog rounded corners on mobile
The dialog's rounded corners were not displaying correctly on mobile devices, while they were fine on desktop. This commit addresses the issue.
This commit is contained in:
@@ -4,11 +4,22 @@ import * as React from "react"
|
||||
const MOBILE_BREAKPOINT = 768
|
||||
|
||||
export function useIsMobile() {
|
||||
const [isMobile, setIsMobile] = React.useState<boolean>(false)
|
||||
const [isMobile, setIsMobile] = React.useState<boolean>(
|
||||
typeof window !== 'undefined' ? window.innerWidth < MOBILE_BREAKPOINT : false
|
||||
)
|
||||
|
||||
React.useEffect(() => {
|
||||
if (typeof window === 'undefined') return;
|
||||
|
||||
const checkMobile = () => {
|
||||
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)
|
||||
|
||||
// 모바일 화면인 경우 body에 클래스 추가
|
||||
if (window.innerWidth < MOBILE_BREAKPOINT) {
|
||||
document.body.classList.add('is-mobile');
|
||||
} else {
|
||||
document.body.classList.remove('is-mobile');
|
||||
}
|
||||
}
|
||||
|
||||
// 초기 확인
|
||||
|
||||
Reference in New Issue
Block a user