-
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 #32 from team-nabi/NABI-59
🎉 ItemListPage 컴포넌트 UI 완성
- Loading branch information
Showing
14 changed files
with
162 additions
and
4 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 |
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.
67 changes: 67 additions & 0 deletions
67
src/app/(root)/(routes)/items/components/Item-list/ItemList.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,67 @@ | ||
import Image from 'next/image' | ||
import TradeStateCard from '@/components/domain/card/trade-state-card' | ||
import Assets from '@/config/assets' | ||
import { Item } from '@/types' | ||
import SearchInput from '../search-input' | ||
|
||
const list = [ | ||
{ | ||
_id: 1, // 내려줄 때 리스트 순서 | ||
cardId: 1, | ||
cardTitle: '아이폰 16 팝니다', | ||
itemName: '아이폰 16', | ||
createdAt: '2023-11-01T08:08:00', | ||
modifiedAt: '2023-11-01T08:08:00', | ||
dibCount: 19, | ||
priceRange: '10000-50000', | ||
image: | ||
'https://cdn.cetizen.com/CDN/market/market_large_crop/202203/20220318/220318152808_1_2913635.jpg', | ||
tradeState: 'impossible', | ||
}, | ||
{ | ||
_id: 2, // 내려줄 때 리스트 순서 | ||
cardId: 1, | ||
cardTitle: '아이폰 16 팝니다', | ||
itemName: '아이폰 16', | ||
createdAt: '2023-11-01T08:08:00', | ||
modifiedAt: '2023-11-01T08:08:00', | ||
dibCount: 19, | ||
priceRange: '10000-50000', | ||
image: | ||
'https://cdn.cetizen.com/CDN/market/market_large_crop/202203/20220318/220318152808_1_2913635.jpg', | ||
tradeState: 'impossible', | ||
}, | ||
{ | ||
_id: 3, // 내려줄 때 리스트 순서 | ||
cardId: 1, | ||
cardTitle: '아이폰 16 팝니다', | ||
itemName: '아이폰 16', | ||
createdAt: '2023-11-01T08:08:00', | ||
modifiedAt: '2023-11-01T08:08:00', | ||
dibCount: 19, | ||
priceRange: '10000-50000', | ||
image: | ||
'https://cdn.cetizen.com/CDN/market/market_large_crop/202203/20220318/220318152808_1_2913635.jpg', | ||
tradeState: 'impossible', | ||
}, | ||
] | ||
|
||
const ItemList = () => { | ||
return ( | ||
<div> | ||
<div className="h-9 flex justify-between items-center mb-6"> | ||
<SearchInput placeholder="찾으시는 물품을 입력해주세요." /> | ||
<div className="h-6 flex gap-2"> | ||
<Image src={Assets.filterIcon} alt="필터 아이콘" />{' '} | ||
<div className="flex">필터</div> | ||
</div> | ||
</div> | ||
<div> | ||
{list.map((item: Item) => ( | ||
<TradeStateCard key={item._id} item={item} className="mb-6" /> | ||
))} | ||
</div> | ||
</div> | ||
) | ||
} | ||
export default ItemList |
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 ItemList from './ItemList' | ||
|
||
export default ItemList |
29 changes: 29 additions & 0 deletions
29
src/app/(root)/(routes)/items/components/search-input/SearchInput.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,29 @@ | ||
import React from 'react' | ||
import Input from '@/components/ui/Input' | ||
import { InputProps } from '@/components/ui/Input/Input' | ||
|
||
const SearchInput = ({ ...props }: InputProps) => { | ||
return ( | ||
<div className="relative w-4/5"> | ||
<Input {...props} /> | ||
<div className="absolute right-3 top-2.5 pointer-events-none"> | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
className="h-5 w-5 text-gray-400" | ||
viewBox="0 0 20 20" | ||
fill="currentColor" | ||
> | ||
<path | ||
fillRule="evenodd" | ||
d="M9 16a7 7 0 100-14 7 7 0 000 14zm0 1a8 8 0 100-16 8 8 0 000 16zm5.293-11.293a1 1 0 00-1.414-1.414l-4 4a1 1 0 001.414 1.414l4-4z" | ||
clipRule="evenodd" | ||
/> | ||
</svg> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
SearchInput.displayName = 'SearchInput' | ||
|
||
export default SearchInput |
3 changes: 3 additions & 0 deletions
3
src/app/(root)/(routes)/items/components/search-input/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 SearchInput from './SearchInput' | ||
|
||
export default SearchInput |
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,16 @@ | ||
import { FunctionComponent } from 'react' | ||
import PageTitle from '@/components/domain/page-title' | ||
import ItemList from './components/Item-list' | ||
|
||
interface ItemListPageProps {} | ||
|
||
const ItemListPage: FunctionComponent<ItemListPageProps> = ({}) => { | ||
return ( | ||
<div> | ||
<PageTitle title="물건 목록" /> | ||
<ItemList /> | ||
</div> | ||
) | ||
} | ||
|
||
export default ItemListPage |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import Image from 'next/image' | ||
import Assets from '@/config/assets' | ||
|
||
const PageTitle = ({ title }: { title: string }) => { | ||
return ( | ||
<div className="flex grid items-center justify-between w-full grid-cols-3 h-8 my-4"> | ||
<Image | ||
src={Assets.arrowLeftIcon} | ||
alt="이전 아이콘" | ||
className="flex justify-start items-center" | ||
/> | ||
<h2 className="flex justify-center items-center text-xl font-bold"> | ||
{title} | ||
</h2> | ||
<div></div> | ||
</div> | ||
) | ||
} | ||
export default PageTitle |
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 PageTitle from './PageTitle' | ||
|
||
export default PageTitle |
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