Skip to content

Commit

Permalink
[Feat] Category Components 생성
Browse files Browse the repository at this point in the history
  • Loading branch information
sangmee123 committed Mar 15, 2024
1 parent d3b30ac commit d0fc284
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/components/Category.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { css } from '@emotion/react'
import categoriesArray from './Sample/Sample'

const category = css`
display: flex;
align-items: center;
background-color: #f3f0f0;
width: 80%;
height: 33px;
border-radius: 6px;
margin-bottom: 20px;
ul {
list-style: none;
li {
margin-right: 10px;
float: left;
}
}
`
const Category = () => {
return (
<div css={category}>
<ul>
<li>전체</li>
{categoriesArray.map((list, id) => id < 3 && <li key={id}>{list}</li>)}
</ul>
</div>
)
}

export default Category
2 changes: 2 additions & 0 deletions src/components/Sample/Sample.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
const categoriesArray = Array(10).fill(['카테고리'])
export default categoriesArray
2 changes: 2 additions & 0 deletions src/pages/Readinglog.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import Search from '../components/Search'
import Topbar from '../components/Topbar'
import Category from '../components/Category'

const ReadingLog = () => {
return (
<div>
<Topbar />
<Search placeholder="책 제목으로 검색하기" />
<Category />
</div>
)
}
Expand Down

0 comments on commit d0fc284

Please sign in to comment.