Fix dropdown jump effect bug on mouse over in topics list (#1875)
* fix dropdown jump effect bug on mouse over in topics list * fix isHidden condition
This commit is contained in:
parent
4c76d07f04
commit
62f4778803
2 changed files with 7 additions and 4 deletions
|
@ -24,4 +24,5 @@ export const Link = styled(NavLink).attrs({ activeClassName: 'is-active' })<{
|
||||||
|
|
||||||
export const ActionsTd = styled(Td)`
|
export const ActionsTd = styled(Td)`
|
||||||
overflow: visible;
|
overflow: visible;
|
||||||
|
width: 50px;
|
||||||
`;
|
`;
|
||||||
|
|
|
@ -185,6 +185,8 @@ const List: React.FC<TopicsListProps> = ({
|
||||||
setRecreateTopicConfirmationVisible,
|
setRecreateTopicConfirmationVisible,
|
||||||
] = React.useState(false);
|
] = React.useState(false);
|
||||||
|
|
||||||
|
const isHidden = internal || isReadOnly || !hovered;
|
||||||
|
|
||||||
const deleteTopicHandler = React.useCallback(() => {
|
const deleteTopicHandler = React.useCallback(() => {
|
||||||
deleteTopic(clusterName, name);
|
deleteTopic(clusterName, name);
|
||||||
}, [name]);
|
}, [name]);
|
||||||
|
@ -200,8 +202,8 @@ const List: React.FC<TopicsListProps> = ({
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{!internal && !isReadOnly && hovered ? (
|
<div className="has-text-right">
|
||||||
<div className="has-text-right">
|
{!isHidden && (
|
||||||
<Dropdown label={<VerticalElipsisIcon />} right>
|
<Dropdown label={<VerticalElipsisIcon />} right>
|
||||||
{cleanUpPolicy === CleanUpPolicy.DELETE && (
|
{cleanUpPolicy === CleanUpPolicy.DELETE && (
|
||||||
<DropdownItem onClick={clearTopicMessagesHandler} danger>
|
<DropdownItem onClick={clearTopicMessagesHandler} danger>
|
||||||
|
@ -223,8 +225,8 @@ const List: React.FC<TopicsListProps> = ({
|
||||||
Recreate Topic
|
Recreate Topic
|
||||||
</DropdownItem>
|
</DropdownItem>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
</div>
|
)}
|
||||||
) : null}
|
</div>
|
||||||
<ConfirmationModal
|
<ConfirmationModal
|
||||||
isOpen={isDeleteTopicConfirmationVisible}
|
isOpen={isDeleteTopicConfirmationVisible}
|
||||||
onCancel={() => setDeleteTopicConfirmationVisible(false)}
|
onCancel={() => setDeleteTopicConfirmationVisible(false)}
|
||||||
|
|
Loading…
Add table
Reference in a new issue