Skip to content

Commit

Permalink
chore(binary-plan): show eye icon to hide column when hover (#1574)
Browse files Browse the repository at this point in the history
  • Loading branch information
baurine authored Aug 16, 2023
1 parent 9752633 commit 7afbad0
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.colHeader {
span {
opacity: 0;
}
&:hover {
span {
opacity: 1;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { CopyLink, TxtDownloadLink } from '@lib/components'
import { BinaryPlanColsSelector } from './BinaryPlanColsSelector'
import { EyeOutlined } from '@ant-design/icons'

import styles from './index.module.less'

const COLUM_KEYS = [
'id',
'estRows',
Expand Down Expand Up @@ -213,13 +215,13 @@ export const BinaryPlanTable: React.FC<BinaryPlanTableProps> = ({
return [
{
name: (
<div>
<div className={styles.colHeader}>
id <EyeOutlined onClick={() => hideColumn('id')} />
</div>
) as any,
extra: 'id',
key: 'id',
minWidth: 100,
minWidth: 200,
maxWidth: 600,
onRender: (row: BinaryPlanItem) => {
return (
Expand All @@ -233,7 +235,7 @@ export const BinaryPlanTable: React.FC<BinaryPlanTableProps> = ({
},
{
name: (
<div>
<div className={styles.colHeader}>
estRows <EyeOutlined onClick={() => hideColumn('estRows')} />
</div>
) as any,
Expand All @@ -247,7 +249,7 @@ export const BinaryPlanTable: React.FC<BinaryPlanTableProps> = ({
},
{
name: (
<div>
<div className={styles.colHeader}>
estCost <EyeOutlined onClick={() => hideColumn('estCost')} />
</div>
) as any,
Expand All @@ -261,7 +263,7 @@ export const BinaryPlanTable: React.FC<BinaryPlanTableProps> = ({
},
{
name: (
<div>
<div className={styles.colHeader}>
actRows <EyeOutlined onClick={() => hideColumn('actRows')} />
</div>
) as any,
Expand All @@ -275,7 +277,7 @@ export const BinaryPlanTable: React.FC<BinaryPlanTableProps> = ({
},
{
name: (
<div>
<div className={styles.colHeader}>
task <EyeOutlined onClick={() => hideColumn('task')} />
</div>
) as any,
Expand All @@ -289,7 +291,7 @@ export const BinaryPlanTable: React.FC<BinaryPlanTableProps> = ({
},
{
name: (
<div>
<div className={styles.colHeader}>
access object{' '}
<EyeOutlined onClick={() => hideColumn('accessObject')} />
</div>
Expand All @@ -304,7 +306,7 @@ export const BinaryPlanTable: React.FC<BinaryPlanTableProps> = ({
},
{
name: (
<div>
<div className={styles.colHeader}>
execution info{' '}
<EyeOutlined onClick={() => hideColumn('executionInfo')} />
</div>
Expand All @@ -321,7 +323,7 @@ export const BinaryPlanTable: React.FC<BinaryPlanTableProps> = ({
},
{
name: (
<div>
<div className={styles.colHeader}>
operator info{' '}
<EyeOutlined onClick={() => hideColumn('operatorInfo')} />
</div>
Expand Down Expand Up @@ -350,7 +352,7 @@ export const BinaryPlanTable: React.FC<BinaryPlanTableProps> = ({
},
{
name: (
<div>
<div className={styles.colHeader}>
memory <EyeOutlined onClick={() => hideColumn('memory')} />
</div>
) as any,
Expand All @@ -364,7 +366,7 @@ export const BinaryPlanTable: React.FC<BinaryPlanTableProps> = ({
},
{
name: (
<div>
<div className={styles.colHeader}>
disk <EyeOutlined onClick={() => hideColumn('disk')} />
</div>
) as any,
Expand Down

0 comments on commit 7afbad0

Please sign in to comment.