Skip to content

Commit

Permalink
removed email address for alumni (#620)
Browse files Browse the repository at this point in the history
  • Loading branch information
BrookJeynes authored Mar 12, 2024
1 parent 1c6bf43 commit df4ee71
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
23 changes: 21 additions & 2 deletions src/components/social-links/social-links.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';

const SocialLinks = ({ crmData }) => {
const SocialLinks = ({ crmData, alumni }) => {
let encodedEmailAddress = '';

const encodeEmail = (emailAddress) => {
Expand Down Expand Up @@ -39,9 +39,27 @@ const SocialLinks = ({ crmData }) => {
window.location.href = `mailTo:${decodedEmail}?subject=Contacting ${crmData.fullName} via SSW.People profile`;
};

if (!crmData) {
return <></>;
}

if (alumni) {
crmData.emailAddress = '';
}

const displayCrm =
crmData.emailAddress ||
crmData.blogUrl ||
crmData.facebookUrl ||
crmData.skypeUsername ||
crmData.linkedInUrl ||
crmData.twitterUsername ||
crmData.gitHubUrl ||
crmData.publicPhotoAlbumUrl;

return (
<>
{crmData && (
{displayCrm && (
<div className="favor-content w-full print-hidden">
<ul className="favor-list">
{crmData.emailAddress && (
Expand Down Expand Up @@ -144,6 +162,7 @@ const SocialLinks = ({ crmData }) => {

SocialLinks.propTypes = {
crmData: PropTypes.object.isRequired,
alumni: PropTypes.bool.isRequired,
};

export default SocialLinks;
4 changes: 2 additions & 2 deletions src/templates/person.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const Person = ({ pageContext }) => {
);

const skillsList = <SkillsList crmData={crmData} />;
const socialLinks = <SocialLinks crmData={crmData} />;
const socialLinks = <SocialLinks crmData={crmData} alumni={!isActive} />;

return (
<>
Expand All @@ -134,7 +134,7 @@ const Person = ({ pageContext }) => {
''
)}
<div className="mt-4 hidden md:block lg:hidden w-full">
<SocialLinks crmData={crmData} />
<SocialLinks crmData={crmData} alumni={!isActive} />
</div>
</div>
<div className="lg:hidden print-show px-2 md:p-2">
Expand Down

0 comments on commit df4ee71

Please sign in to comment.