File tree Expand file tree Collapse file tree 3 files changed +14
-2
lines changed
Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,14 @@ const Comment: React.FC<IComment> = ({
4242 `<span className="mention">@${ currentUser } </span>`
4343 ) ;
4444
45- return newContent ;
45+ const reply = newContent . replace ( / @ ( \w + ) / g, ( match , username ) => {
46+ if ( username === currentUser ) return match ;
47+ return `<span className="reply">@${ username } </span>` ;
48+ } ) ;
49+
50+ return reply ;
51+
52+ /* return newContent; */
4653 } ,
4754 [ currentUser ]
4855 ) ;
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ export const list: ICommentData[] = [
5454 } ,
5555 {
5656 id : 6 ,
57- comment : "~~Strikethrough~~ for deprecated features" ,
57+ comment : "@Maria ~~Strikethrough~~ for deprecated features" ,
5858 user : {
5959 name : "Mike" ,
6060 avatar : "https://avatar.iran.liara.run/public/55" ,
Original file line number Diff line number Diff line change @@ -37,6 +37,11 @@ export const Span = styled.span`
3737 padding: 2px;
3838 height: fit-content;
3939 }
40+
41+ &.reply {
42+ text-decoration: underline;
43+ color: ${ ( { theme } ) => theme . colors . primary } ;
44+ }
4045` ;
4146
4247export const Link = styled . a `
You can’t perform that action at this time.
0 commit comments