Skip to content

Commit

Permalink
feat: update change request layout (#2848)
Browse files Browse the repository at this point in the history
  • Loading branch information
azaiko-akveo authored Oct 19, 2023
1 parent 3ec7265 commit eaffffe
Show file tree
Hide file tree
Showing 3 changed files with 252 additions and 143 deletions.
17 changes: 13 additions & 4 deletions frontend/web/components/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ type TooltipProps = {
plainText: boolean
place?: string | undefined
title: JSX.Element // This is actually the Tooltip parent component
noIcon?: boolean
}

const StyledTooltip = ({ children }: StyledTooltipProps) => (
Expand All @@ -24,10 +25,17 @@ const StyledTooltip = ({ children }: StyledTooltipProps) => (
</div>
)

const tooltipStyler = (plainText: boolean, children: string): string => {
const html = renderToStaticMarkup(
<StyledTooltip>{plainText ? children : '{{html}}'}</StyledTooltip>,
const tooltipStyler = (
plainText: boolean,
children: string,
noIcon?: boolean,
): string => {
const tooltip = noIcon ? (
<span>{plainText ? children : '{{html}}'}</span>
) : (
<StyledTooltip>{plainText ? children : '{{html}}'}</StyledTooltip>
)
const html = renderToStaticMarkup(tooltip)
if (plainText) {
return html
}
Expand All @@ -36,6 +44,7 @@ const tooltipStyler = (plainText: boolean, children: string): string => {

const Tooltip = ({
children,
noIcon,
place,
plainText,
title,
Expand All @@ -58,7 +67,7 @@ const Tooltip = ({
type='dark'
effect='solid'
>
{tooltipStyler(plainText, children)}
{tooltipStyler(plainText, children, noIcon)}
</ReactTooltip>
</span>
)
Expand Down
Loading

3 comments on commit eaffffe

@vercel
Copy link

@vercel vercel bot commented on eaffffe Oct 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on eaffffe Oct 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on eaffffe Oct 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

docs – ./docs

docs-git-main-flagsmith.vercel.app
docs.bullet-train.io
docs-flagsmith.vercel.app
docs.flagsmith.com

Please sign in to comment.