-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: fix TooltipTrigger styles (#692), ♻️ 💄
- Loading branch information
Showing
4 changed files
with
53 additions
and
51 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export const iconTooltipTrigger = | ||
'M22 34h4V22h-4v12zm2-30C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16zm-2-22h4v-4h-4v4z'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import React from 'react'; | ||
import { ITooltipHostProps, TooltipHost } from 'office-ui-fabric-react'; | ||
|
||
import { iconTooltipTrigger } from './icon-svg-path'; | ||
|
||
interface ITooltipTriggerProps extends ITooltipHostProps { | ||
size?: number; | ||
iconColor?: string; | ||
tooltipBackground?: string; | ||
tooltipFontColor?: string; | ||
} | ||
|
||
const TooltipTrigger = ({ | ||
size = 20, | ||
iconColor = '#FFFFFF', | ||
tooltipBackground = '#676e72', | ||
tooltipFontColor = '#FFFFFF', | ||
...restProps | ||
}: ITooltipTriggerProps): JSX.Element => ( | ||
<TooltipHost | ||
tooltipProps={{ | ||
styles: { | ||
content: { color: tooltipFontColor }, | ||
}, | ||
calloutProps: { | ||
styles: { | ||
beak: { backgroundColor: tooltipBackground }, | ||
beakCurtain: { backgroundColor: tooltipBackground }, | ||
calloutMain: { backgroundColor: tooltipBackground, cursor: 'help' }, | ||
}, | ||
}, | ||
}} | ||
{...restProps} | ||
> | ||
<svg | ||
className="tooltip-icon" | ||
width={`${size}px`} | ||
height={`${size}px`} | ||
viewBox="0 0 48 48" | ||
version="1.1" | ||
> | ||
<path fill={iconColor} d={iconTooltipTrigger}></path> | ||
</svg> | ||
</TooltipHost> | ||
); | ||
|
||
export default TooltipTrigger; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters