Skip to content

Commit

Permalink
add tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
NickAkhmetov committed Nov 3, 2024
1 parent f699fbb commit e8b9312
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions context/app/static/js/components/detailPage/Citation/Citation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import LabelledSectionText from 'js/shared-styles/sections/LabelledSectionText';
import ContentCopyIcon from '@mui/icons-material/ContentCopyRounded';
import { useHandleCopyClick } from 'js/hooks/useCopyText';
import IconLink from 'js/shared-styles/Links/iconLinks/IconLink';
import { SecondaryBackgroundTooltip } from 'js/shared-styles/tooltips';

interface Contributor {
last_name: string;
Expand Down Expand Up @@ -37,16 +38,18 @@ function ExternalDoiLink({ doi_url }: { doi_url: string }) {
function InternalDoiLink({ doi_url }: { doi_url: string }) {
const copy = useHandleCopyClick();
return (
<IconLink
href={doi_url}
onClick={(e) => {
e.preventDefault();
copy(doi_url);
}}
icon={<ContentCopyIcon />}
>
{doi_url}
</IconLink>
<SecondaryBackgroundTooltip title="This DOI link leads to the page you are currently viewing. Click to copy.">
<IconLink
href={doi_url}
onClick={(e) => {
e.preventDefault();
copy(doi_url);
}}
icon={<ContentCopyIcon />}
>
{doi_url}
</IconLink>
</SecondaryBackgroundTooltip>
);
}

Expand Down

0 comments on commit e8b9312

Please sign in to comment.