Skip to content

Commit b457b77

Browse files
committed
#4369 - update delete button for list
1 parent 1a7aada commit b457b77

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

redisinsight/ui/src/pages/browser/components/key-list/KeyList.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ const KeyList = forwardRef((props: Props, ref) => {
325325
{
326326
id: 'nameString',
327327
label: 'Key',
328-
minWidth: 100,
328+
minWidth: 94,
329329
truncateText: true,
330330
render: (cellData: string) => {
331331
if (isUndefined(cellData)) {
@@ -372,7 +372,7 @@ const KeyList = forwardRef((props: Props, ref) => {
372372
if (cellData === -1) {
373373
return (
374374
<EuiTextColor
375-
className={cx('hideOnHover', { hide: deletePopoverIndex === rowIndex })}
375+
className={cx('moveOnHover', { hide: deletePopoverIndex === rowIndex })}
376376
color="subdued"
377377
data-testid={`ttl-${name}`}
378378
>
@@ -382,7 +382,7 @@ const KeyList = forwardRef((props: Props, ref) => {
382382
}
383383
return (
384384
<EuiText
385-
className={cx('hideOnHover', { hide: deletePopoverIndex === rowIndex })}
385+
className={cx('moveOnHover', { hide: deletePopoverIndex === rowIndex })}
386386
color="subdued"
387387
size="s"
388388
style={{ maxWidth: '100%' }}
@@ -411,8 +411,8 @@ const KeyList = forwardRef((props: Props, ref) => {
411411
{
412412
id: 'size',
413413
label: 'Size',
414-
absoluteWidth: 84,
415-
minWidth: 84,
414+
absoluteWidth: 90,
415+
minWidth: 90,
416416
alignment: TableCellAlignment.Right,
417417
textAlignment: TableCellTextAlignment.Right,
418418
render: (
@@ -437,7 +437,7 @@ const KeyList = forwardRef((props: Props, ref) => {
437437
<EuiText
438438
color="subdued"
439439
size="s"
440-
className={cx('hideOnHover', { hide: deletePopoverIndex === rowIndex })}
440+
className={cx('moveOnHover', { hide: deletePopoverIndex === rowIndex })}
441441
style={{ maxWidth: '100%' }}
442442
>
443443
<div style={{ display: 'flex' }} className="truncateText" data-testid={`size-${name}`}>
@@ -457,7 +457,7 @@ const KeyList = forwardRef((props: Props, ref) => {
457457
</div>
458458
</EuiText>
459459
<EuiPopover
460-
anchorClassName={cx('showOnHover', { show: deletePopoverIndex === rowIndex })}
460+
anchorClassName={cx(styles.deleteAnchor, 'showOnHover', { show: deletePopoverIndex === rowIndex })}
461461
anchorPosition="rightUp"
462462
isOpen={deletePopoverIndex === rowIndex}
463463
closePopover={() => setDeletePopoverIndex(undefined)}

redisinsight/ui/src/pages/browser/components/key-list/styles.module.scss

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,16 @@
2020
.table {
2121
height: 100%;
2222

23+
.deleteAnchor {
24+
margin-right: -10px;
25+
}
26+
2327
:global {
2428
.ReactVirtualized__Table__row {
2529
.ReactVirtualized__Table__rowColumn {
26-
.hideOnHover {
27-
display: block;
28-
&.hide { display: none !important; }
30+
.moveOnHover {
31+
transition: transform ease 0.3s;
32+
&.hide { transform: translateX(-8px) }
2933
}
3034
.showOnHover {
3135
display: none;
@@ -34,7 +38,7 @@
3438

3539
&:hover {
3640
.ReactVirtualized__Table__rowColumn {
37-
.hideOnHover { display: none; }
41+
.moveOnHover { transform: translateX(-8px) }
3842
.showOnHover { display: block; }
3943
}
4044
}

0 commit comments

Comments
 (0)