From dc8df597283893e34fdeb841f1a94095ab0eb3a3 Mon Sep 17 00:00:00 2001 From: Vlad116 Date: Thu, 8 Jun 2023 10:06:19 +0300 Subject: [PATCH] feat: fix TooltipTrigger styles (#692), :recycle: :lipstick: --- src/components/TooltipTrigger.tsx | 49 ------------------- .../TooltipTrigger/icon-svg-path.ts | 2 + src/components/TooltipTrigger/index.tsx | 47 ++++++++++++++++++ src/pages/Options/Options.css | 6 ++- 4 files changed, 53 insertions(+), 51 deletions(-) delete mode 100644 src/components/TooltipTrigger.tsx create mode 100644 src/components/TooltipTrigger/icon-svg-path.ts create mode 100644 src/components/TooltipTrigger/index.tsx diff --git a/src/components/TooltipTrigger.tsx b/src/components/TooltipTrigger.tsx deleted file mode 100644 index e0839c51..00000000 --- a/src/components/TooltipTrigger.tsx +++ /dev/null @@ -1,49 +0,0 @@ -import { ITooltipHostProps, TooltipHost } from 'office-ui-fabric-react'; -import React from 'react'; - -interface ITooltipTriggerProps extends ITooltipHostProps { - iconColor?: string; - size?: number; -} - -const TooltipTrigger = ({ - iconColor = '#FFFFFF', - size = 28, - ...restProps -}: ITooltipTriggerProps): JSX.Element => ( - - - - - - - - - -); - -export default TooltipTrigger; diff --git a/src/components/TooltipTrigger/icon-svg-path.ts b/src/components/TooltipTrigger/icon-svg-path.ts new file mode 100644 index 00000000..a1ba69ad --- /dev/null +++ b/src/components/TooltipTrigger/icon-svg-path.ts @@ -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'; diff --git a/src/components/TooltipTrigger/index.tsx b/src/components/TooltipTrigger/index.tsx new file mode 100644 index 00000000..2d24a59e --- /dev/null +++ b/src/components/TooltipTrigger/index.tsx @@ -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 => ( + + + + + +); + +export default TooltipTrigger; diff --git a/src/pages/Options/Options.css b/src/pages/Options/Options.css index a1b3a2d8..417da461 100644 --- a/src/pages/Options/Options.css +++ b/src/pages/Options/Options.css @@ -23,7 +23,7 @@ .Box-header { display: flex; flex-direction: row; - justify-content: space-between; + justify-content: flex-start; align-items: center; padding: 0 25px; margin: -1px -1px 0; @@ -34,13 +34,15 @@ border-top-right-radius: 6px; } -.Box-header svg { +.Box-header svg.tooltip-icon { cursor: help; + margin-top: 4px; } .Box-title { font-size: 18px; font-weight: 600; + margin-right: 8px; } ul {