-
Notifications
You must be signed in to change notification settings - Fork 0
유저페이지 카테고리 분리, 공지사항 상세 인피티니 삭제, FAQ 더보기 애니메이션 추가 (#isseu 302) #304
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
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
fb47257
refactor: 다른 유저페이지에 기획, 참여 프로젝트 분리, 커스텀훅에서 분기처리하여 api 사용하기
YouD0313 6d9924c
refactor: 조회수 기능 위해 staleTime, gcTime 삭제
YouD0313 15d779b
refactor: 필요없는 코드 삭제
YouD0313 ca28be2
design: 더보기 버튼 호버시 애니메이션 추가
YouD0313 b3d674b
refactor: 데이터가 없을때 noContent를 띄워주게 설정
YouD0313 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
71 changes: 0 additions & 71 deletions
71
src/components/user/userPage/joinedProject/UserJoinProject.tsx
This file was deleted.
Oops, something went wrong.
44 changes: 44 additions & 0 deletions
44
src/components/user/userPage/userProjectList/UserProjectList.tsx
This file contains hidden or 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,44 @@ | ||
| import { Link } from 'react-router-dom'; | ||
| import * as S from '../../mypage/joinedProject/MyJoinProjects.styled'; | ||
| import { ROUTES } from '../../../../constants/user/routes'; | ||
| import NoContent from '../../../common/noContent/NoContent'; | ||
| import ScrollWrapper from '../../mypage/ScrollWrapper'; | ||
| import Spinner from '../../mypage/Spinner'; | ||
| import Project from '../../mypage/joinedProject/Project'; | ||
| import { useGetUserProjectList } from '../../../../hooks/user/useGetUserProjectList'; | ||
|
|
||
| export default function UserProjects() { | ||
| const { userProjectData, isLoading, title } = useGetUserProjectList(); | ||
|
|
||
| if (isLoading) { | ||
| return <Spinner />; | ||
| } | ||
|
|
||
| if (!userProjectData) return; | ||
|
|
||
| return ( | ||
| <S.Container> | ||
| <S.FilterWrapper> | ||
| <S.FilterTitle>{title}</S.FilterTitle> | ||
| </S.FilterWrapper> | ||
| {userProjectData && userProjectData.length > 0 ? ( | ||
| <ScrollWrapper> | ||
| <S.WrapperProject> | ||
| {userProjectData?.map((project) => ( | ||
| <Link | ||
| key={project.id} | ||
| to={`${ROUTES.projectDetail}/${project.id}`} | ||
| > | ||
| <Project project={project} /> | ||
| </Link> | ||
| ))} | ||
| </S.WrapperProject> | ||
| </ScrollWrapper> | ||
| ) : ( | ||
| <S.NoWrapper> | ||
| <NoContent type='projects' /> | ||
| </S.NoWrapper> | ||
| )} | ||
| </S.Container> | ||
| ); | ||
| } | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,27 @@ | ||
| import { useQuery } from '@tanstack/react-query'; | ||
| import { | ||
| getUserJoinedProjectList, | ||
| getUserManagedProjectList, | ||
| } from '../../api/userpage.api'; | ||
| import { userInfoKey } from '../queries/user/keys'; | ||
| import { useLocation, useParams } from 'react-router-dom'; | ||
| import type { ApiUserProject } from '../../models/userProject'; | ||
|
|
||
| export const useGetUserProjectList = () => { | ||
| const { userId } = useParams(); | ||
| const location = useLocation(); | ||
| const isJoinedPage = location.pathname.includes('joined') ? true : false; | ||
| const title = isJoinedPage | ||
| ? '참여한 프로젝트 리스트' | ||
| : '기획한 프로젝트 리스트'; | ||
|
|
||
| const { data, isLoading } = useQuery<ApiUserProject>({ | ||
| queryKey: [userInfoKey.userManagedList, userId, isJoinedPage], | ||
| queryFn: () => | ||
| isJoinedPage | ||
| ? getUserJoinedProjectList(Number(userId)) | ||
| : getUserManagedProjectList(Number(userId)), | ||
| }); | ||
|
|
||
| return { userProjectData: data?.data, isLoading, title }; | ||
| }; |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.