-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SP2] 최근 출시된 프로젝트 추가 #310
[SP2] 최근 출시된 프로젝트 추가 #310
Changes from 4 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
import Carousel from '@src/components/common/Carousel'; | ||
import { useDeviceType, useIsDesktop, useIsMobile } from '@src/hooks/useDevice'; | ||
import { StaticReleaseProjectList } from '@src/lib/constants/project'; | ||
import { ProjectCategoryType, ProjectPlatformType, ProjectType } from '@src/lib/types/project'; | ||
import RecentProjectListItem from '@src/views/ProjectPage/components/RecentProjectList/Item'; | ||
import { useGetProjectList } from '@src/views/ProjectPage/hooks/queries'; | ||
|
||
export default function RecentProjectListCarousel() { | ||
const { data } = useGetProjectList(ProjectCategoryType.ALL, ProjectPlatformType.ALL); | ||
const recentProjectList = data as ProjectType[]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 요거 받은 프로젝트만 띄우고, useGetProjectList에서 받은 data는 쓰지 않도록 하면 어떨까요..?!? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 헣 이 부분은 PM이랑 PD 의견이 지금 다른 것 같아서 답변 기다리고 있는 상태입니다..!! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 신청하는 프로젝트들만 상단 노출하는 걸로 결론이 나서 useQuery 사용 코드는 지웠습니다!! |
||
const recentProjectList = [...StaticReleaseProjectList, ...(data as ProjectType[]).slice(0, 4)]; | ||
|
||
const isDesktopSize = useIsDesktop('1280px'); | ||
const isMobileSize = useIsMobile('899px'); | ||
|
@@ -21,8 +22,8 @@ export default function RecentProjectListCarousel() { | |
gapWidth={isMobileSize ? 14 : 24} | ||
isDesktop={isDesktop} | ||
> | ||
{recentProjectList.slice(0, 6).map((project) => ( | ||
<RecentProjectListItem key={project.id} {...project} /> | ||
{recentProjectList.map((project, index) => ( | ||
<RecentProjectListItem key={index} {...project} /> | ||
))} | ||
</Carousel> | ||
); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,12 @@ export const useGetProjectList = ( | |
) => { | ||
const queryKey = ['getProjectList', category, platform]; | ||
return useQuery(queryKey, () => api.projectAPI.getProjectList(category, platform), { | ||
select: (data) => (sortType ? sortBy<ProjectType>(data, 'updatedAt') : data), | ||
select: (data) => { | ||
const filteredData = data.filter(({ link }) => | ||
link.some(({ title }) => ['website', 'appStore', 'googlePlay'].includes(title)), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이미 요런 처리를 해주셨군여.. 그럼 이대로 가도 좋을 것 같습니다!! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 호옥시 요런 필터 처리가 전체 프로젝트 목록에 영향을 주는지 한번만 봐주심 감사하겠습니다..!!! 제 기억으로는 ProjectPage에서도 사용하는 훅이여서요!! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 으아 이런 실수를... 수정하겠습니다..!!! 감사해요 |
||
); | ||
return sortType ? sortBy<ProjectType>(filteredData, 'updatedAt') : filteredData; | ||
}, | ||
staleTime: 30000, | ||
suspense: true, | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
요것은 변수인 것 같아서, 소문자로 시작하면 좋을 것 같습니다..!!