-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: AlignSelect를 native select로 변경 - 실제 쿼리스트링과 select option을 동기화 - 아이콘 제거 * refactor: ALIGN_QUERY < REVIEW_ALIGN_QUERY 네이밍 변경 * feat: REVIEW_FILTER_QUERY_STRINGS 상수 추가 * refactor: 불필요한 콜백 제거 * refactor: 리뷰 메타데이터 타입을 상수를 활용하도록 변경 * feat: 리뷰 필터 상태와 쿼리스트링 동기화 * feat: 필터 아이콘 위치 우측으로 변경 * feat: 상수 적용 및 불필요한 useEffect 제거 * refactor: 견종 select 기본 화살표 제거 * feat: ReactQueryDevtools 추가 * refactor: StyledProps $props 형식을 카멜 케이스 네이밍에만 적용 * refactor: theme animation > keyframes로 변경 및 별도의 animation 속성 추가 * refactor: COMMENT_VISIBLE_LINE_LIMIT 오타 수정 * feat: ReviewItem Skeleton 추가 * refactor: 기존 ReviewList > ReviewListAndChart로 변경 및 ReviewList 컴포넌트 분리 * refactor: query key 템플릿 리터럴 제거 * refactor: 변경된 ReviewListAndChart 네이밍 적용 * refactor: query key에 queryString 추가 * refactor: refetch > query key에 queryString을 추가하는 방식으로 변경 * feat: SuspendedImg 추가 * refactor: StarRatingDisplay 별점 이미지 SuspenedImg로 변경 * feat: ReviewControls Skeleton 추가 * refactor: SuspensedImg src를 옵셔널로 변경 * refactor: ReviewItem img > SuspendedImg로 변경 * refactor: 누락됐던 FilterSelectionDisplay 재적용 * feat: SuspenedImg lazy loading 기능 추가 * feat: FoodList Skeleton 추가 * feat: foodList fixture imageUrl 추가 * feat: FoodItem Skeleton 추가 및 LazyImg > SuspendedImg로 변경 * feat: FoodList Skeleton 적용 * feat: FilterBottomSheet 최대 높이 지정 * feat: iPhone8 이하 사이즈 대응 * refactor: ReviewControls 레이아웃 수정 * chore: stylelint rule 추가 * refactor: 사료 필터 목록 레이아웃 최소 높이 설정 * refactor: GuideBanner 작은 디바이스에서 폰트 사이즈 작게 변경 * refactor: 영양기준 국기 이모지 > svg로 변경 * refactor: ReviewList 리뷰 결과 없음 컴포넌트 디자인을 식품 결과 없음과 통일 * fix: NutritionStandardBlock story State를 직접 명명 * refactor: NonEmptyArray type export로 변경 * refactor: styledprops $재적용
- Loading branch information
Showing
49 changed files
with
776 additions
and
422 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 |
---|---|---|
|
@@ -34,5 +34,7 @@ module.exports = { | |
severity: 'error', | ||
}, | ||
], | ||
|
||
'property-no-vendor-prefix': null, | ||
}, | ||
}; |
Binary file added
BIN
+75 KB
frontend/.yarn/cache/@tanstack-match-sorter-utils-npm-8.8.4-488b98c113-d005f50075.zip
Binary file not shown.
Binary file added
BIN
+456 KB
frontend/.yarn/cache/@tanstack-react-query-devtools-npm-4.36.1-8448e7912a-d4f7da4121.zip
Binary file not shown.
Binary file added
BIN
+6.48 KB
frontend/.yarn/cache/copy-anything-npm-3.0.5-562d15fb3f-d39f6601c1.zip
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+6.49 KB
frontend/.yarn/cache/remove-accents-npm-0.4.2-7cb341092a-84a6988555.zip
Binary file not shown.
Binary file not shown.
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
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
55 changes: 55 additions & 0 deletions
55
frontend/src/components/@common/SuspendedImg/SuspendedImg.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { useQuery } from '@tanstack/react-query'; | ||
import { ComponentPropsWithoutRef, ComponentPropsWithRef, useEffect } from 'react'; | ||
|
||
import { useIntersectionObserver } from '@/hooks/@common/useIntersectionObserver'; | ||
|
||
interface SuspendedImgProps extends ComponentPropsWithoutRef<'img'> { | ||
staleTime?: number; | ||
cacheTime?: number; | ||
enabled?: boolean; | ||
lazy?: boolean; | ||
} | ||
|
||
// eslint-disable-next-line react/display-name | ||
const SuspendedImg = (props: SuspendedImgProps) => { | ||
const { src, cacheTime, staleTime, enabled, lazy, ...restProps } = props; | ||
|
||
const img = new Image(); | ||
|
||
const { targetRef, isIntersected } = useIntersectionObserver<HTMLImageElement>({ | ||
observerOptions: { threshold: 0.1 }, | ||
}); | ||
|
||
const lazyOptions: ComponentPropsWithRef<'img'> & { 'data-src'?: string } = { | ||
loading: 'lazy', | ||
ref: targetRef, | ||
'data-src': src, | ||
}; | ||
|
||
useQuery({ | ||
queryKey: [src], | ||
queryFn: () => | ||
new Promise(resolve => { | ||
img.onload = resolve; | ||
img.onerror = resolve; | ||
|
||
img.src = src!; | ||
}), | ||
...(staleTime == null ? {} : { staleTime }), | ||
...(cacheTime == null ? {} : { cacheTime }), | ||
enabled: enabled && Boolean(src), | ||
}); | ||
|
||
useEffect(() => { | ||
if (!targetRef.current) return; | ||
|
||
if ('loading' in HTMLImageElement.prototype || isIntersected) { | ||
targetRef.current.src = String(targetRef.current.dataset.src); | ||
} | ||
}, [isIntersected]); | ||
|
||
// eslint-disable-next-line jsx-a11y/alt-text | ||
return <img {...restProps} {...(lazy ? lazyOptions : { src })} />; | ||
}; | ||
|
||
export default SuspendedImg; |
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
Oops, something went wrong.