fix: added min width to wrap long page names (#10121)

* fix: added min width to wrap long page names

* fix: adjusted the width on editing for contextMenu

* style: moved the editing style in the contextMenu

* refactor: added custom classes
This commit is contained in:
Keyur Paralkar 2022-01-06 16:04:36 +05:30 committed by GitHub
parent eec4527af4
commit cd68d70d2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 5 deletions

View File

@ -234,7 +234,9 @@ export const EntityName = forwardRef(
position={Position.TOP_LEFT}
>
<Wrapper
className={props.className}
className={`${
props.className ? props.className : ""
} ContextMenu`}
onDoubleClick={props.enterEditMode}
ref={targetRef}
>

View File

@ -24,7 +24,11 @@ import { Position } from "@blueprintjs/core";
const Container = styled.div`
padding: 12px;
padding-top: 6px;
width: 280px;
/* min width to be 280px i.e. 17.5rem to wrap long page names */
max-width: inherit;
min-width: 17.5rem;
background-color: ${Colors.GREY_1};
h4 {
@ -38,6 +42,14 @@ const Container = styled.div`
main {
padding: 4px;
}
& .ContextMenuPopOver .ContextMenu {
width: 10rem;
}
& .editing {
width: 10rem;
}
`;
const Header = styled.div`
@ -122,7 +134,9 @@ function ContextMenu(props: Props) {
<Container>
<Header>
<PageName>
<EditName page={page} />
<div className="ContextMenuPopOver">
<EditName page={page} />
</div>
</PageName>
<Actions>
<Action>

View File

@ -26,13 +26,13 @@ export const EditNameContainer = styled.div`
padding-left: 4px;
& > .page-list-item-edit-icon {
display: none;
visibility: hidden; /* Hide the visiblity when not hovered */
margin-left: 8px;
align-items: center;
}
&:hover .page-list-item-edit-icon {
display: flex;
visibility: visible; /* on Hover display the element */
}
& > div {