mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-09-20 23:36:21 +08:00
Add instagram signature link
This commit is contained in:
parent
63f39fca56
commit
b40b82a3ce
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
|
@ -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>
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue