Added the leading 'www' to the social links in the sidebar, now curso… (#1559)

* Added the leading 'www' to the facebook and linkedin links in the sidebar, now cursor pointer is shown wheh hovering social links in the sidebar

* SocialProfileLink now accepts a hostname parameter used to generate social link urls, service remains only for the img
This commit is contained in:
Alessandro Magionami 2019-09-23 17:39:01 +02:00 committed by Ben Gotow
parent de07989480
commit 63db2fbf15
2 changed files with 13 additions and 11 deletions

View file

@ -104,14 +104,15 @@ class ProfilePictureOrColorBox extends React.Component<{
);
}
}
class SocialProfileLink extends React.Component<{ handle: string; service: string }> {
class SocialProfileLink extends React.Component<{ handle: string; service: string, hostname: string }> {
static propTypes = {
service: PropTypes.string,
handle: PropTypes.string,
hostname: PropTypes.string,
};
render() {
const { handle, service } = this.props;
const { handle, service, hostname } = this.props;
if (!handle) {
return false;
@ -119,8 +120,8 @@ class SocialProfileLink extends React.Component<{ handle: string; service: strin
return (
<a
className="social-profile-item"
title={`https://${service}.com/${handle}`}
href={`https://${service}.com/${handle}`}
title={`https://${hostname}/${handle}`}
href={`https://${hostname}/${handle}`}
>
<RetinaImg
url={`mailspring://participant-profile/assets/${service}-sidebar-icon@2x.png`}
@ -473,10 +474,10 @@ export default class SidebarParticipantProfile extends React.Component<
<IconRow icon="funding" node={funding} />
<div className="social-profiles-wrap">
<SocialProfileLink service="facebook" handle={facebook && facebook.handle} />
<SocialProfileLink service="crunchbase" handle={crunchbase && crunchbase.handle} />
<SocialProfileLink service="linkedin" handle={linkedin && linkedin.handle} />
<SocialProfileLink service="twitter" handle={twitter && twitter.handle} />
<SocialProfileLink service="facebook" hostname="www.facebook.com" handle={facebook && facebook.handle} />
<SocialProfileLink service="crunchbase" hostname="www.crunchbase.com" handle={crunchbase && crunchbase.handle} />
<SocialProfileLink service="linkedin" hostname="www.linkedin.com" handle={linkedin && linkedin.handle} />
<SocialProfileLink service="twitter" hostname="twitter.com" handle={twitter && twitter.handle} />
</div>
</div>
</div>
@ -513,9 +514,9 @@ export default class SidebarParticipantProfile extends React.Component<
</div>
<div className="social-profiles-wrap">
<SocialProfileLink service="facebook" handle={facebook && facebook.handle} />
<SocialProfileLink service="linkedin" handle={linkedin && `in/${linkedin.handle}`} />
<SocialProfileLink service="twitter" handle={twitter && twitter.handle} />
<SocialProfileLink service="facebook" hostname="www.facebook.com" handle={facebook && facebook.handle} />
<SocialProfileLink service="linkedin" hostname="www.linkedin.com" handle={linkedin && `in/${linkedin.handle}`} />
<SocialProfileLink service="twitter" hostname="twitter.com" handle={twitter && twitter.handle} />
</div>
</div>

View file

@ -117,6 +117,7 @@
}
.social-profile-item {
margin: 0 10px;
cursor: pointer;
&:first-child {
margin-left: 0;
}