-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: zereight <[email protected]>
- Loading branch information
Showing
14 changed files
with
142 additions
and
23 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,10 +1,4 @@ | ||
module.exports = { | ||
"stories": [ | ||
"../src/**/*.stories.mdx", | ||
"../src/**/*.stories.@(js|jsx|ts|tsx)" | ||
], | ||
"addons": [ | ||
"@storybook/addon-links", | ||
"@storybook/addon-essentials" | ||
] | ||
} | ||
stories: ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"], | ||
addons: ["@storybook/addon-links", "@storybook/addon-essentials"] | ||
}; |
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,4 @@ | ||
#root { | ||
width: 100%; | ||
max-width: 1080px; | ||
} |
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
13 changes: 2 additions & 11 deletions
13
frontend/reply-module/src/components/molecules/Comment/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
41 changes: 41 additions & 0 deletions
41
frontend/reply-module/src/components/organisms/CommentList/CommentList.stories.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,41 @@ | ||
import { Story } from "@storybook/react"; | ||
import CommentList, { Props } from "."; | ||
|
||
export default { | ||
title: "organisms/CommentList", | ||
component: CommentList, | ||
argTypes: { children: { control: "text" } } | ||
}; | ||
|
||
const Template: Story<Props> = args => <CommentList {...args} />; | ||
|
||
export const Default = Template.bind({}); | ||
|
||
Default.args = { | ||
comments: [ | ||
{ | ||
id: 1, | ||
content: "Donec accumsan neque enim sodales. Neque eget vulputate viverra convallis pharetra.", | ||
user: { | ||
id: 1, | ||
imageURL: | ||
"https://static.independent.co.uk/s3fs-public/thumbnails/image/2015/06/06/15/Chris-Pratt.jpg?width=982&height=726&auto=webp&quality=75", | ||
nickName: "Robert Hill", | ||
type: "Authorized" | ||
}, | ||
createdAt: "1시간 전" | ||
}, | ||
{ | ||
id: 2, | ||
content: "Donec accumsan neque enim sodales. Neque eget vulputate viverra convallis pharetra.", | ||
user: { | ||
id: 1, | ||
imageURL: | ||
"https://static.independent.co.uk/s3fs-public/thumbnails/image/2015/06/06/15/Chris-Pratt.jpg?width=982&height=726&auto=webp&quality=75", | ||
nickName: "Robert Hill", | ||
type: "Authorized" | ||
}, | ||
createdAt: "1시간 전" | ||
} | ||
] | ||
}; |
28 changes: 28 additions & 0 deletions
28
frontend/reply-module/src/components/organisms/CommentList/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,28 @@ | ||
import { Comment as CommentType } from "../../../types"; | ||
import Comment from "../../molecules/Comment"; | ||
import { CommentContainer, Container, OrderButton, OrderButtonCotainer, OrderButtonWrapper } from "./styles"; | ||
|
||
export interface Props { | ||
comments: CommentType[]; | ||
} | ||
|
||
const CommentList = ({ comments }: Props) => { | ||
return ( | ||
<Container> | ||
<OrderButtonCotainer> | ||
<OrderButtonWrapper> | ||
<OrderButton type="button">최신순</OrderButton> | ||
<OrderButton type="button">공감순</OrderButton> | ||
<OrderButton type="button">과거순</OrderButton> | ||
</OrderButtonWrapper> | ||
</OrderButtonCotainer> | ||
<CommentContainer> | ||
{comments.map(comment => ( | ||
<Comment comment={comment} key={comment.id} shouldShowOption align="right" /> | ||
))} | ||
</CommentContainer> | ||
</Container> | ||
); | ||
}; | ||
|
||
export default CommentList; |
44 changes: 44 additions & 0 deletions
44
frontend/reply-module/src/components/organisms/CommentList/styles.ts
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,44 @@ | ||
import { PALETTE } from "./../../../styles/palette"; | ||
import styled from "styled-components"; | ||
|
||
const Container = styled.section` | ||
width: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
`; | ||
|
||
const OrderButtonCotainer = styled.div` | ||
width: 100%; | ||
display: flex; | ||
justify-content: flex-end; | ||
align-items: flex-start; | ||
border-bottom: 1px solid ${PALETTE.BLACK_700}; | ||
padding-bottom: 1.6rem; | ||
`; | ||
|
||
const OrderButtonWrapper = styled.div` | ||
display: flex; | ||
`; | ||
|
||
const OrderButton = styled.button` | ||
color: ${PALETTE.BLACK_700}; | ||
font-size: 1.6rem; | ||
font-weight: 700; | ||
background-color: transparent; | ||
`; | ||
|
||
const CommentContainer = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
margin: 3rem 0; | ||
& > * { | ||
margin-bottom: 1.6rem; | ||
&:last-child { | ||
margin-bottom: 0; | ||
} | ||
} | ||
`; | ||
|
||
export { Container, OrderButtonCotainer, OrderButtonWrapper, OrderButton, CommentContainer }; |
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 @@ | ||
const pageMaxWidth = "1080px"; |
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,11 @@ | ||
export interface Comment { | ||
id: number; | ||
content: string; | ||
user: { | ||
id: number; | ||
imageURL: string; | ||
nickName: string; | ||
type: string; | ||
}; | ||
createdAt: string; | ||
} |
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 @@ | ||
export { Comment } from "./comment"; |
File renamed without changes.
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