-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: body 미디어 태그 제거 * feat: 1440px 이상 웹에서 아이폰 화면으로 렌더링 * feat: 아이폰 유틸리티 기능 추가 * feat: iPhone Layout 위치 수정 * feat: 실제 모바일 환경에서 iPhone utility 박스 제거 * chore: react-intersection-observer 추가 * feat: 무한 스크롤링 감지 컴포넌트 * feat: iPhone 사이즈 동적 게산 * test: IntersectionObserver mock 대체 * feat: 아이폰 기본 사이즈 조정 * style: 스켈레톤 피드 리스트 key 제거 * test: IntersectionObserver mocking 리팩토링
- Loading branch information
Showing
16 changed files
with
307 additions
and
104 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,47 @@ | ||
import { useEffect, useRef } from 'react'; | ||
|
||
const IPHONE_MIN_SIZE = 60; | ||
const IPHONE_MAX_SIZE = 100; | ||
|
||
/** | ||
* iPhone 레이아웃의 크기를 동적으로 변경하는 훅입니다. | ||
* @param initialSize 초기 사이즈 | ||
* @returns iPhone 레이아웃의 참조와 사이즈 변경 핸들러 | ||
*/ | ||
export const useDynamicSize = (initialSize: number = 80) => { | ||
const iPhoneSizeRef = useRef<number>(initialSize); | ||
const iPhoneLayoutRef = useRef<HTMLDivElement>(null); | ||
|
||
useEffect(() => { | ||
document.documentElement.style.setProperty( | ||
'--iphone-size', | ||
`${initialSize}%`, | ||
); | ||
}, []); | ||
|
||
const changeStyle = () => { | ||
if (iPhoneLayoutRef.current) { | ||
iPhoneLayoutRef.current.style.height = `${iPhoneSizeRef.current}%`; | ||
document.documentElement.style.setProperty( | ||
'--iphone-size', | ||
`${iPhoneSizeRef.current}%`, | ||
); | ||
} | ||
}; | ||
|
||
const handleSizeUp = () => { | ||
if (iPhoneSizeRef.current >= IPHONE_MAX_SIZE) return; | ||
|
||
iPhoneSizeRef.current += 1; | ||
changeStyle(); | ||
}; | ||
|
||
const handleSizeDown = () => { | ||
if (iPhoneSizeRef.current <= IPHONE_MIN_SIZE) return; | ||
|
||
iPhoneSizeRef.current -= 1; | ||
changeStyle(); | ||
}; | ||
|
||
return { iPhoneLayoutRef, handleSizeUp, handleSizeDown }; | ||
}; |
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 @@ | ||
export { IPhoneLayout } from './ui/IPhoneLayout'; |
Oops, something went wrong.