Skip to content

Commit 58326f1

Browse files
committed
refactor: clean up ResourceList and Sidebar components, remove unused props and improve tree view structure
1 parent 6bc8341 commit 58326f1

File tree

5 files changed

+133
-313
lines changed

5 files changed

+133
-313
lines changed

src/components/ResourceBrowser/ResourceList/ResourceList.component.tsx

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,14 @@
1717
import React, { MouseEventHandler, useEffect, useState } from 'react'
1818
import { ClearIndicatorProps, components, ValueContainerProps } from 'react-select'
1919

20-
import { Button, ButtonVariantType, ComponentSizeType, Tooltip } from '@devtron-labs/devtron-fe-common-lib'
20+
import { Button, ButtonVariantType, ComponentSizeType } from '@devtron-labs/devtron-fe-common-lib'
2121

2222
import { ReactComponent as ClearIcon } from '@Icons/ic-error.svg'
2323
import { ReactComponent as SearchIcon } from '@Icons/ic-search.svg'
2424
import { ReactComponent as Warning } from '@Icons/ic-warning.svg'
2525

2626
import { handleUTCTime } from '../../common'
2727
import { ShortcutKeyBadge } from '../../common/formFields/Widgets/Widgets'
28-
import { SidebarChildButtonPropsType } from '../Types'
2928

3029
export const KindSearchValueContainer = (props: ValueContainerProps) => {
3130
const { selectProps, children } = props
@@ -96,38 +95,3 @@ export const renderRefreshBar =
9695
(show: boolean, lastSyncTime: string, callback: () => void): (() => JSX.Element) =>
9796
() =>
9897
!show ? null : <WarningStrip lastSyncTime={lastSyncTime} callback={callback} />
99-
100-
export const SidebarChildButton: React.FC<SidebarChildButtonPropsType> = ({
101-
parentRef,
102-
group,
103-
version,
104-
text,
105-
kind,
106-
namespaced,
107-
isSelected,
108-
onClick,
109-
}) => (
110-
<button
111-
type="button"
112-
className="dc__unset-button-styles"
113-
key={text}
114-
ref={parentRef}
115-
data-group={group}
116-
data-version={version}
117-
data-kind={kind}
118-
data-namespaced={namespaced}
119-
data-selected={isSelected}
120-
onClick={onClick}
121-
aria-label={`Select ${text}`}
122-
>
123-
<Tooltip content={text} placement="right">
124-
<div
125-
className={`fs-13 pointer dc__ellipsis-right dc__align-left dc__border-radius-4-imp fw-4 pt-6 lh-20 pr-8 pb-6 pl-8 ${
126-
isSelected ? 'bcb-1 cb-5' : 'cn-9 dc__hover-n50'
127-
}`}
128-
>
129-
{text}
130-
</div>
131-
</Tooltip>
132-
</button>
133-
)

0 commit comments

Comments
 (0)