Skip to content

Commit

Permalink
feat(view-manager): add context-menu
Browse files Browse the repository at this point in the history
  • Loading branch information
liujuping committed Jan 11, 2024
1 parent 45554b0 commit c24707e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
display: flex;
align-items: center;
height: 30px;
cursor: pointer;

&:hover {
background-color: var(--color-block-background-light, #f7f8fa);
}
}

&-expand {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@ function ResourceGroup(
}

const ContextMenu = props.pluginContext?.commonUI?.ContextMenu || React.Fragment;
const indent = props.depth * 28 + 12;

const style = {
paddingLeft: indent,
marginLeft: -indent,
}

return (
<div
Expand All @@ -156,12 +162,15 @@ function ResourceGroup(
<ContextMenu
menus={props.options?.resourceGroupContextMenuActions?.(props.pluginContext!, resourceArr) || []}
>
<div className='resource-tree-group-wrap'>
<div
className='resource-tree-group-wrap'
style={style}
onClick={() => {
setExpanded(!expanded);
}}
>
<div
className={`resource-tree-expand ${expanded ? 'expanded' : ''}`}
onClick={() => {
setExpanded(!expanded);
}}
>
<IconArrowRight />
</div>
Expand Down

0 comments on commit c24707e

Please sign in to comment.