-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Feat: 홈 페이지
- Loading branch information
Showing
17 changed files
with
640 additions
and
15 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,28 @@ | ||
import BookCover from '@/public/images/book-cover.png'; | ||
import Image from 'next/image'; | ||
|
||
export interface BookProps{ | ||
coverImg: string, | ||
title: string, | ||
writer?: string, | ||
date: string; | ||
} | ||
|
||
const Book = ({coverImg, title, writer, date}:BookProps)=>{ | ||
|
||
const handleClick = ()=> { | ||
alert(`${title}클릭! + 페이지 이동하기`); | ||
} | ||
|
||
return ( | ||
<div className="w-[150px] flex flex-col items-center justify-center gap-2 cursor-pointer" onClick={handleClick}> | ||
<Image src={BookCover} width={150} height={180} alt="logo"></Image> | ||
<h4 className="w-full text-base text-center truncate">{title}</h4> | ||
{writer && <h5 className="text-sm">{writer}</h5>} | ||
<h5 className="text-xs">{date}</h5> | ||
</div> | ||
|
||
); | ||
} | ||
|
||
export default Book; |
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,27 @@ | ||
import Book, { BookProps } from '@/components/Book'; | ||
|
||
interface BookListProps { | ||
visibleBookCount: number; | ||
currPage: number; | ||
contents: BookProps[]; | ||
} | ||
|
||
const BookList = ({ visibleBookCount, currPage, contents }: BookListProps) => { | ||
const visibleBooks = contents.slice(currPage * visibleBookCount, (currPage + 1) * visibleBookCount); | ||
|
||
return ( | ||
<div className="grid grid-cols-4 gap-10 mx-8"> | ||
{visibleBooks.map((book, index) => ( | ||
<Book | ||
key={index} | ||
coverImg={book.coverImg} | ||
title={book.title} | ||
writer={book.writer} | ||
date={book.date} | ||
/> | ||
))} | ||
</div> | ||
); | ||
}; | ||
|
||
export default BookList; |
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,41 @@ | ||
import { IconArrowDown, IconSearch } from '@/public/icons'; | ||
|
||
const SearchBar = ()=>{ | ||
return ( | ||
<div | ||
className="w-4/5 h-[60px] flex flex-row items-center gap-3 border-2 border-gray-200 rounded-3xl drop-shadow-sm"> | ||
<div className="flex flex-row items-center justify-evenly w-[125px] bg-gray-100 rounded-l-3xl"> | ||
<div className="text-xl pt-2 pb-2 pl-5"> | ||
All | ||
</div> | ||
<IconArrowDown | ||
alt="arrow down icon" | ||
width={20} | ||
height={11} | ||
className="top-10 cursor-pointer" | ||
onClick={() => { | ||
alert('검색 더보기 클릭!'); | ||
}} | ||
></IconArrowDown> | ||
</div> | ||
<div className="flex flex-row items-center justify-between pl-2 pr-2"> | ||
<input type="text" placeholder="Search" | ||
className="text text-xl h-full w-[470px] outline-0 no-underline placeholder-gray-300"> | ||
</input> | ||
<IconSearch | ||
alt="search icon" | ||
width={20} | ||
height={20} | ||
className="fixed right-5 cursor-pointer" | ||
onClick={() => { | ||
alert('검색 돋보기 클릭!'); | ||
}} | ||
></IconSearch> | ||
</div> | ||
</div> | ||
|
||
|
||
); | ||
} | ||
|
||
export default SearchBar; |
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,42 @@ | ||
interface SortingToggleProps { | ||
selected: string; | ||
onToggle: (selected: string) => void; | ||
} | ||
|
||
const SortingToggle = ({ selected, onToggle }: SortingToggleProps) => { | ||
return ( | ||
<div className="w-[340px] h-[40px] flex flex-row rounded-3xl bg-[#EEEEEE]"> | ||
<div | ||
className={`flex flex-1 h-full items-center justify-center rounded-3xl cursor-pointer transition-colors duration-300 ${ | ||
selected === 'recent' ? 'bg-[#2E2E2E]' : 'bg-[#EEEEEE]' | ||
}`} | ||
onClick={() => onToggle('recent')} | ||
> | ||
<h5 | ||
className={`text-[16px] transition-colors duration-300 ${ | ||
selected === 'recent' ? 'font-semibold text-[#EEEEEE]' : 'font-normal text-[#2E2E2E]' | ||
}`} | ||
> | ||
최신순 | ||
</h5> | ||
</div> | ||
|
||
<div | ||
className={`flex flex-1 h-full items-center justify-center rounded-3xl cursor-pointer transition-colors duration-300 ${ | ||
selected === 'name' ? 'bg-[#2E2E2E]' : 'bg-[#EEEEEE]' | ||
}`} | ||
onClick={() => onToggle('name')} | ||
> | ||
<h5 | ||
className={`text-[16px] transition-colors duration-300 ${ | ||
selected === 'name' ? 'font-semibold text-[#EEEEEE]' : 'font-normal text-[#2E2E2E]' | ||
}`} | ||
> | ||
이름순 | ||
</h5> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default SortingToggle; |
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,101 @@ | ||
export const writingBooks = [ | ||
{ | ||
coverImg: '/path/to/cover1.png', | ||
title: 'Don\'t Make Me Think', | ||
writer: 'Steve Krug', | ||
date: '2024-08-16', | ||
}, | ||
{ | ||
coverImg: '/path/to/cover2.png', | ||
title: 'The Design of Everyday Things', | ||
writer: 'Don Norman', | ||
date: '2024-08-20', | ||
}, | ||
{ | ||
coverImg: '/path/to/cover3.png', | ||
title: 'Sprint: How to solve big problems...', | ||
writer: 'Jake Knapp', | ||
date: '2024-08-22', | ||
}, | ||
{ | ||
coverImg: '/path/to/cover4.png', | ||
title: 'Lean UX: Design Great Products', | ||
writer: 'Jeff Gothelf', | ||
date: '2024-08-23', | ||
}, | ||
{ | ||
coverImg: '/path/to/cover1.png', | ||
title: 'Don\'t Make Me Think', | ||
writer: 'Steve Krug', | ||
date: '2024-08-23', | ||
}, | ||
{ | ||
coverImg: '/path/to/cover2.png', | ||
title: 'The Design of Everyday Things', | ||
writer: 'Don Norman', | ||
date: '2024-08-24', | ||
}, | ||
{ | ||
coverImg: '/path/to/cover3.png', | ||
title: 'Sprint: How to solve big problems...', | ||
writer: 'Jake Knapp', | ||
date: '2024-08-25', | ||
}, | ||
{ | ||
coverImg: '/path/to/cover3.png', | ||
title: 'Sprint: How to solve big problems...', | ||
writer: 'Jake Knapp', | ||
date: '2024-08-25', | ||
}, | ||
{ | ||
coverImg: '/path/to/cover3.png', | ||
title: 'Sprint: How to solve big problems...', | ||
writer: 'Jake Knapp', | ||
date: '2024-08-25', | ||
}, | ||
]; | ||
|
||
export const doneBooks = [ | ||
{ | ||
coverImg: '/path/to/cover1.png', | ||
title: 'Don\'t Make Me Think', | ||
writer: 'Steve Krug', | ||
date: '2000', | ||
}, | ||
{ | ||
coverImg: '/path/to/cover2.png', | ||
title: 'The Design of Everyday Things', | ||
writer: 'Don Norman', | ||
date: '1988', | ||
}, | ||
{ | ||
coverImg: '/path/to/cover3.png', | ||
title: 'Sprint: How to solve big problems...', | ||
writer: 'Jake Knapp', | ||
date: '2000', | ||
}, | ||
{ | ||
coverImg: '/path/to/cover4.png', | ||
title: 'Lean UX: Design Great Products', | ||
writer: 'Jeff Gothelf', | ||
date: '2016', | ||
}, | ||
{ | ||
coverImg: '/path/to/cover1.png', | ||
title: 'Don\'t Make Me Think', | ||
writer: 'Steve Krug', | ||
date: '2000', | ||
}, | ||
{ | ||
coverImg: '/path/to/cover2.png', | ||
title: 'The Design of Everyday Things', | ||
writer: 'Don Norman', | ||
date: '1988', | ||
}, | ||
{ | ||
coverImg: '/path/to/cover3.png', | ||
title: 'Sprint: How to solve big problems...', | ||
writer: 'Jake Knapp', | ||
date: '2000', | ||
}, | ||
]; |
Oops, something went wrong.