Last active
November 12, 2018 18:37
-
-
Save itsdavidmorgan/1ba69880685f98b0ae38abe4b98cf321 to your computer and use it in GitHub Desktop.
Save Custom Block Output
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| save: function (props) { | |
| var attributes = props.attributes | |
| var alignment = props.attributes.alignment | |
| var facebookURL = props.attributes.facebookURL | |
| var twitterURL = props.attributes.twitterURL | |
| var instagramURL = props.attributes.instagramURL | |
| var linkedURL = props.attributes.linkedURL | |
| var emailAddress = props.attributes.emailAddress | |
| return ( | |
| el('div', { className: props.className }, | |
| el('div', { className: 'organic-profile-image', style: { backgroundImage: 'url(' + attributes.mediaURL + ')' } }, | |
| el('img', { src: attributes.mediaURL }) | |
| ), | |
| el('div', { className: 'organic-profile-content', style: { textAlign: attributes.alignment } }, | |
| el(RichText.Content, { | |
| tagName: 'h3', | |
| value: attributes.title | |
| }), | |
| el(RichText.Content, { | |
| tagName: 'h5', | |
| value: attributes.subtitle | |
| }), | |
| el(RichText.Content, { | |
| tagName: 'p', | |
| value: attributes.bio | |
| }), | |
| el('div', { className: 'organic-profile-social' }, | |
| attributes.facebookURL && el('a', { | |
| className: 'social-link', | |
| href: attributes.facebookURL, | |
| target: '_blank' | |
| }, | |
| el('i', { className: 'fa fa-facebook' }) | |
| ), | |
| attributes.twitterURL && el('a', { | |
| className: 'social-link', | |
| href: attributes.twitterURL, | |
| target: '_blank' | |
| }, | |
| el('i', { className: 'fa fa-twitter' }) | |
| ), | |
| attributes.instagramURL && el('a', { | |
| className: 'social-link', | |
| href: attributes.instagramURL, | |
| target: '_blank' | |
| }, | |
| el('i', { className: 'fa fa-instagram' }) | |
| ), | |
| attributes.linkedURL && el('a', { | |
| className: 'social-link', | |
| href: attributes.linkedURL, | |
| target: '_blank' | |
| }, | |
| el('i', { className: 'fa fa-linkedin' }) | |
| ), | |
| attributes.emailAddress && el('a', { | |
| className: 'social-link', | |
| href: 'mailto:' + attributes.emailAddress, | |
| target: '_blank' | |
| }, | |
| el('i', { className: 'fa fa-envelope' }) | |
| ) | |
| ) | |
| ) | |
| ) | |
| ) | |
| } | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment