-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feat/261 #367
Merged
Merged
Feat/261 #367
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
7560bed
[refactor]: 함수 이름 변경(#261)
devkyoung2 30e67a9
[feat]: 진행중인 펀딩아이템 응답타입 지정(#261)
devkyoung2 e65c477
[feat]: 진행중인 펀딩아이템 api 요청 함수 작성(#261)
devkyoung2 38885c3
[feat]: 진행중인 펀딩아이템 데이터 페칭 및 적용(#261)
devkyoung2 386c434
[feat]: 진행중인 펀딩아이템 진행상황 컴포넌트 렌더링 및 실데이터 적용(#261)
devkyoung2 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,52 @@ | ||
import { useQuery } from '@tanstack/react-query'; | ||
|
||
import EmptyItem from 'components/feature/EmptyItem'; | ||
import Spinner from 'components/ui/Spinner'; | ||
import FundingItem from 'layouts/MyPage/Funding/FundingItem'; | ||
import FundingProgress from 'layouts/MyPage/Funding/FundingProgress'; | ||
|
||
import { useUserStore } from 'store/useUserStore'; | ||
|
||
import { getMyFundingItem } from 'services/api/v1/funding'; | ||
|
||
import styles from './index.module.scss'; | ||
|
||
// 목데이터 | ||
const data = { | ||
hasFunding: true, | ||
userName: '보경', | ||
fundingId: 1, | ||
imgUrl: | ||
'https://img1.kakaocdn.net/thumb/[email protected]/?fname=https%3A%2F%2Fst.kakaocdn.net%2Fproduct%2Fgift%2Fproduct%2F20240412000831_223be6cfd2eb40e3bbaf238fca8a56e9', | ||
fundingItemName: '참이 포함된 트레이드마크 체인 팔찌', | ||
fundingItemProductId: 9632965, | ||
fundingItemBrandName: '구찌', | ||
fundingItemBrandThumbnail: | ||
'https://img1.kakaocdn.net/thumb/[email protected]/?fname=https%3A%2F%2Fst.kakaocdn.net%2Fproduct%2Fgift%2Fgift_brand%2F20240402164826_a474afeeff5e42d9bfd4d64025303e32.png', | ||
fundingPrice: 600000, | ||
brandId: 11481, | ||
const isEmptyObject = (obj: object): boolean => { | ||
return Object.keys(obj).length === 0; | ||
}; | ||
|
||
const Funding = () => { | ||
const { name } = useUserStore(); | ||
const { data, isFetched, isLoading } = useQuery({ | ||
queryKey: ['myFundingItem'], | ||
queryFn: () => getMyFundingItem(), | ||
}); | ||
|
||
return ( | ||
<> | ||
<div className={styles.title}>{`${name}님의 \n펀딩아이템`}</div> | ||
{data.hasFunding ? ( | ||
<FundingItem | ||
fundingId={data.fundingId} | ||
imgUrl={data.imgUrl} | ||
price={data.fundingPrice} | ||
productName={data.fundingItemName} | ||
productId={data.fundingItemProductId} | ||
brandName={data.fundingItemBrandName} | ||
brandThumbnail={data.fundingItemBrandThumbnail} | ||
brandId={data.brandId} | ||
/> | ||
{isFetched && data && !isEmptyObject(data) ? ( | ||
<> | ||
<FundingItem | ||
fundingId={data.fundingId} | ||
productPhoto={data.productPhoto} | ||
goalAmount={data.goalAmount} | ||
productName={data.productName} | ||
productId={data.productId} | ||
brandName={data.brandName} | ||
brandPhoto={data.brandPhoto} | ||
brandId={data.brandId} | ||
/> | ||
<FundingProgress | ||
remainAmount={data.remainAmount} | ||
goalAmount={data.goalAmount} | ||
accumulateAmount={data.accumulateAmount} | ||
/> | ||
</> | ||
) : ( | ||
<EmptyItem type="funding" /> | ||
)} | ||
<div>펀딩 아이템 추천 영역</div> | ||
{isLoading && <Spinner />} | ||
</> | ||
); | ||
}; | ||
|
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
Oops, something went wrong.
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.
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.
#368 에서 이 함수를 추출하셨는데, 현재 PR에서는 추출되지 않은 상태로 사용하고 있어서, dev에 병합할 때 이 코드가 추출되지 않은 채 살아 있을 수도 있을 것 같아요.
#368 PR 병합하기 전에 이 PR이 병합되어야 할 것 같습니다. 혹시나 꼬이거나 할까봐 말씀드립니다..!!