Skip to content

Commit

Permalink
Create TooltipPopup.jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
ksuess committed Dec 20, 2024
1 parent db84c5d commit f803274
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions packages/volto-slate-glossary/src/components/TooltipPopup.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { Popup } from 'semantic-ui-react';
import config from '@plone/volto/registry';

const TooltipPopup = ({ term, definition, idx = 0 }) => {
const mentionTermInTooltip = config.settings.glossary.mentionTermInTooltip;
return (
<Popup
wide
position="bottom left"
trigger={<span className="glossarytooltip">{term}</span>}
className="tooltip"
key={idx}
>
{mentionTermInTooltip ? <Popup.Header>{term}</Popup.Header> : null}
<Popup.Content>
<div
className="tooltip_content"
dangerouslySetInnerHTML={{ __html: definition }}
/>
</Popup.Content>
</Popup>
);
};

export default TooltipPopup;

0 comments on commit f803274

Please sign in to comment.