diff --git a/packages/grafnode-components/package.json b/packages/grafnode-components/package.json index 2dd602c81..9a42970d5 100644 --- a/packages/grafnode-components/package.json +++ b/packages/grafnode-components/package.json @@ -24,6 +24,7 @@ "@fortawesome/fontawesome-svg-core": "^1.2.36", "@fortawesome/free-solid-svg-icons": "^5.15.4", "@fortawesome/react-fontawesome": "^0.1.16", + "@tabler/icons": "^1.46.0", "classnames": "^2.3.1", "codemirror": "^5.64.0", "escape-html": "^1.0.3", diff --git a/packages/grafnode-components/src/components/Sidebar/Collections/Collection/CollectionItem/StyledWrapper.js b/packages/grafnode-components/src/components/Sidebar/Collections/Collection/CollectionItem/StyledWrapper.js index e80da781c..b1232a933 100644 --- a/packages/grafnode-components/src/components/Sidebar/Collections/Collection/CollectionItem/StyledWrapper.js +++ b/packages/grafnode-components/src/components/Sidebar/Collections/Collection/CollectionItem/StyledWrapper.js @@ -1,6 +1,12 @@ import styled from 'styled-components'; const Wrapper = styled.div` + .menu-icon { + display: none; + flex-grow: 1; + justify-content: flex-end; + } + .collection-item-name { height: 1.875rem; cursor: pointer; @@ -10,9 +16,21 @@ const Wrapper = styled.div` transform: rotateZ(90deg); } - &.item-focused-in-tab, &:hover { + &.item-focused-in-tab { background:#ededed; } + + &:hover { + background: #f7f7f7; + .menu-icon { + display: flex; + } + } + + div.tippy-box { + position: relative; + top: -0.625rem; + } } `; diff --git a/packages/grafnode-components/src/components/Sidebar/Collections/Collection/CollectionItem/index.js b/packages/grafnode-components/src/components/Sidebar/Collections/Collection/CollectionItem/index.js index 57fb896d5..40c96c26d 100644 --- a/packages/grafnode-components/src/components/Sidebar/Collections/Collection/CollectionItem/index.js +++ b/packages/grafnode-components/src/components/Sidebar/Collections/Collection/CollectionItem/index.js @@ -1,11 +1,22 @@ -import React from 'react'; +import React, { useRef, forwardRef } from 'react'; import range from 'lodash/range'; -import { IconChevronRight } from '@tabler/icons'; +import get from 'lodash/get'; +import { IconChevronRight, IconDots } from '@tabler/icons'; import classnames from 'classnames'; +import Dropdown from '../../../../Dropdown'; import StyledWrapper from './StyledWrapper'; const CollectionItem = ({item, collectionId, actions, dispatch, activeRequestTabId}) => { + const dropdownTippyRef = useRef(); + + const MenuIcon = forwardRef((props, ref) => { + return ( +