File tree Expand file tree Collapse file tree 2 files changed +23
-19
lines changed
Expand file tree Collapse file tree 2 files changed +23
-19
lines changed Original file line number Diff line number Diff line change @@ -79,8 +79,10 @@ const SingleComment: React.FC<CommentProps> = ({ comment, postAuthor }) => {
7979 < BodyHtml body_html = { comment . body_html } />
8080 < div className = "text-gray-500 text-xs mt-2 dark:text-slate-200 flex space-x-1" >
8181 < UpvoteIcon />
82- < span > { comment . score . toLocaleString ( "en-US" ) } </ span >
83- < span > upvotes</ span >
82+ < span className = "font-medium" > { comment . score . toLocaleString ( "en-US" ) } </ span >
83+ < span className = "font-base" >
84+ { comment . score === 1 ? "upvote" : "upvotes" }
85+ </ span >
8486 </ div >
8587 { comment . replies ?. data ?. children ?. length > 0 && (
8688 < button className = "dark:text-gray-300 text-xs mt-2" onClick = { ( ) => setShowReplies ( ! showReplies ) } >
Original file line number Diff line number Diff line change @@ -7,23 +7,25 @@ export interface PostStatsProps {
77 num_comments ?: number ;
88}
99
10- const PostStats : React . FC < PostStatsProps > = ( { score, num_comments } ) => {
11- return (
12- < div className = "text-gray-500 text-xs mt-2 dark:text-slate-100 flex items-center space-x-4 font-medium" >
13- < div className = "flex items-center space-x-1" >
14- < UpvoteIcon />
15- < span > { score . toLocaleString ( "en-US" ) } </ span >
16- < span > Upvotes</ span >
17- </ div >
18- { typeof num_comments !== 'undefined' && (
19- < div className = "flex items-center space-x-1" >
20- < CommentIcon />
21- < span > { num_comments . toLocaleString ( "en-US" ) } </ span >
22- < span > Comments</ span >
23- </ div >
24- ) }
10+ const PostStats : React . FC < PostStatsProps > = ( { score, num_comments} ) => (
11+ < div className = "text-gray-600 text-xs mt-2 dark:text-slate-200 flex items-center space-x-4 font-medium" >
12+ < div className = "flex items-center space-x-1 cursor-pointer" >
13+ < UpvoteIcon />
14+ < span className = "font-bold text-xs" > { score . toLocaleString ( "en-US" ) } </ span >
15+ < span className = "text-xs" >
16+ { score === 1 ? "upvote" : "upvotes" }
17+ </ span >
2518 </ div >
26- ) ;
27- } ;
19+ { num_comments !== undefined && (
20+ < div className = "flex items-center space-x-1 cursor-pointer" >
21+ < CommentIcon />
22+ < span className = "font-bold text-xs" > { num_comments . toLocaleString ( "en-US" ) } </ span >
23+ < span className = "text-xs" >
24+ { num_comments === 1 ? "comment" : "comments" }
25+ </ span >
26+ </ div >
27+ ) }
28+ </ div >
29+ ) ;
2830
2931export default PostStats ;
You can’t perform that action at this time.
0 commit comments