New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apply 'user-mention-me' styles to self mentions span. #938
Conversation
jainkuniya
commented
Jul 27, 2017
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very likely can be implemented in a simpler way.
src/html/tags/HtmlTagSpan.js
Outdated
props: { | ||
style?: StyleObj, | ||
actions?: Actions, | ||
cascadingStyle?: StyleObj, | ||
attribs?: Object, | ||
ownEmail: string, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is conceptually incorrect.
Our HtmlTagSpan should be aware only of general 'span' related stuff.
If we can not implement the styling by only generic code, we need to create a 'SpanMention' or something similar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created new Component HtmlTagSpanMention
.
src/html/tags/HtmlTagSpan.js
Outdated
|
||
mentionButtonRefersToSelf = () => { | ||
const { attribs, ownEmail } = this.props; | ||
return attribs && attribs.class === 'user-mention' && attribs['data-user-email'] === ownEmail; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considering that the mention-self span already have a class called 'user-mention-me', this is likely too much complication.
Updated |
Looks good to merge. |