Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
리액트 심화 과정 - 3강 /write 페이지에서 수정 기능 만들고 알림 컴포넌트 만들기
- Loading branch information
Showing
12 changed files
with
234 additions
and
18 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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import React from "react"; | ||
import { Grid, Image, Text } from "../elements"; | ||
|
||
const Card = (props) => { | ||
return ( | ||
<React.Fragment> | ||
<Grid padding="16px" is_flex bg="#fff"> | ||
<Grid width="auto" margin="8px 8px 0 0"> | ||
<Image size="85" image_url={props.image_url}></Image> | ||
</Grid> | ||
<Grid> | ||
<Text> | ||
<b>{props.user_name}</b> 님이 게시글에 댓글을 남겼습니다. | ||
</Text> | ||
</Grid> | ||
</Grid> | ||
</React.Fragment> | ||
); | ||
}; | ||
|
||
Card.defaultProps = { | ||
image_url: "", | ||
user_name: "", | ||
post_id: null, | ||
}; | ||
|
||
export default Card; |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import React from "react"; | ||
import { Grid, Text, Image } from "../elements"; | ||
import Card from "../components/Card"; | ||
|
||
const Notification = (props) => { | ||
let noti = [ | ||
{ | ||
user_name: "aaaa", | ||
post_id: "post1", | ||
image_url: "", | ||
}, | ||
{ | ||
user_name: "aaaa", | ||
post_id: "post2", | ||
image_url: "", | ||
}, | ||
{ | ||
user_name: "aaaa", | ||
post_id: "post3", | ||
image_url: "", | ||
}, | ||
{ | ||
user_name: "aaaa", | ||
post_id: "post4", | ||
image_url: "", | ||
}, | ||
{ | ||
user_name: "aaaa", | ||
post_id: "post5", | ||
image_url: "", | ||
}, | ||
{ | ||
user_name: "aaaa", | ||
post_id: "post6", | ||
image_url: "", | ||
}, | ||
]; | ||
return ( | ||
<> | ||
<Grid padding="16px" bg="#EFF6FF"> | ||
{noti.map((n) => { | ||
return <Card key={n.post_id} {...n}></Card>; | ||
})} | ||
</Grid> | ||
</> | ||
); | ||
}; | ||
|
||
export default Notification; |
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
Oops, something went wrong.