Files
grafana/public/app/core/components/AppChrome/AppChromeUpdate.tsx
Ashley Harrison dd7f45011d SingleTopNav: Add toolbar to Page and replace usage of AppChromeUpdate (#94022)
* add page-level toolbar for actions

* handle explore

* fix panel edit sizing

* remove comments

* remove TOGGLE_BUTTON_ID

* undo alerting changes

* use fixed position header

* feature toggle Page changes

* add page context for alerting use cases

* simplify

* prettier...
2024-10-03 09:52:01 +01:00

24 lines
764 B
TypeScript

import { useLayoutEffect } from 'react';
import * as React from 'react';
import { useGrafana } from 'app/core/context/GrafanaContext';
export interface AppChromeUpdateProps {
actions?: React.ReactNode;
}
/**
* @deprecated This component is deprecated and will be removed in a future release.
*/
export const AppChromeUpdate = React.memo<AppChromeUpdateProps>(({ actions }: AppChromeUpdateProps) => {
const { chrome } = useGrafana();
// We use useLayoutEffect here to make sure that the chrome is updated before the page is rendered
// This prevents flickering actions when going from one dashboard to another for example
useLayoutEffect(() => {
chrome.update({ actions });
});
return null;
});
AppChromeUpdate.displayName = 'TopNavUpdate';