Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions src/feature/album/detail/components/PhotoList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import PhotoBox from '@/global/components/photo/PhotoBox';
import Toast from '@/global/components/toast/Toast';
import { buildQuery } from '@/global/utils/buildQuery';
import { useAlbumSortStore } from '@/store/useAlbumSortStore';
import { useAlbumTypeStore } from '@/store/useAlbumTypeStore';
import { useSelectedPhotosStore } from '@/store/useSelectedPhotosStore';
import {
type FetchNextPageOptions,
Expand Down Expand Up @@ -64,6 +65,12 @@ export default function PhotoList({
setSortType: state.setSortType,
})),
);
const { albumType, setAlbumType } = useAlbumTypeStore(
useShallow((state) => ({
albumType: state.albumType,
setAlbumType: state.setAlbumType,
})),
);

useEffect(() => {
if (!hasNextPage) return;
Expand Down Expand Up @@ -136,7 +143,7 @@ export default function PhotoList({
<div ref={anchorRef} className='invisible absolute top-[-72px] left-0' />
<div className='mb-3 flex justify-between'>
<span className='typo-body-lg-regular text-text-subtle'>
{totalPhotoCount || 0}
{(albumType === 'all' ? totalPhotoCount : photos.length) || 0}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

무한 스크롤이 적용된 리스트에서 '총'이라는 단어와 함께 현재 로드된 사진의 개수(photos.length)를 보여주는 것은 사용자에게 혼란을 줄 수 있습니다. 전체 사진 개수가 아닌 로드된 개수임을 명확히 하거나, '총'이라는 단어를 제거하는 것을 고려해보는 것이 좋겠습니다. 예를 들어, 'all' 타입일 때만 '총'을 붙여주고, 다른 경우에는 사진 개수만 표시할 수 있습니다.

Suggested change
{(albumType === 'all' ? totalPhotoCount : photos.length) || 0}
{albumType === 'all' ? `총 ${totalPhotoCount || 0}장` : `${photos.length || 0}`}

</span>
{mode === 'default' && (
<button
Expand Down Expand Up @@ -180,8 +187,16 @@ export default function PhotoList({
pressed={isSelected(photoId)}
mode={mode}
// 띱많은순이 아니면, 좋아요수가 있을때 의식하게되어 보여주지않음.
likeCount={sortType === 'liked' ? likeCnt : undefined}
liked={sortType === 'liked' ? isLiked : undefined}
likeCount={
sortType === 'liked' || albumType === 'deep'
? likeCnt
: undefined
}
liked={
sortType === 'liked' || albumType === 'deep'
? isLiked
: undefined
}
imageSrc={thumbnailUrl}
responsive
onPress={() => {
Expand Down
Loading