-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #92 from team-nabi/NABI-262
🎉 제안 수락, 거절 API 연결 및 기타 작업
- Loading branch information
Showing
25 changed files
with
236 additions
and
136 deletions.
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
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
36 changes: 0 additions & 36 deletions
36
src/app/(root)/(routes)/mypage/suggestions/[cardId]/page.tsx
This file was deleted.
Oops, something went wrong.
70 changes: 70 additions & 0 deletions
70
...uggestions/[myCardId]/components/my-card-description-section/MyCardDescriptionSection.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,70 @@ | ||
import formatDistanceToNow from 'date-fns/formatDistanceToNow' | ||
import koLocale from 'date-fns/locale/ko' | ||
import Link from 'next/link' | ||
import Badge from '@/components/ui/badge' | ||
import { CardFlex, CardImage, CardText } from '@/components/ui/card' | ||
import AppPath from '@/config/appPath' | ||
import { CardDetail } from '@/types/card' | ||
|
||
const TradeAvailableBadge = () => <Badge variant={'primary'}>거래가능</Badge> | ||
const ReservedBadge = () => <Badge variant={'secondary'}>예약중</Badge> | ||
|
||
type MyCardDescriptionSection = { | ||
card: CardDetail | ||
} | ||
|
||
const MyCardDescriptionSection = ({ | ||
card: { | ||
cardId, | ||
thumbnail, | ||
cardTitle, | ||
status, | ||
itemName, | ||
priceRange, | ||
createdAt, | ||
}, | ||
}: MyCardDescriptionSection) => ( | ||
<Link href={`${AppPath.cards()}/${cardId}`} className="w-full"> | ||
<div className="flex h-card-lg p-1.5 justify-center w-full"> | ||
<CardFlex | ||
direction={'row'} | ||
justify={'start'} | ||
align={'center'} | ||
gap={'space'} | ||
className="w-full h-full" | ||
> | ||
<div className="relative w-1/3 h-full"> | ||
<CardImage | ||
className="rounded-lg border border-background-secondary-color" | ||
src={thumbnail} | ||
alt="이미지가 없습니다." | ||
layout="fill" | ||
objectFit="cover" | ||
/> | ||
</div> | ||
|
||
<CardFlex | ||
direction={'col'} | ||
justify={'between'} | ||
className="w-2/3 h-full" | ||
> | ||
<CardFlex align={'center'} gap={'space'}> | ||
<CardText type={'title'}>{cardTitle}</CardText> | ||
{status === 'TRADE_AVAILABLE' ? ( | ||
<TradeAvailableBadge /> | ||
) : ( | ||
<ReservedBadge /> | ||
)} | ||
</CardFlex> | ||
<CardText type={'description'}>{itemName}</CardText> | ||
<CardText type={'description'}>{priceRange}</CardText> | ||
<CardText type={'date'}> | ||
{formatDistanceToNow(new Date(createdAt), { locale: koLocale })} | ||
</CardText> | ||
</CardFlex> | ||
</CardFlex> | ||
</div> | ||
</Link> | ||
) | ||
|
||
export default MyCardDescriptionSection |
3 changes: 3 additions & 0 deletions
3
...)/(routes)/mypage/suggestions/[myCardId]/components/my-card-description-section/index.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,3 @@ | ||
import MyCardDescriptionSection from './MyCardDescriptionSection' | ||
|
||
export default MyCardDescriptionSection |
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
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.