1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Apply styling and icons to resize anchors.

Co-authored-by: Alex Andreev <alex.andreev.email@gmail.com>
Signed-off-by: Alex Culliere <alozhkin@mirantis.com>
This commit is contained in:
Alex Culliere 2021-02-25 20:04:38 +02:00
parent 84dcf323cd
commit 4eafc6d81b
2 changed files with 33 additions and 8 deletions

View File

@ -29,6 +29,21 @@
min-height: 200px; min-height: 200px;
} }
.TableHead {
.TableCell {
display: flex;
justify-content: space-between;
}
&:hover {
.TableCell {
.resize-anchor {
opacity: 1;
}
}
}
}
.TableCell { .TableCell {
position: relative; position: relative;
@ -36,14 +51,17 @@
@include table-cell-action; @include table-cell-action;
} }
.resize-anchor { .resize-anchor {
position: absolute; transition: opacity 0.3s;
top: 0; opacity: 0;
right: 0; right: 0;
min-width: 5px;
user-select: none; user-select: none;
cursor: col-resize; cursor: col-resize;
background-color: gray; transform: rotate(90deg);
height: -webkit-fill-available; color: var(--textColorPrimary);
&:hover {
color: white;
}
} }
} }
} }

View File

@ -202,9 +202,16 @@ export class TableCell extends React.Component<TableCellProps> {
return ( return (
<div ref={this.cellContainer} style={cellStyle} {...cellProps} className={classNames} onClick={this.onClick}> <div ref={this.cellContainer} style={cellStyle} {...cellProps} className={classNames} onClick={this.onClick}>
{this.renderCheckbox()} {this.renderCheckbox()}
{_nowrap ? <div className="content">{content}</div> : content} <div className="flex align-center">
{this.renderSortIcon()} {_nowrap ? <div className="content">{content}</div> : content}
{resizable && <span {...resizeHandlers} className="resize-anchor"></span>} {this.renderSortIcon()}
</div>
{resizable && (
<span {...resizeHandlers} className="resize-anchor">
<Icon material="unfold_more" />
</span>
)}
</div> </div>
); );
} }