Skip to content

Commit 5df2a5f

Browse files
authored
Merge pull request #391 from devtron-labs/feat/silver-surfer-listing
feat: add silver surfer listing
2 parents 1316323 + 989f282 commit 5df2a5f

File tree

4 files changed

+21
-12
lines changed

4 files changed

+21
-12
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtron-labs/devtron-fe-common-lib",
3-
"version": "0.6.0-patch-1-beta-8",
3+
"version": "0.6.0-patch-1-beta-11",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

src/Shared/Components/CollapsibleList/CollapsibleList.component.tsx

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { Fragment } from 'react'
22
import { NavLink, useLocation } from 'react-router-dom'
33
import Tippy, { TippyProps } from '@tippyjs/react'
44
import { ConditionalWrap } from '@Common/Helper'
5+
import { Tooltip } from '@Common/Tooltip'
56
import { ReactComponent as ICExpand } from '@Icons/ic-expand.svg'
67

78
import { Collapse } from '../Collapse'
@@ -31,7 +32,9 @@ export const CollapsibleList = ({ config, onCollapseBtnClick }: CollapsibleListP
3132
className="icon-dim-20 fcn-6 dc__no-shrink cursor rotate"
3233
style={{ ['--rotateBy' as string]: isExpanded ? '0deg' : '-90deg' }}
3334
/>
34-
<span className="flex-grow-1 dc__align-left dc__truncate">{header}</span>
35+
<Tooltip content={header} placement="right">
36+
<span className="flex-grow-1 dc__align-left dc__truncate">{header}</span>
37+
</Tooltip>
3538
</button>
3639
{headerIconConfig && (
3740
<ConditionalWrap
@@ -60,7 +63,7 @@ export const CollapsibleList = ({ config, onCollapseBtnClick }: CollapsibleListP
6063
</span>
6164
</div>
6265
) : (
63-
items.map(({ title, strikeThrough, href, iconConfig, subtitle, onClick }) => (
66+
items.map(({ title, strikeThrough, href, iconConfig, subtitle, onClick, isActive }) => (
6467
<NavLink
6568
key={title}
6669
to={href}
@@ -72,15 +75,20 @@ export const CollapsibleList = ({ config, onCollapseBtnClick }: CollapsibleListP
7275
}
7376
onClick?.(e)
7477
}}
78+
isActive={isActive}
7579
>
7680
<div className="flexbox-col flex-grow-1 mw-none">
77-
<span
78-
className={`collapsible__item__title dc__truncate fs-13 lh-20 ${strikeThrough ? 'dc__strike-through' : ''}`}
79-
>
80-
{title}
81-
</span>
81+
<Tooltip content={title} placement="right">
82+
<span
83+
className={`collapsible__item__title dc__truncate fs-13 lh-20 ${strikeThrough ? 'dc__strike-through' : ''}`}
84+
>
85+
{title}
86+
</span>
87+
</Tooltip>
8288
{subtitle && (
83-
<span className="dc__truncate fw-4 lh-1-5 cn-7">{subtitle}</span>
89+
<Tooltip content={subtitle} placement="right">
90+
<span className="dc__truncate fw-4 lh-1-5 cn-7">{subtitle}</span>
91+
</Tooltip>
8492
)}
8593
</div>
8694
{iconConfig && (

src/Shared/Components/CollapsibleList/CollapsibleList.types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import React from 'react'
22
import { TippyProps } from '@tippyjs/react'
3+
import { NavLinkProps } from 'react-router-dom'
34

4-
export interface CollapsibleListItem {
5+
export interface CollapsibleListItem extends Pick<NavLinkProps, 'isActive'> {
56
/**
67
* The title of the list item.
78
*/

0 commit comments

Comments
 (0)