-
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.
- Loading branch information
Showing
42 changed files
with
1,125 additions
and
85 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = {} | ||
const nextConfig = { | ||
images: { | ||
domains: ['cdn.cetizen.com'], | ||
}, | ||
} | ||
|
||
module.exports = nextConfig |
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
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
92 changes: 92 additions & 0 deletions
92
src/app/(root)/(routes)/items/[itemId]/components/description-section/DescriptionSection.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,92 @@ | ||
import Image from 'next/image' | ||
import Badge from '@/components/ui/Badge' | ||
import Button from '@/components/ui/Button' | ||
import { | ||
DropdownMenu, | ||
DropdownMenuTrigger, | ||
DropdownMenuContent, | ||
DropdownMenuGroup, | ||
DropdownMenuItem, | ||
} from '@/components/ui/DropdownMenu' | ||
import Assets from '@/config/assets' | ||
import { TYPHOGRAPHY } from '@/styles/sizes' | ||
import { ItemDetail } from '@/types' | ||
import { cn } from '@/utils' | ||
import Dibs from './Dibs' | ||
|
||
type DescriptionSectionProps = { | ||
itemData: ItemDetail | ||
} | ||
|
||
type TradeStateMap = { | ||
[key: string]: { | ||
style: 'primary' | 'secondary' | 'gradation' | 'information' | ||
text: '거래가능' | '예약중' | '거래성사' | ||
} | ||
} | ||
|
||
const DescriptionSection = ({ | ||
itemData: { status, cardTitle, category, createdAt, dibsCount, content }, | ||
}: DescriptionSectionProps) => { | ||
const tradeStateMap: TradeStateMap = { | ||
TRADE_AVAILABLE: { | ||
style: 'primary', | ||
text: '거래가능', | ||
}, | ||
RESERVED: { | ||
style: 'secondary', | ||
text: '예약중', | ||
}, | ||
TRADE_COMPLETE: { | ||
style: 'gradation', | ||
text: '거래성사', | ||
}, | ||
} | ||
return ( | ||
<article className="flex flex-col w-full pt-4 pb-8 border-b-[1px] gap-4"> | ||
<div className="flex flex-row items-center"> | ||
<Badge variant={tradeStateMap[status].style}> | ||
{tradeStateMap[status].text} | ||
</Badge> | ||
<h3 className={cn('ml-2', TYPHOGRAPHY.title)}>{cardTitle}</h3> | ||
<MoreButton /> | ||
</div> | ||
<div className="flex flex-row items-center"> | ||
<p | ||
className={cn( | ||
'mr-2 text-text-secondary-color', | ||
TYPHOGRAPHY.description, | ||
)} | ||
> | ||
<u>{category}</u> | ||
</p> | ||
<p className={cn('text-text-secondary-color', TYPHOGRAPHY.description)}> | ||
{createdAt} | ||
</p> | ||
<Dibs count={dibsCount} /> | ||
</div> | ||
<p className="">{content}</p> | ||
</article> | ||
) | ||
} | ||
|
||
export default DescriptionSection | ||
|
||
const MoreButton = () => { | ||
return ( | ||
<DropdownMenu> | ||
<DropdownMenuTrigger asChild> | ||
<Button className="ml-auto" size="icon_sm" variant={null}> | ||
<Image src={Assets.vMoreIcon} alt="more" /> | ||
</Button> | ||
</DropdownMenuTrigger> | ||
<DropdownMenuContent> | ||
<DropdownMenuGroup> | ||
<DropdownMenuItem>수정하기</DropdownMenuItem> | ||
<DropdownMenuItem>삭제하기</DropdownMenuItem> | ||
<DropdownMenuItem>거래완료</DropdownMenuItem> | ||
</DropdownMenuGroup> | ||
</DropdownMenuContent> | ||
</DropdownMenu> | ||
) | ||
} |
19 changes: 19 additions & 0 deletions
19
src/app/(root)/(routes)/items/[itemId]/components/description-section/Dibs.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,19 @@ | ||
import Image from 'next/image' | ||
import Button from '@/components/ui/Button' | ||
import Assets from '@/config/assets' | ||
|
||
type DibsProps = { | ||
count: number | ||
} | ||
const Dibs = ({ count }: DibsProps) => { | ||
return ( | ||
<div className="flex flex-row gap-0 items-center ml-auto"> | ||
<Button size="icon_sm" variant={null}> | ||
<Image src={Assets.heartIcon} alt="dibs" /> | ||
</Button> | ||
<p className="ml-1">{count}</p> | ||
</div> | ||
) | ||
} | ||
|
||
export default Dibs |
3 changes: 3 additions & 0 deletions
3
src/app/(root)/(routes)/items/[itemId]/components/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 DescriptionSection from './DescriptionSection' | ||
|
||
export default DescriptionSection |
23 changes: 23 additions & 0 deletions
23
src/app/(root)/(routes)/items/[itemId]/components/trade-section/TradeInfo.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,23 @@ | ||
import Image from 'next/image' | ||
import Badge from '@/components/ui/Badge' | ||
import Assets from '@/config/assets' | ||
|
||
type TradeInfoProps = { | ||
title: string | ||
content: string | ||
variant: 'primary' | 'information' | ||
} | ||
|
||
const TradeInfo = ({ title, content, variant }: TradeInfoProps) => { | ||
return ( | ||
<div className="flex flex-row items-center"> | ||
<Image src={Assets.moneyIcon} alt="infoImg" /> | ||
<div className="text-sm ml-2 font-normal">{title}</div> | ||
<Badge size={'lg'} variant={variant} className="ml-auto"> | ||
{content} | ||
</Badge> | ||
</div> | ||
) | ||
} | ||
|
||
export default TradeInfo |
45 changes: 45 additions & 0 deletions
45
src/app/(root)/(routes)/items/[itemId]/components/trade-section/TradeSection.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,45 @@ | ||
import Button from '@/components/ui/Button' | ||
import TradeInfo from './TradeInfo' | ||
|
||
type TradeSectionProps = { | ||
priceRange: string | ||
tradeType: string | ||
tradeArea: string | ||
} | ||
|
||
type TradeInfo = { | ||
title: string | ||
content: string | ||
variant: 'primary' | 'information' | ||
} | ||
|
||
const TradeSection = ({ | ||
priceRange, | ||
tradeType, | ||
tradeArea, | ||
}: TradeSectionProps) => { | ||
const tradeInfo: TradeInfo[] = [ | ||
{ title: '가격대', content: priceRange, variant: 'primary' }, | ||
{ title: '거래 방식', content: tradeType, variant: 'information' }, | ||
{ title: '거래 지역', content: tradeArea, variant: 'information' }, | ||
] | ||
|
||
return ( | ||
<section className="flex flex-col gap-2 w-full pt-4"> | ||
{tradeInfo.map((v, i) => ( | ||
<TradeInfo | ||
key={i} | ||
title={v.title} | ||
content={v.content} | ||
variant={v.variant} | ||
/> | ||
))} | ||
|
||
<Button className="mt-6" variant={'primary'}> | ||
제안 확인하기 | ||
</Button> | ||
</section> | ||
) | ||
} | ||
|
||
export default TradeSection |
3 changes: 3 additions & 0 deletions
3
src/app/(root)/(routes)/items/[itemId]/components/trade-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 TradeSection from './TradeSection' | ||
|
||
export default TradeSection |
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.