diff --git a/.betterer.results b/.betterer.results index 6b4f429c1f8..4d50cf774cc 100644 --- a/.betterer.results +++ b/.betterer.results @@ -4363,12 +4363,6 @@ exports[`better eslint`] = { [0, 0, 0, "Unexpected any. Specify a different type.", "0"], [0, 0, 0, "Unexpected any. Specify a different type.", "1"] ], - "public/app/features/dashboard/components/SubMenu/DashboardLinksDashboard.tsx:5381": [ - [0, 0, 0, "Unexpected any. Specify a different type.", "0"], - [0, 0, 0, "Unexpected any. Specify a different type.", "1"], - [0, 0, 0, "Unexpected any. Specify a different type.", "2"], - [0, 0, 0, "Unexpected any. Specify a different type.", "3"] - ], "public/app/features/dashboard/components/SubMenu/SubMenu.tsx:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"] ], diff --git a/public/app/features/dashboard/components/SubMenu/DashboardLinksDashboard.tsx b/public/app/features/dashboard/components/SubMenu/DashboardLinksDashboard.tsx index 53ccd630a0b..3b74510d7be 100644 --- a/public/app/features/dashboard/components/SubMenu/DashboardLinksDashboard.tsx +++ b/public/app/features/dashboard/components/SubMenu/DashboardLinksDashboard.tsx @@ -2,6 +2,7 @@ import { css, cx } from '@emotion/css'; import React, { useRef, useState, useLayoutEffect } from 'react'; import { useAsync } from 'react-use'; +import { GrafanaTheme2 } from '@grafana/data'; import { sanitize, sanitizeUrl } from '@grafana/data/src/text/sanitize'; import { selectors } from '@grafana/e2e-selectors'; import { Icon, ToolbarButton, Tooltip, useStyles2 } from '@grafana/ui'; @@ -14,7 +15,7 @@ import { DashboardLink } from '../../state/DashboardModel'; interface Props { link: DashboardLink; linkInfo: { title: string; href: string }; - dashboardId: any; + dashboardId: number; } export const DashboardLinksDashboard: React.FC = (props) => { @@ -23,13 +24,7 @@ export const DashboardLinksDashboard: React.FC = (props) => { const [dropdownCssClass, setDropdownCssClass] = useState('invisible'); const [opened, setOpened] = useState(0); const resolvedLinks = useResolvedLinks(props, opened); - - const buttonStyle = useStyles2( - (theme) => - css` - color: ${theme.colors.text.primary}; - ` - ); + const styles = useStyles2(getStyles); useLayoutEffect(() => { setDropdownCssClass(getDropdownLocationCssClass(listRef.current)); @@ -41,17 +36,22 @@ export const DashboardLinksDashboard: React.FC = (props) => { <> setOpened(Date.now())} - className={cx('gf-form-label gf-form-label--dashlink', buttonStyle)} + className={cx('gf-form-label gf-form-label--dashlink', styles.button)} data-placement="bottom" data-toggle="dropdown" aria-expanded={!!opened} aria-controls="dropdown-list" aria-haspopup="menu" > - + {linkInfo.title} -