Skip to content

Commit

Permalink
Merge pull request #1477 from afwillia/PORTALS-3313
Browse files Browse the repository at this point in the history
Portals 3313
  • Loading branch information
afwillia authored Jan 3, 2025
2 parents 41ae39b + 2b2184c commit 41a558a
Showing 1 changed file with 16 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,26 +145,18 @@ export function UserCardMedium({
<div className="SRC-cardContent">
<p className="SRC-eqHeightRow SRC-userCardName">
{/*
if its a medium component the header should be clickable (unless disableLink is set),
if its large then it should NOT be clickable
*/}
{/* make SRC-whiteText overridable with a good name! */}
{isLarge || disableLink ? (
<span className={isLarge ? 'SRC-whiteText' : 'SRC-blackText'}>
{name}
</span>
) : (
// consolidate click events
<a
href={linkLocation}
target={openLinkInNewTab ? '_blank' : ''}
rel={openLinkInNewTab ? 'noreferrer' : ''}
tabIndex={0}
className={'SRC-hand-cursor'}
>
{name}
</a>
)}
make the header clickable for all cards
consolidate click events
*/}
<a
href={linkLocation}
target={openLinkInNewTab ? '_blank' : ''}
rel={openLinkInNewTab ? 'noreferrer' : ''}
tabIndex={0}
className={'SRC-hand-cursor'}
>
{name}
</a>
{isValidated && (
<Tooltip
title="This user profile has been validated."
Expand All @@ -176,15 +168,14 @@ export function UserCardMedium({
)}
</p>
{(position || company) && (
<p className={`${isLarge ? 'SRC-whiteText' : ''}`}>
<p>
{position} {position ? ' / ' : ''} {company}
</p>
)}
{!hideEmail && (
<p
ref={copyToClipboardRef}
className={`${isLarge ? 'SRC-whiteText' : ''}
SRC-hand-cursor SRC-eqHeightRow SRC-inlineFlex SRC-emailText SRC-cardSvg`}
className={`SRC-hand-cursor SRC-eqHeightRow SRC-inlineFlex SRC-emailText SRC-cardSvg`}
onClick={copyToClipboard(
copyToClipboardRef,
email,
Expand All @@ -198,9 +189,7 @@ export function UserCardMedium({
tabIndex={0}
>
<span style={{ paddingRight: '5px', paddingBottom: '2px' }}>
<a className={`link ${isLarge ? 'SRC-whiteText' : ''}`}>
{`${userName}@synapse.org`}
</a>
<a className={`link`}>{`${userName}@synapse.org`}</a>
</span>
<IconCopy />
</p>
Expand All @@ -212,7 +201,6 @@ export function UserCardMedium({
rel="noopener noreferrer"
style={{ width: 'fit-content' }}
tabIndex={0}
className={isLarge ? 'SRC-whiteText' : ''}
>
View ORCID
</a>
Expand Down Expand Up @@ -263,11 +251,7 @@ export function UserCardMedium({
// when the component is large we have to set the click handler to wrap both the top and bottom portion
return (
<Card>
<div
className={`SRC-primary-background-color SRC-userCard SRC-userCardMediumUp`}
>
{mediumCard}
</div>
<div className={`SRC-userCard SRC-userCardMediumUp`}>{mediumCard}</div>
{isLarge && (
<UserCardLarge userProfile={userProfile} isCertified={isCertified} />
)}
Expand Down

0 comments on commit 41a558a

Please sign in to comment.