-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
When company is a mention, link it #89
Conversation
@@ -42,6 +42,14 @@ const ListItem = ({ icon, title, value, link, skeleton = false }) => { | |||
); | |||
}; | |||
|
|||
const isCompanyMention = (company) => { | |||
return company.startsWith('@') && !company.includes(' '); |
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.
I'm not fully sure what the exact rules are for a mention, I think a mention should start with a @
and cannot contain spaces.
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.
Looks workable.
}; | ||
|
||
const companyLink = (company) => { | ||
return `https://github.com/${company.substring(1)}`; |
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.
Strip first character (@)
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.
Right.
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.
Nice one!
LGTM. Will you add anything? If not, we can merge it.
@@ -42,6 +42,14 @@ const ListItem = ({ icon, title, value, link, skeleton = false }) => { | |||
); | |||
}; | |||
|
|||
const isCompanyMention = (company) => { | |||
return company.startsWith('@') && !company.includes(' '); |
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.
Looks workable.
}; | ||
|
||
const companyLink = (company) => { | ||
return `https://github.com/${company.substring(1)}`; |
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.
Right.
Thanks, this is all. You can merge it :-) |
Please advise if this is the best way of doing this.