Skip to content

Commit 6e3f05a

Browse files
committed
fix(ui): tooltip placement and content in sequential cd card
1 parent 92e34d2 commit 6e3f05a

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

src/Shared/Components/ImageCard/SequentialCDCardTitle/DeploymentEnvState/DeploymentEnvState.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,29 @@
1414
* limitations under the License.
1515
*/
1616

17-
import Tippy from '@tippyjs/react'
18-
import { ConditionalWrap } from '../../../../../Common'
17+
import { Tooltip } from '../../../../../Common'
1918
import { DeploymentEnvStateProps } from './types'
2019
import { getDeploymentEnvConfig } from './utils'
2120

2221
const DeploymentEnvState = ({ envStateText, title, tooltipContent }: DeploymentEnvStateProps) => {
2322
const { Icon, stateClassName } = getDeploymentEnvConfig(envStateText)
24-
const renderTooltip = (children) => (
25-
<Tippy content={tooltipContent} className="default-tt" placement="top" arrow={false} interactive>
26-
{children}
27-
</Tippy>
28-
)
2923

3024
return (
31-
<ConditionalWrap condition={!!tooltipContent} wrap={renderTooltip}>
25+
<Tooltip
26+
alwaysShowTippyOnHover={!!tooltipContent}
27+
content={tooltipContent}
28+
placement="right"
29+
interactive
30+
className="w-250 dc__resizable-textarea__with-max-height"
31+
>
3232
<div className={`${stateClassName} br-4 cn-9 pt-3 pb-3 pl-6 pr-6 bw-1 mr-6`}>
3333
<span className="fw-4 fs-11 lh-16 flex">
3434
{Icon}
3535
{envStateText}
3636
<span className="fw-6 ml-4">{title}</span>
3737
</span>
3838
</div>
39-
</ConditionalWrap>
39+
</Tooltip>
4040
)
4141
}
4242

src/Shared/Components/ImageCard/SequentialCDCardTitle/DeploymentEnvState/types.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { ReactNode } from 'react'
1919
export interface DeploymentEnvStateProps {
2020
envStateText: string
2121
title: string
22-
tooltipContent?: string
22+
tooltipContent?: ReactNode
2323
}
2424

2525
export interface GetDeploymentEnvConfigType {

src/Shared/Components/ImageCard/SequentialCDCardTitle/SequentialCDCardTitle.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,13 @@ const SequentialCDCardTitle = ({
5050
<DeploymentEnvState
5151
envStateText={getDeployedStateText()}
5252
title={deployedOnTitle}
53-
tooltipContent={deployedOn.join(',')}
53+
tooltipContent={
54+
<div className="flexbox-col lh-20">
55+
{deployedOn.map((env) => (
56+
<span>{env}</span>
57+
))}
58+
</div>
59+
}
5460
/>
5561
)
5662
}

0 commit comments

Comments
 (0)