-
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.
- Loading branch information
1 parent
d0fc284
commit 1624b59
Showing
12 changed files
with
174 additions
and
13 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
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.
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,114 @@ | ||
import { css } from '@emotion/react' | ||
import { useState } from 'react' | ||
|
||
const feedBox = css` | ||
background: #f8f6f6; | ||
width: 80%; | ||
height: 172px; | ||
border-radius: 6px; | ||
margin-bottom: 30px; | ||
` | ||
const bookTitle = css` | ||
display: flex; | ||
align-items: center; | ||
background-color: #f3f0f0; | ||
width: 100%; | ||
height: 30px; | ||
border-radius: 6px; | ||
span { | ||
font-size: 16px; | ||
margin: auto; | ||
} | ||
` | ||
|
||
const bookInfo = css` | ||
display: flex; | ||
width: 93%; | ||
height: 100px; | ||
margin-top: 15px; | ||
span { | ||
width: 70%; | ||
font-size: 13px; | ||
margin-top: 15px; | ||
margin-left: 15px; | ||
} | ||
` | ||
|
||
const skeletonImg = css` | ||
background: #d9d9d9; | ||
display: inline-block; | ||
width: 72px; | ||
height: 97px; | ||
` | ||
|
||
const userInfo = css` | ||
display: flex; | ||
align-items: center; | ||
justify-content: right; | ||
width: 100%; | ||
height: 30px; | ||
font-size: 13px; | ||
span { | ||
margin-right: 10px; | ||
&:last-child { | ||
margin-right: 15px; | ||
} | ||
} | ||
img { | ||
width: 15px; | ||
margin-top: 2px; | ||
margin-left: 10px; | ||
margin-right: 5px; | ||
} | ||
` | ||
|
||
interface User { | ||
nickname: string | ||
date: string | ||
} | ||
|
||
interface FeedProps { | ||
user: User | ||
} | ||
|
||
const Feed: React.FC<FeedProps> = ({ user }) => { | ||
const [imageSrc, setImageSrc] = useState('../assets/images/free-icon-love.png') | ||
|
||
const oneLine: string = '한 줄 평이 여기에 표시됩니다. 한 줄 평이 여기에 표시됩니다.' | ||
const like: number = 0 | ||
|
||
const handleToggle = () => { | ||
// 좋아요 하트 아이콘 | ||
setImageSrc(prev => { | ||
if (prev === '../assets/images/free-icon-love.png') { | ||
return '../assets/images/free-icon-love-fill.png' | ||
} else { | ||
return '../assets/images/free-icon-love.png' | ||
} | ||
}) | ||
} | ||
|
||
return ( | ||
<div css={feedBox}> | ||
<div css={bookTitle}> | ||
<span>책 제목</span> | ||
</div> | ||
|
||
<div css={bookInfo}> | ||
<div css={skeletonImg}> | ||
<img></img> | ||
</div> | ||
<span>"{oneLine}"</span> | ||
</div> | ||
|
||
<div css={userInfo}> | ||
<span>{user.nickname}</span> | ||
<span>{user.date}</span> | ||
<img src={imageSrc} onClick={handleToggle} /> | ||
<span>{like}</span> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default Feed |
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 @@ | ||
const users = [ | ||
{ nickname: '초코', date: '2023-07-25' }, | ||
{ nickname: '바나나', date: '2024-01-15' }, | ||
{ nickname: '딸기우유', date: '2024-02-07' }, | ||
{ nickname: '안녕하세요', date: '2022-04-15' }, | ||
{ nickname: '호이쨔아아아', date: '2022-04-15' }, | ||
{ nickname: '언제나함께라면', date: '2022-04-15' }, | ||
{ nickname: '프로바이오유산균', date: '2022-04-15' }, | ||
{ nickname: '프론트백엔드개발자', date: '2022-04-15' }, | ||
{ nickname: '굿모닝우유와함께한잔', date: '2022-04-15' }, | ||
{ nickname: '아메리카노헤이즐넛맛추', date: '2022-04-15' }, | ||
{ nickname: '가나다라마바사아자차카타', date: '2022-04-15' }, | ||
{ nickname: '가나다라마바사아자차카타파', date: '2022-04-15' }, | ||
{ nickname: '가나다라마바사아자차카타파하', date: '2022-04-15' }, | ||
] | ||
export default users |
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,2 +1,3 @@ | ||
const categoriesArray = Array(10).fill(['카테고리']) | ||
export default categoriesArray | ||
let categories: string[] = ['전체'] | ||
categories = categories.concat(Array(10).fill('카테고리')) | ||
export default categories |
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
Empty file.