Skip to content

Instantly share code, notes, and snippets.

@Giuseppetm
Created September 4, 2021 08:25
Show Gist options
  • Save Giuseppetm/7775bdd8bcda01e2a396e932114effb6 to your computer and use it in GitHub Desktop.
Save Giuseppetm/7775bdd8bcda01e2a396e932114effb6 to your computer and use it in GitHub Desktop.
A ToolTip for Fluent UI framework with extended content
{(() => {
const imageUrl = `https://studentiunimi-groups-propics.marcoaceti.workers.dev/${x.user_id}.png`;
const tooltipProps: ITooltipProps = {
onRenderContent: () => (
<div>
<div className="mb-1">
<Text variant="large" styles={semibold}><Link href={`https://t.me/${x.username}`}>@{x.username}</Link></Text><br />
<Text variant="medium" styles={semibold}>{x.delega}</Text><br />
</div>
<div>
<Text variant="medium">{x.cdl}</Text>
</div>
</div>
),
};
return (
<TooltipHost
tooltipProps={tooltipProps}
calloutProps={calloutPropsContributor}
styles={hostStyles}
delay={TooltipDelay.zero}
key={i}
>
<Persona onRenderPrimaryText={() => null} imageUrl={imageUrl} text={x.username} className="mb-1" size={PersonaSize.size72} />
</TooltipHost>
)
})()}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment