Skip to content

Commit 69972a0

Browse files
committed
chore: update common lib version to 0.1.13-beta-7
1 parent abf1b9b commit 69972a0

File tree

4 files changed

+20
-6
lines changed

4 files changed

+20
-6
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.1.13-beta-6",
3+
"version": "0.1.13-beta-7",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

src/Common/SortableTableHeaderCell/SortableTableHeaderCell.tsx

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

17+
import Tippy from '@tippyjs/react'
1718
import { ReactComponent as SortIcon } from '../../Assets/Icon/ic-arrow-up-down.svg'
1819
import { ReactComponent as SortArrowDown } from '../../Assets/Icon/ic-sort-arrow-down.svg'
1920
import { SortingOrder } from '../Constants'
@@ -41,6 +42,7 @@ const SortableTableHeaderCell = ({
4142
title,
4243
disabled,
4344
isSortable = true,
45+
showTippy = false,
4446
}: SortableTableHeaderCellProps) => {
4547
const renderSortIcon = () => {
4648
if (!isSortable) {
@@ -50,22 +52,30 @@ const SortableTableHeaderCell = ({
5052
if (isSorted) {
5153
return (
5254
<SortArrowDown
53-
className={`icon-dim-12 mw-12 scn-7 dc__transition--transform ${sortOrder === SortingOrder.DESC ? 'dc__flip-180' : ''}`}
55+
className={`icon-dim-12 mw-12 scn-7 dc__no-shrink dc__transition--transform ${sortOrder === SortingOrder.DESC ? 'dc__flip-180' : ''}`}
5456
/>
5557
)
5658
}
5759

58-
return <SortIcon className="icon-dim-12 mw-12 scn-7" />
60+
return <SortIcon className="icon-dim-12 mw-12 scn-7 dc__no-shrink" />
5961
}
6062

63+
const renderTitle = () => <span className="dc__uppercase dc__truncate">{title}</span>
64+
6165
return (
6266
<button
6367
type="button"
6468
className="dc__transparent p-0 bcn-0 cn-7 flex dc__content-start dc__gap-4 dc__select-text"
6569
onClick={isSortable ? triggerSorting : noop}
6670
disabled={disabled}
6771
>
68-
<span className="dc__uppercase dc__truncate">{title}</span>
72+
{showTippy ? (
73+
<Tippy arrow={false} content={title} className="default-tt dc__mxw-200 dc__word-break">
74+
{renderTitle()}
75+
</Tippy>
76+
) : (
77+
renderTitle()
78+
)}
6979
{renderSortIcon()}
7080
</button>
7181
)

src/Common/SortableTableHeaderCell/types.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,8 @@ export interface SortableTableHeaderCellProps {
4444
* @default true
4545
*/
4646
isSortable?: boolean
47+
/**
48+
* @default - false
49+
*/
50+
showTippy?: boolean
4751
}

0 commit comments

Comments
 (0)