Add instagram signature link

This commit is contained in:
Piotr Zarycki 2019-10-14 20:56:12 +02:00 committed by Ben Gotow
parent 63f39fca56
commit b40b82a3ce
2 changed files with 29 additions and 0 deletions

View file

@ -47,6 +47,10 @@ export const DataShape = [
key: 'twitterHandle',
label: localized('Twitter Handle'),
},
{
key: 'instagramURL',
label: localized('Instagram URL')
},
{
key: 'tintColor',
label: localized('Theme Color'),
@ -108,6 +112,13 @@ export const ResolveSignatureData = data => {
data.photoURL = '';
}
if (data.instagramURL) {
if (!data.instagramURL.includes('instagram.com')) {
data.instagramURL = `https://www.instagram.com/${data.instagramURL}`;
}
}
return data;
};

View file

@ -28,6 +28,15 @@ const LINKEDIN_SHARE = (
/>
);
const INSTAGRAM_SHARE = (
<img
src="https://www.getmailspring.com/signature-assets/instagram.gif"
width="13"
height="13"
alt="Instagram"
/>
);
function widthAndHeightForPhotoURL(
photoURL,
{ maxWidth, maxHeight }: { maxWidth?: number; maxHeight?: number } = {}
@ -149,6 +158,15 @@ function GenericInfoBlock(props, prefixStyle: any = PrefixStyles.None) {
{TWITTER_SHARE}
</a>
)}
{props.instagramURL && (
<a
href={`${props.instagramURL}`}
title="Instagram"
style={{ marginRight: 8, color: props.tintColor }}
>
{INSTAGRAM_SHARE}
</a>
)}
</div>
</div>
);