File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6969}
7070
7171# comment-search-root .comment-item-avatar {
72- width : 40px ;
73- height : 40px ;
7472 border-radius : 50% ;
7573 background-color : var (--Ga1 );
7674 margin-right : 10px ;
7775}
7876
7977# comment-search-root .comment-item-content {
80- display : flex;
81- flex-direction : column;
8278}
8379
8480# comment-search-root .comment-item-username {
8581 font-size : 12px ;
8682 font-weight : bold;
8783 margin-bottom : 4px ;
8884 color : # 61666d ;
85+ margin-right : 12px ;
8986}
9087
9188# comment-search-root .comment-item-message {
Original file line number Diff line number Diff line change @@ -50,22 +50,38 @@ export default function App() {
5050
5151interface CommentProps {
5252 comments ?: Reply [ ]
53+ sub ?: boolean
5354}
54- const CommentTree : React . FC < CommentProps > = ( { comments } ) => {
55+ const CommentTree : React . FC < CommentProps > = ( { comments, sub = false } ) => {
5556 if ( ! comments ) return null
5657 return (
5758 < ul >
5859 { comments ?. map ( ( comment ) => (
5960 < li key = { comment . rpid } className = 'comment-item' >
60- < img src = { comment . member . avatar } className = 'comment-item-avatar' />
61- < div className = 'comment-item-content' >
61+ < img
62+ src = { comment . member . avatar }
63+ className = 'comment-item-avatar'
64+ style = { {
65+ width : sub ? '30px' : '40px' ,
66+ height : sub ? '30px' : '40px' ,
67+ } }
68+ />
69+ < div
70+ className = 'comment-item-content'
71+ style = { {
72+ ...( ! sub && {
73+ display : 'flex' ,
74+ flexDirection : 'column' ,
75+ } ) ,
76+ } }
77+ >
6278 < span className = 'comment-item-username' >
6379 { comment . member . uname }
6480 </ span >
6581 < span className = 'comment-item-message' >
6682 { comment . content . message }
6783 </ span >
68- < CommentTree comments = { comment . replies } />
84+ < CommentTree comments = { comment . replies } sub />
6985 </ div >
7086 </ li >
7187 ) ) }
You can’t perform that action at this time.
0 commit comments