Skip to content

Commit 73460be

Browse files
committed
#RI-31 - fix pr comments
1 parent 1fddabf commit 73460be

File tree

6 files changed

+38
-30
lines changed

6 files changed

+38
-30
lines changed

src/webviews/src/modules/keys-tree/components/keys-summary/KeysSummary.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export const KeysSummary = (props: Props) => {
128128
onClick={handleToggleShowTree}
129129
data-testid="keys-summary"
130130
>
131-
{<Chevron open={showTree} display={isMultiDbIndex} />}
131+
{<Chevron open={showTree} hidden={!isMultiDbIndex} />}
132132
{<DbIndex />}
133133
{<Summary />}
134134
</div>
Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
11
import React from 'react'
22
import cx from 'classnames'
3-
43
import { VscChevronDown, VscChevronRight } from 'react-icons/vsc'
5-
import styles from './styles.module.scss'
4+
import { IconBaseProps } from 'react-icons/lib'
65

7-
export interface Props {
6+
export interface Props extends IconBaseProps {
87
open?: boolean
9-
display?: boolean
8+
hidden?: boolean
9+
className?: string
1010
}
1111

12-
export const Chevron = ({ open = false, display = true }: Props) => {
13-
if (!display) return null
12+
export const Chevron = ({ open = false, hidden = false, className = '', ...props }: Props) => {
13+
if (hidden) return null
1414

1515
return open ? (
16-
<VscChevronDown className={cx(styles.icon, styles.iconNested)} />
16+
<VscChevronDown
17+
{...props}
18+
className={cx('sidebar-icon', 'sidebar-icon-nested', className)}
19+
/>
1720
) : (
18-
<VscChevronRight className={cx(styles.icon, styles.iconNested)} />
21+
<VscChevronRight
22+
{...props}
23+
className={cx('sidebar-icon', 'sidebar-icon-nested', className)}
24+
/>
1925
)
2026
}

src/webviews/src/ui/icons/chevron/styles.module.scss

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,28 @@
11
import React from 'react'
2+
import cx from 'classnames'
3+
import { IconBaseProps } from 'react-icons/lib'
24

35
import DatabaseOfflineIconSvg from 'uiSrc/assets/database/database_icon_offline.svg?react'
46
import DatabaseActiveIconSvg from 'uiSrc/assets/database/database_icon_active.svg?react'
5-
import styles from './styles.module.scss'
67

7-
export interface Props {
8+
export interface Props extends IconBaseProps {
89
open?: boolean
9-
display?: boolean
10+
hidden?: boolean
11+
className?: string
1012
}
1113

12-
export const DatabaseIcon = ({ open = false, display = true }: Props) => {
13-
if (!display) return null
14+
export const DatabaseIcon = ({ open = false, hidden = false, className = '', ...props }: Props) => {
15+
if (hidden) return null
1416

1517
return open ? (
16-
<DatabaseActiveIconSvg className={styles.icon} />
18+
<DatabaseActiveIconSvg
19+
{...props}
20+
className={cx('sidebar-icon', className)}
21+
/>
1722
) : (
18-
<DatabaseOfflineIconSvg className={styles.icon} />
23+
<DatabaseOfflineIconSvg
24+
{...props}
25+
className={cx('sidebar-icon', className)}
26+
/>
1927
)
2028
}

src/webviews/src/ui/icons/database/styles.module.scss

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/webviews/vscode.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ vscode-button::part(control) {
5353
@apply border-none;
5454
}
5555
}
56+
57+
.sidebar-icon {
58+
@apply mr-2 w-[14px] h-[14px] min-w-[14px] ml-[3px];
59+
60+
&-nested {
61+
@apply m-0;
62+
}
63+
}
5664
}
5765

5866
.table-loading:before {

0 commit comments

Comments
 (0)