Merge pull request #89 from golles/company-mention
When company is a mention, link it
This commit is contained in:
commit
8901157e01
@ -46,6 +46,14 @@ const ListItem = ({ icon, title, value, link, skeleton = false }) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const isCompanyMention = (company) => {
|
||||||
|
return company.startsWith('@') && !company.includes(' ');
|
||||||
|
};
|
||||||
|
|
||||||
|
const companyLink = (company) => {
|
||||||
|
return `https://github.com/${company.substring(1)}`;
|
||||||
|
};
|
||||||
|
|
||||||
const Details = ({ profile, loading, social, github }) => {
|
const Details = ({ profile, loading, social, github }) => {
|
||||||
const renderSkeleton = () => {
|
const renderSkeleton = () => {
|
||||||
let array = [];
|
let array = [];
|
||||||
@ -84,6 +92,11 @@ const Details = ({ profile, loading, social, github }) => {
|
|||||||
icon={<FaBuilding className="mr-2" />}
|
icon={<FaBuilding className="mr-2" />}
|
||||||
title="Company:"
|
title="Company:"
|
||||||
value={profile.company}
|
value={profile.company}
|
||||||
|
link={
|
||||||
|
isCompanyMention(profile.company)
|
||||||
|
? companyLink(profile.company)
|
||||||
|
: null
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<ListItem
|
<ListItem
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user