File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ interface PatchInfo {
2121 message : string ;
2222}
2323
24- export type UserGroup = "admin" | "user" ;
24+ export type UserGroup = "admin" | "user" | "publisher" ;
2525
2626export interface UserInfo {
2727 username : string ;
Original file line number Diff line number Diff line change @@ -119,7 +119,6 @@ export function CommentCard(props: CommentCardPropTypes) {
119119 } = props ;
120120
121121 const { group : userGroup } = useAppSelector ( ( state ) => state . user ) ;
122-
123122 const [ showMore , setShowMore ] = React . useState < boolean > ( false ) ;
124123 const [ dialogOpen , setDialogOpen ] = React . useState < boolean > ( false ) ;
125124 const [ childLoading , setChildLoading ] = React . useState < boolean > ( false ) ;
@@ -183,12 +182,28 @@ export function CommentCard(props: CommentCardPropTypes) {
183182
184183 return (
185184 < >
186- < div className = { classes . commentItem } id = { commentId } >
185+ < div
186+ className = { classes . commentItem }
187+ id = { commentId }
188+ style = { { backgroundColor : `${ group . includes ( "admin" ) ? "#f0f9ff" : "" } ` } }
189+ >
187190 < Avatar className = "avatar" group = { group } username = { username } hasAvatar = { hasAvatar } hash = { hash } />
188191
189192 < div className = "name" >
190193 < Typography component = "span" variant = "h6" color = "textPrimary" >
191194 { username }
195+ { group . includes ( "admin" ) && (
196+ < Chip
197+ label = "官方推荐"
198+ size = "small"
199+ style = { {
200+ backgroundColor : "#e6f4ea" ,
201+ color : "#1e7e34" ,
202+ fontWeight : 500 ,
203+ marginLeft : 8 ,
204+ } }
205+ />
206+ ) }
192207 { invalid === true && (
193208 < Chip
194209 label = "该资源可能已经失效,查看解决方法"
Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ export function CommentList(props: CommentListPropTypes) {
125125
126126 { commentList . map ( ( comment , index ) => {
127127 if ( hideInvalidComments && comment . invalid ) {
128- return < div /> ;
128+ return null ;
129129 }
130130
131131 return (
You can’t perform that action at this time.
0 commit comments