File tree Expand file tree Collapse file tree 5 files changed +20
-5
lines changed Expand file tree Collapse file tree 5 files changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import Typography from '../common/Typography';
7
7
import { PlusBoxIcon , MinusBoxIcon } from '../../static/svg' ;
8
8
import { userThumbnail } from '../../static/images' ;
9
9
import useBoolean from '../../lib/hooks/useBoolean' ;
10
+ import PostRepliesContainer from '../../containers/post/PostRepliesContainer' ;
10
11
11
12
const PostCommentItemBlock = styled . div `
12
13
padding-top: 1.5rem;
@@ -125,6 +126,7 @@ const PostCommentItem: React.FC<PostCommentItemProps> = ({ comment }) => {
125
126
</ Typography >
126
127
< CommentFoot >
127
128
< Toggler open = { open } onToggle = { onToggle } count = { replies_count } />
129
+ { open && < PostRepliesContainer commentId = { id } /> }
128
130
</ CommentFoot >
129
131
</ PostCommentItemBlock >
130
132
) ;
Original file line number Diff line number Diff line change @@ -3,9 +3,7 @@ import styled from 'styled-components';
3
3
import { Comment } from '../../lib/graphql/post' ;
4
4
import PostCommentItem from './PostCommentItem' ;
5
5
6
- const PostCommentsListBlock = styled . div `
7
- margin-top: 2.5rem;
8
- ` ;
6
+ const PostCommentsListBlock = styled . div `` ;
9
7
10
8
export interface PostCommentsListProps {
11
9
comments : Comment [ ] ;
Original file line number Diff line number Diff line change @@ -3,7 +3,14 @@ import styled from 'styled-components';
3
3
import { Comment } from '../../lib/graphql/post' ;
4
4
import PostCommentsList from './PostCommentsList' ;
5
5
6
- const PostRepliesBlock = styled . div `` ;
6
+ const PostRepliesBlock = styled . div `
7
+ border: solid 1px rgba(0, 0, 0, 0.02);
8
+ background-color: rgba(0, 0, 0, 0.015);
9
+ padding-left: 1.5rem;
10
+ padding-right: 1.5rem;
11
+ border-radius: 4px;
12
+ margin-top: 1.3125rem;
13
+ ` ;
7
14
8
15
export interface PostRepliesProps {
9
16
comments : Comment [ ] ;
Original file line number Diff line number Diff line change @@ -4,17 +4,24 @@ import PostCommentsWriteContainer from './PostCommentsWriteContainer';
4
4
import { Comment , WRITE_COMMENT } from '../../lib/graphql/post' ;
5
5
import PostCommentsList from '../../components/post/PostCommentsList' ;
6
6
import { MutationResult , Mutation } from 'react-apollo' ;
7
+ import styled from 'styled-components' ;
7
8
8
9
export interface PostCommentsProps {
9
10
comments : Comment [ ] ;
10
11
postId : string ;
11
12
}
12
13
14
+ const MarginTop = styled . div `
15
+ margin-top: 2.5rem;
16
+ ` ;
17
+
13
18
const PostComments : React . FC < PostCommentsProps > = ( { comments, postId } ) => {
14
19
return (
15
20
< PostCommentsTemplate count = { comments . length } >
16
21
< PostCommentsWriteContainer postId = { postId } />
17
- < PostCommentsList comments = { comments } /> ;
22
+ < MarginTop >
23
+ < PostCommentsList comments = { comments } />
24
+ </ MarginTop >
18
25
</ PostCommentsTemplate >
19
26
) ;
20
27
} ;
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ const PostRepliesContainer: React.FC<PostRepliesProps> = ({ commentId }) => {
18
18
error,
19
19
data,
20
20
} : QueryResult < { comment : CommentWithReplies } > ) => {
21
+ console . log ( loading , error , data ) ;
21
22
if ( loading || ! data ) return null ;
22
23
return < PostReplies comments = { data . comment . replies } /> ;
23
24
} }
You can’t perform that action at this time.
0 commit comments